/**
 * BYVALG MODAL - COMPONENT CSS
 * Fil: /assets/css/components/byvalg_modal.css
 * 
 * BRUGES AF:
 * - byvalg_modal.php (component)
 * 
 * AFHÆNGIGHEDER:
 * - base/variables.css
 * - components/buttons.css
 * - components/forms.css
 * - components/modals.css (basis modal styles)
 */

/* =================================================================
   BYVALG MODAL (SPECIFIK)
   ================================================================= */

#byvalg-modal.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

/* Modal overlay */
#byvalg-modal .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

/* Modal content */
#byvalg-modal .modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease-out;
    margin: 0;
    padding: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Modal close button */
#byvalg-modal .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--mørk-grå);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

#byvalg-modal .modal-close:hover {
    background: var(--surface-2);
    color: var(--tekst);
}

/* =================================================================
   BYVALG INNER & ANMOD FORM
   ================================================================= */

.byvalg-modal-inner,
.anmod-by-form {
    padding: 2rem;
    padding-top: 3rem;
}

.byvalg-modal-inner h2,
.anmod-by-form h2 {
    color: var(--tekst);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.byvalg-modal-inner p,
.anmod-by-form p {
    color: var(--mørk-grå);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* =================================================================
   BY SØGNING
   ================================================================= */

.by-soeg-input {
    width: 100%;
    background: var(--surface);
    color: var(--tekst);
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
}

.by-soeg-input:focus {
    outline: none;
    border-color: var(--sekundær);
}

/* =================================================================
   SELECT STYLING
   ================================================================= */

.byvalg-modal-inner select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    background: var(--surface);
    color: var(--tekst);
    transition: border-color 0.2s ease;
}

/* Liste mode når der søges */
.byvalg-modal-inner select.liste-mode {
    size: 6;
    padding: 0.5rem;
}

.byvalg-modal-inner select:focus {
    outline: none;
    border-color: var(--sekundær);
}

.byvalg-modal-inner select option {
    padding: 0.5rem;
    cursor: pointer;
}

/* Submit button */
.byvalg-modal-inner button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
}

/* =================================================================
   ANMOD OM BY LINK
   ================================================================= */

.anmod-by-link {
    text-align: center;
    margin-top: 1rem;
}

.anmod-by-link a {
    color: var(--mørk-grå);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.anmod-by-link a:hover {
    color: var(--tekst);
}

/* =================================================================
   ANMOD FORM INPUTS
   ================================================================= */

.anmod-by-form .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    background: var(--surface);
}

.anmod-by-form .form-input:focus {
    outline: none;
    border-color: var(--sekundær);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.anmod-by-form .form-input::placeholder {
    color: var(--mørk-grå);
    opacity: 0.7;
}

.anmod-by-form textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* =================================================================
   ANMOD BUTTONS
   ================================================================= */

.anmod-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.anmod-buttons button {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
}

/* =================================================================
   SUCCESS MESSAGE
   ================================================================= */

.success-message {
    text-align: center;
    padding: 2rem;
    color: var(--success);
}

.success-message h3 {
    color: var(--success);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.success-message p {
    color: var(--tekst);
    margin-bottom: 1rem;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (max-width: 768px) {
    #byvalg-modal .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .byvalg-modal-inner,
    .anmod-by-form {
        padding: 1.5rem;
        padding-top: 2.5rem;
    }
    
    .byvalg-modal-inner h2,
    .anmod-by-form h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    #byvalg-modal .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .byvalg-modal-inner,
    .anmod-by-form {
        padding: 1rem;
        padding-top: 2rem;
    }
    
    .byvalg-modal-inner h2,
    .anmod-by-form h2 {
        font-size: 1.3rem;
    }
    
    .anmod-buttons {
        flex-direction: column;
    }
}
