/* css/_contact.css - Allgemeine Modal-Logik (Kontakt, Wetter, Teilen) */
/* NEU: Allgemeine Regel für Überschriften (h2) in allen Modals */
.modal-content h2 {
    /* Setzt die Farbe auf Orange (var(--accent-color)) */
    color: var(--accent-color); 
    
    /* Stellt sicher, dass die Ausrichtung und Schriftart übereinstimmen */
    text-align: center;
    font-family: 'Exo 2', system-ui, sans-serif;
    
    /* Gängige Abstände und Größe */
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    
    /* NEU HINZUGEFÜGT: Stellt die Unterstrich-Linie her */
    border-bottom: 1px solid var(--divider-color); 
    padding-bottom: 10px; 
}
/* ========================================================================= */
/* MODAL OVERLAY & STRUKTUR (Gilt für ALLE Modals)*/
/* ========================================================================= */
.modal { 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* FIX: Setze die Höhe explizit auf 100vh für zuverlässiges Scrollen */
    height: 100vh; 
    min-height: 100%; /* Beibehalten für ältere Browser */
    
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    
    padding: 0; 
    
    display: none;
    opacity: 0;
    
    justify-content: center;
    
    /* MODAL-INHALT BEGINNT OBEN (WICHTIG für scrollbare Inhalte) */
    align-items: flex-start; 
    
    transition: opacity 0.3s ease;
    
    /* SCROLL-LOGIK IST HIER: Das Overlay scrollt, wenn der Content + Margins zu groß sind.
       Dies stellt sicher, dass margin-bottom: 50px immer sichtbar ist. */
    overflow-y: auto; 
    
    /* Scrollbar-Styles für das Overlay */
    scrollbar-color: var(--accent-color) var(--bg-color);
    scrollbar-width: thin;
}

/* Spezialklasse für Modals, die zentriert sein sollen (z.B. Teilen/Share) */
.modal.modal-center-aligned {
    /* Setzt die Ausrichtung auf CENTER, um bei kurzen Inhalten oben und unten Abstand zu haben */
    align-items: center;
}


.modal.active {
    display: flex;
    opacity: 1;
}

/* Basis-Content-Box (für alle Modals) */
.modal-content, .contact-content, .weather-content {
    background: var(--panel-bg);
    padding: 2rem;
    border-radius: 10px;
    
    max-width: 500px; /* Wird für Wetter in _weather.css überschrieben */
    width: 90%; 
    box-shadow: 0 5px 20px var(--shadow-color);
    position: relative;
    
    /* FIX FÜR GLEICHEN ABSTAND OBEN UND UNTEN: */
    /* Setzt den Margin für den grauen Abstand oben und unten. */
    margin-top: 50px; 
    margin-bottom: 50px; 
    
    /* WICHTIG: KEINE SCROLL-LOGIK ODER MAX-HEIGHT HIER! */
    /* Die Höhe wird vom Inhalt bestimmt, und das Scrollen wird vom .modal-Overlay übernommen. */
    max-height: none; 
    overflow-y: visible;
}

/* --- SCROLLBAR STYLES (jetzt für das Overlay) --- */
.modal::-webkit-scrollbar {
    width: 8px;
}
.modal::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
}
.modal::-webkit-scrollbar-track {
    background: var(--bg-color);
}
/* ------------------------------------------------------------------ */

/* HIER ZUR SICHERHEIT DIE VORHERIGEN SCROLLBAR-STYLES ENTFERNEN (kein Effekt, aber sauberer) */
.modal-content::-webkit-scrollbar, .contact-content::-webkit-scrollbar, .weather-content::-webkit-scrollbar {
    width: 0; /* Versteckt die Scrollbar, falls doch mal aktiviert */
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    line-height: 1;
    transition: color 0.2s;
    /* KRITISCHER FIX: Z-Index über allem Inhalt garantieren */
    z-index: 100;
}

