/* modal.css */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--color-white);
    border-radius: var(--modal-radius);
    max-width: var(--modal-max-width);
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 16px 20px;
    border-radius: var(--modal-radius) var(--modal-radius) 0 0;
    font-weight: 600;
    font-size: 16px;
    color: var(--color-white);
}

.modal-header-info {
    background: var(--color-primary);
}

.modal-header-success {
    background: var(--color-success);
}

.modal-header-warning {
    background: var(--color-warning);
}

.modal-header-danger,
.modal-header-error {
    background: var(--color-danger);
}

.modal-body {
    padding: 20px;
    color: var(--color-text);
    line-height: 1.5;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    flex-shrink: 0;
    width: auto;
}

.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border-dark);
    border-radius: var(--btn-radius);
    font-size: var(--btn-font-size);
    margin-top: 10px;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.modal-loading {
    text-align: center;
}

.modal-loading .modal-body {
    padding: 30px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Event-modal innehåll */
.event-modal,
.news-modal,
.faq-modal {
    position: relative;
}

.event-modal-date,
.event-modal-location,
.event-modal-description,
.news-modal-meta,
.news-modal-content,
.faq-modal-answer {
    position: relative;
    margin: 0 0 10px 0;
}

.event-modal-date {
    font-weight: 500;
    color: var(--color-primary);
}

.event-modal-location {
    color: var(--color-text-muted);
}

.event-modal-description {
    margin-top: 15px;
    line-height: 1.6;
}

.news-modal-meta {
    color: var(--color-text-muted);
    font-size: 0.9em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 15px;
}

.faq-modal-answer {
    line-height: 1.6;
}

/* Bred modal för info/nyheter (50% bredare än standard) */
.modal-overlay .modal.modal-wide {
    max-width: 600px !important;
}

/* Extra bred modal för formulär med editor */
.modal-overlay .modal.modal-extra-wide {
    max-width: 800px !important;
}