.close-btn:hover {
    color: #ff4757; 
}

/* ========================================================================= */
/* KONTAKTFORMULAR SPEZIFISCHE STYLES (Unverändert)                          */
/* ========================================================================= */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold; 
}

/* Basis-Style für ALLE Inputs/Textareas */
.form-group input:not(#captchaInput), 
.form-group textarea { 
    width: 100%;
    padding: 10px;
    border: 1px solid var(--divider-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    
    font-family: 'Orbitron', system-ui, sans-serif; 
    font-size: 1em; 
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:not(#captchaInput):focus, 
.form-group textarea:focus { 
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(93, 93, 255, 0.3); 
}

/* RATING (Sterne) */
.rating-stars {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}
.rating-stars label {
    font-weight: bold; 
    margin-bottom: 5px;
}
.rating-stars .stars {
    font-size: 1.5em;
    color: gold; 
    cursor: pointer;
    margin-top: 0; 
}
.rating-stars .stars i {
    transition: transform 0.1s;
    margin-right: 5px; 
}
.rating-stars .stars i:hover {
    transform: scale(1.1);
}

/* CAPTCHA STYLES */
.captcha-group {
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    padding: 15px;
    margin-top: 30px; 
    margin-bottom: 10px; 
}

.captcha-line {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.captcha-display {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    
    font-family: 'Orbitron', system-ui, sans-serif; 
    font-size: 1.3rem; 
    font-weight: bold;
    color: var(--accent-color); 
    
    background: var(--bg-color);
    border: 2px solid var(--accent-color); 
    border-radius: 5px;
    padding: 3px; 
    min-height: 40px;
}

.captcha-line button {
    flex-shrink: 0;
    width: 50px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5p x;
    font-size: 1.2em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.captcha-line button:hover {
    background: darkorange;
}
.captcha-line button:active {
    transform: scale(0.95);
}

/* CAPTCHA-INPUT STYLES */
#captchaInput { 
    width: 100%;
    padding: 10px; 
    margin-top: 10px; 
    
    border: 1px solid var(--divider-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    
    font-family: 'Orbitron', system-ui, sans-serif !important; 
    font-size: 1em !important; 
}

#captchaInput:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(93, 93, 255, 0.3); 
}


/* VALIDIERUNGSFARBEN */
.form-group.invalid input, 
.form-group.invalid textarea,
.form-group.invalid #captchaInput { 
    border-color: #ff4757 !important; 
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.3) !important;
}

.form-group.valid input:not(#captchaInput), 
.form-group.valid textarea { 
    border-color: #2ed573; 
    box-shadow: 0 0 0 2px rgba(46, 213, 115, 0.5); 
}

.form-group.valid #captchaInput { 
    border-color: #2ed573 !important; 
    box-shadow: 0 0 0 2px rgba(46, 213, 115, 0.5) !important; 
}


/* SENDE-BUTTON & STATUS */

#sendButton {
    background: var(--accent-color); 
    color: var(--text-color-bright); 
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    width: 100%;
    transition: background 0.3s, opacity 0.3s;
    
    font-family: 'Orbitron', system-ui, sans-serif;
}

#sendButton:hover:not(:disabled) {
    background: darkorange; 
}

#sendButton:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-status {
    text-align: center;
    margin-top: 5px; 
    font-family: 'Orbitron', system-ui, sans-serif;
    min-height: 1.5em; 
}
.form-status.error {
    color: #ff4757;
}
.form-status.success {
    color: #2ed573;
}

/* MEDIA QUERY */
@media (max-width: 400px) {
    .contact-content, .weather-content {
        padding: 1rem; 
    }
    
    .contact-content h2, .weather-content h2 {
        font-size: 1.2rem;
    }
    
    .captcha-display, .captcha-line button {
        font-size: 1.1rem;
    }
    .captcha-line button {
        width: 40px;
    }
}
