/* style.css */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; width: 100%; max-width: 100%; overflow-x: hidden; }
body { font-family: 'Inter', sans-serif; line-height: 1.6; color: #333; background-color: #f4f7f6; width: 100%; max-width: 100%; overflow-x: hidden; }

/* Hero Section spezifisch */
.hero-section { background: url('https://images.unsplash.com/photo-1509062522246-3755977927d7?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover; color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }

/* Section Title Styling */
.section-title { position: relative; padding-bottom: 20px; }
.modal-content .section-title::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 50px; background-color: #ffc107; }
.section-title.mx-auto span { position: relative; display: inline-block; }
.section-title.mx-auto span::after { content: ''; position: absolute; left: 0; bottom: -10px; height: 3px; width: 50px; background-color: #ffc107; }

/* Modal Basis-Styling */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; visibility: hidden; opacity: 0; transition: visibility 0s, opacity 0.3s ease-in-out; padding: 1rem; /* Padding für mobile Ansicht, damit Modal nicht am Rand klebt */ }
.modal-overlay.visible { visibility: visible; opacity: 1; }
.modal-content { background-color: #fff; padding: 1.5rem; /* Weniger Padding auf Mobilgeräten */ border-radius: 0.5rem; max-width: 800px; width: 100%; /* Volle Breite auf Mobilgeräten innerhalb des Paddings der Overlay */ max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); }

/* Spezifische Modal Breiten - Desktop bleibt, mobil wird durch obiges width: 100% beeinflusst */
@media screen and (min-width: 640px) { /* sm Breakpoint von Tailwind und größer */
    .modal-content { padding: 2rem; /* Padding für Desktop wiederherstellen */ }
    #loginModal .modal-content { max-width: 400px; }
    #createActionModal .modal-content, #editActionModal .modal-content, #nachhilfeSuchenModal .modal-content { max-width: 600px; /* Etwas schmaler als 800 für bessere Lesbarkeit */ }
    #nachhilfeRegistrationsModal .modal-content { max-width: 90vw; /* Beibehalten */ }
}
@media screen and (min-width: 1024px) { /* lg Breakpoint von Tailwind und größer */
     #createActionModal .modal-content, #editActionModal .modal-content, #nachhilfeSuchenModal .modal-content { max-width: 800px; /* Originalbreite für große Screens */ }
}


#nachhilfeRegistrationsModal #tutor-registrations-table-container,
#nachhilfeRegistrationsModal #student-registrations-table-container {
    overflow-x: auto; /* Beibehalten für Tabellen */
}

/* Notification Modal (spezielle Positionierung) */
#notificationModal { justify-content: flex-end; align-items: flex-start; padding-right: 1rem; padding-top: calc(4rem + 1rem); }
#notificationModal .modal-content { max-width: 350px; width: 90%; max-height: 60vh; overflow-y: auto; margin-right: 1rem; margin-top: 1rem; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }

/* Close Button für Modals */
.close-button { position: absolute; top: 0.5rem; right: 0.75rem; /* Näher am Rand für mobile Modals */ font-size: 1.8rem; /* Etwas größer für bessere Tippbarkeit */ cursor: pointer; color: #333; z-index: 10; }

/* Aktion Hinzufügen Karte */
#add-action-card { border: 3px dashed #ccc; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: #ccc; cursor: pointer; transition: border-color 0.3s ease, color 0.3s ease; background-color: #fff; min-height: 250px; /* Etwas weniger Höhe für mobil */ }
#add-action-card:hover { border-color: #ffc107; color: #ffc107; }
#add-action-card .fas { font-size: 2.5rem; /* Etwas kleiner für mobil */ margin-bottom: 0.5rem; }
@media screen and (min-width: 768px) {
    #add-action-card { min-height: 300px; } /* Höhe für Desktop */
    #add-action-card .fas { font-size: 3rem; }
}


/* Edit Button auf Aktionskarten */
.edit-button { cursor: pointer; color: #007bff; margin-left: 1rem; transition: color 0.3s ease; }
.edit-button:hover { color: #0056b3; }

/* Aktionskarten Layout */
.action-card { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.action-card .p-6 { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.action-card .p-6 .text-gray-600 { flex-grow: 1; }
.action-card .card-buttons { display: flex; flex-wrap: wrap; /* Erlaube Umbruch auf Mobilgeräten */ justify-content: space-between; align-items: center; margin-top: 1rem; gap: 0.5rem; /* Abstand zwischen Buttons bei Umbruch */ }

/* Drag & Drop Area */
.drag-drop-area { border: 2px dashed #ccc; padding: 1rem; text-align: center; cursor: pointer; transition: border-color 0.3s ease; }
.drag-drop-area.dragover { border-color: #ffc107; }

/* Input type="color" Styling */
input[type="color"] { min-width: 50px; width: 50px; height: 30px; padding: 0; border: none; background: none; cursor: pointer; }
.flex input[type="color"] { flex-grow: 0; }

/* Registrierungstabellen (Allgemein für Aktionen und Nachhilfe) */
.registration-table { width: 100%; border-collapse: collapse; margin-top: 1rem; display: block; /* Macht Tabelle scrollbar auf kleinen Screens */ overflow-x: auto; /* Erlaubt horizontales Scrollen */ }
.registration-table th, .registration-table td { border: 1px solid #ddd; padding: 6px; /* Weniger Padding für mobile */ text-align: left; font-size: 0.8rem; /* Kleinere Schrift für mobile Tabellen */ white-space: nowrap; /* Verhindert unschönen Umbruch in Zellen */ }
.registration-table th { background-color: #f2f2f2; font-weight: bold; }
.registration-table tr:nth-child(even) { background-color: #f9f9f9; }
.registration-table tr:hover { background-color: #e9e9e9; }

@media screen and (min-width: 768px) {
    .registration-table { display: table; /* Standard Tabellenlayout für Desktop */ overflow-x: visible; }
    .registration-table th, .registration-table td { font-size: 0.875rem; padding: 8px; /* Original Padding */ }
}


/* Nachhilfe Portal spezifisch */
.nachhilfe-mode-button { padding: 0.6rem 1rem; /* Etwas kleiner auf Mobil */ border-radius: 0.5rem; font-weight: bold; transition: background-color 0.3s ease, color 0.3s ease; font-size: 0.9rem; }
.nachhilfe-mode-button.active { background-color: #ffc107; color: white; }
.nachhilfe-mode-button:not(.active) { background-color: #e5e7eb; color: #333; }
@media screen and (min-width: 640px) {
    .nachhilfe-mode-button { padding: 0.75rem 1.5rem; font-size: 1rem; } /* Originalgröße Desktop */
}

.nachhilfe-subject-card { background-color: white; border-radius: 0.5rem; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); padding: 1rem; /* Weniger Padding mobil */ text-align: center; display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.nachhilfe-subject-card h4 { font-size: 1.1rem; /* Etwas kleiner mobil */ font-weight: bold; margin-bottom: 0.5rem; color: #333; }
.nachhilfe-subject-card p { color: #555; margin-bottom: 0.8rem; /* Etwas weniger Margin */ flex-grow: 1; font-size: 0.85rem; /* Etwas kleiner mobil */ }
.nachhilfe-subject-card button { background-color: #4CAF50; color: white; padding: 0.5rem 0.8rem; /* Kleineres Padding mobil */ border-radius: 0.25rem; transition: background-color 0.3s ease; width: 100%; margin-top: auto; font-size: 0.9rem; }
.nachhilfe-subject-card button:hover { background-color: #45a049; }
@media screen and (min-width: 640px) {
    .nachhilfe-subject-card { padding: 1.5rem; }
    .nachhilfe-subject-card h4 { font-size: 1.25rem; }
    .nachhilfe-subject-card p { font-size: 0.9rem; margin-bottom: 1rem; }
    .nachhilfe-subject-card button { padding: 0.5rem 1rem; font-size: 1rem; }
}


/* --- Allgemeine Formular Elemente --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    background-color: white;
    color: #333333;
    border: 1px solid #d1d5db;
    padding: 0.6rem; /* Etwas weniger Padding für mobile */
    font-size: 0.9rem; /* Kleinere Schrift für mobile */
    border-radius: 0.25rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: 100%;
}
input[type="file"] { padding: 0; width: auto; }

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.3);
    outline: 0;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
    color: #9ca3af;
}
@media screen and (min-width: 640px) { /* Wiederherstellung für Desktop */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        padding: 0.75rem;
        font-size: 1rem;
    }
}


/* --- Spezifische Stile für das Kontaktformular im dunklen Bereich (#kontakt) --- */
#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form textarea,
#contact-form select {
    background-color: #4b5563; /* Tailwind gray-600 */
    color: #ffffff;
    border-color: #6b7280; /* Tailwind gray-500 */
}

#contact-form input[type="text"]::placeholder,
#contact-form input[type="email"]::placeholder,
#contact-form textarea::placeholder {
    color: #9ca3af; /* Tailwind gray-400 */
}

#contact-form input[type="text"]:focus,
#contact-form input[type="email"]:focus,
#contact-form textarea:focus,
#contact-form select:focus {
    border-color: #f59e0b; /* Tailwind yellow-500 */
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
    background-color: #374151; /* Tailwind gray-700 */
    color: #ffffff;
}

/* Korrektur/Präzisierung: Farbe für Label und Link der Privacy Checkbox im Kontaktformular */
#contact-form .privacy-checkbox-container label {
    color: #d1d5db; /* Tailwind gray-300 */
}
#contact-form .privacy-checkbox-container label a {
    color: #f59e0b; /* Tailwind yellow-500 (oder yellow-600, je nach Präferenz) */
}
#contact-form .privacy-checkbox-container label a:hover {
    text-decoration: underline;
}


/* Privacy Checkbox Container (Allgemein) */
.privacy-checkbox-container { display: flex; align-items: flex-start; /* Bessere Ausrichtung bei langem Text */ margin-top: 1rem; margin-bottom: 1rem; }
.privacy-checkbox-container input[type="checkbox"] { margin-right: 0.5rem; box-shadow: none; width: auto; flex-shrink: 0; /* Verhindert Schrumpfen der Checkbox */ margin-top: 0.2rem; /* Bessere vertikale Ausrichtung zum Text */ }
.privacy-checkbox-container label { font-size: 0.8rem; /* Etwas kleiner für mobil */ color: #555; }
.privacy-checkbox-container label a { color: #007bff; text-decoration: underline; }
@media screen and (min-width: 640px) {
    .privacy-checkbox-container label { font-size: 0.875rem; } /* Originalgröße Desktop */
}


/* Nachhilfe Anbieten Formular spezifisch (im hellen Bereich) */
#nachhilfeAnbietenForm label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #333; }
.tutor-subject-button { padding: 0.5rem 0.8rem; /* Etwas kleiner mobil */ border-radius: 0.25rem; margin: 0.25rem; cursor: pointer; transition: background-color 0.3s ease, color 0.3s ease; border: 1px solid #d1d5db; font-size: 0.85rem; }
.tutor-subject-button:not(.selected) { background-color: #e5e7eb; color: #333; }
.tutor-subject-button.selected { background-color: #4CAF50; color: white; border-color: #4CAF50; }
.tutor-subject-button:hover:not(.selected) { background-color: #d1d5db; }
@media screen and (min-width: 640px) {
    .tutor-subject-button { padding: 0.5rem 1rem; font-size: 1rem; } /* Originalgröße Desktop */
}


/* Range Slider Wertanzeige */
.range-value-display { font-weight: bold; margin-left: 0.5rem; }

/* Registrierung Löschen Button (Icon-Button) */
.delete-registration-button {
    background-color: transparent;
    color: #ef4444;
    padding: 0.25rem;
    border-radius: 0.25rem;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: color 0.3s ease, transform 0.2s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.delete-registration-button:hover {
    color: #dc2626;
    transform: scale(1.1);
}

/* Benachrichtigungen */
.notification-icon-container { position: relative; cursor: pointer; margin-left: 1rem; display: none; }
.notification-icon-container .fas { font-size: 1.5rem; color: #333; }
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background-color: red;
    border-radius: 50%;
    
    /* NEU: Flexbox für perfektes Zentrieren */
    display: flex;
    justify-content: center;
    align-items: center;
    
    font-size: 0.7rem;
    color: white;
    font-weight: bold;
    
    /* 'display: none' wird vom JavaScript gesteuert, aber wir können es als Standard setzen */
    /* HINWEIS: 'line-height' und 'text-align' werden durch Flexbox überflüssig und können entfernt werden. */
}
.notification-list { list-style: none; padding: 0; margin: 0; }
.notification-item { padding: 0.75rem; border-bottom: 1px solid #eee; font-size: 0.9rem; color: #555; }
.notification-item.clickable-notification { cursor: pointer; transition: background-color 0.2s ease; }
.notification-item.clickable-notification:hover { background-color: #f0f0f0; }
.notification-item:last-child { border-bottom: none; }
.notification-item strong { color: #333; }
.notification-item.unread { background-color: #fff3e0; }
.notification-item.unread.clickable-notification:hover { background-color: #ffe0b2; }
.notification-item span.timestamp { display: block; font-size: 0.75rem; color: #888; margin-top: 0.25rem; }
.clear-notifications-button { display: block; width: 100%; background-color: #e5e7eb; color: #333; padding: 0.75rem; border-radius: 0.25rem; font-weight: bold; text-align: center; margin-top: 1rem; transition: background-color 0.3s ease; cursor: pointer; border: none; }
.clear-notifications-button:hover { background-color: #d1d5db; }

/* Dokumenten-Vorschau im Modal */
.document-preview-item { display: inline-flex; flex-direction: column; align-items: center; text-align: center; margin: 0.5rem; padding: 0.5rem; border: 1px solid #eee; border-radius: 0.25rem; width: 100px; /* Schmaler für mobil */ cursor: pointer; transition: box-shadow 0.2s ease; background-color: #fff; }
.document-preview-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.document-preview-item img.thumbnail, .document-preview-item .icon-thumbnail { width: 60px; /* Kleiner für mobil */ height: 60px; object-fit: contain; margin-bottom: 0.5rem; border: 1px solid #ddd; }
.document-preview-item .icon-thumbnail { display: flex; justify-content: center; align-items: center; font-size: 2rem; /* Kleiner für mobil */ color: #777; background-color: #f8f9fa; width: 60px; height: 60px; border: 1px solid #ddd;}
.document-preview-item .document-name { font-size: 0.7rem; /* Kleiner für mobil */ word-break: break-all; line-height: 1.2; max-height: 2.4em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: auto; }
#modal-documents-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; /* Zentriert bei Umbruch */ gap: 0.5rem; /* Weniger Gap mobil */ }
@media screen and (min-width: 640px) {
    .document-preview-item { width: 120px; }
    .document-preview-item img.thumbnail, .document-preview-item .icon-thumbnail { width: 80px; height: 80px; font-size: 3rem; }
    .document-preview-item .document-name { font-size: 0.75rem; }
    #modal-documents-list { justify-content: flex-start; gap: 1rem; }
}


/* Lade- und Fehlermeldungen */
.loading-indicator { text-align: center; padding: 2rem; font-style: italic; color: #666; }
.error-message { color: red; text-align: center; margin-top: 1rem; font-weight: bold; padding: 0.5rem; background-color: #ffebee; border: 1px solid #ef9a9a; border-radius: 0.25rem;}

/* Buttons in Formularen (Breite und Ausrichtung) */
#login-form button,
#create-action-form button[type="submit"],
#edit-action-form button[type="submit"],
#nachhilfe-suchen-form button[type="submit"],
#nachhilfeAnbietenForm button[type="submit"],
#contact-form button[type="submit"] {
    width: 100%;
}
#edit-action-form #delete-action-button {
    width: 100%;
    margin-top: 0.5rem;
}

/* Dateilisten in Erstellen/Bearbeiten Modal */
#create-action-documents-list div,
#edit-action-documents-list div {
    padding: 0.5rem;
    border: 1px solid #eee;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    background-color: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}
#create-action-documents-list .remove-document-button,
#edit-action-documents-list .remove-document-button {
     background: none;
     border: none;
     color: #ef4444;
     cursor: pointer;
     font-size: 1rem;
     padding: 0 0.5rem;
}
#create-action-documents-list .remove-document-button:hover,
#edit-action-documents-list .remove-document-button:hover {
    color: #dc2626;
}

/* Screenreader-Only Klasse */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Sponsoren Bereich --- */
.sponsor-long-description {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
}
.sponsor-long-description.expanded {
    /* max-height wird durch JS dynamisch auf scrollHeight gesetzt */
}
.sponsor-toggle-button i {
    transition: transform 0.3s ease-in-out;
}


/* --- Zusätzliche Mobile Optimierungen --- */

/* Header Anpassungen für Mobilgeräte */
@media screen and (max-width: 767px) { /* md Breakpoint von Tailwind */
    header nav {
        /* Die Tailwind-Klassen flex-col md:flex-row sollten das meiste schon regeln.
           Hier könnten spezifische Anpassungen für Abstände oder das Logo stehen, falls nötig. */
    }
    header nav .flex.items-center.mb-4.md\:mb-0 { /* Logo und Titel Container */
        flex-direction: column; /* Logo über Text, falls es nebeneinander zu eng wird */
        align-items: center;
        text-align: center;
    }
    header nav .flex.items-center.mb-4.md\:mb-0 img {
        height: 4rem; /* Kleineres Logo auf Mobilgeräten, md:h-32 ist für Desktop */
        margin-bottom: 0.5rem;
    }
     header nav .text-gray-800.text-center.md\:text-left { /* Titel neben Logo */
        text-align: center !important; /* Sicherstellen, dass es zentriert ist */
    }

    header nav .flex.flex-col.md\:flex-row.items-center { /* Navigationslinks und Buttons */
        margin-top: 1rem; /* Abstand zum Logo-Bereich */
    }
    header nav .flex.flex-col.md\:flex-row.items-center a,
    header nav .flex.flex-col.md\:flex-row.items-center button {
        width: 100%; /* Volle Breite für bessere Tippbarkeit */
        margin-bottom: 0.5rem; /* Abstand zwischen den Elementen */
        text-align: center;
    }
    header nav .flex.flex-col.md\:flex-row.items-center button {
        padding-top: 0.75rem; padding-bottom: 0.75rem; /* Größere Klickfläche für Buttons */
    }
    #notification-icon-container {
        margin-left: 0; /* Kein linker Rand, wenn es unter den anderen Buttons ist */
        margin-top: 0.5rem; /* Etwas Abstand nach oben */
    }
}

/* Hero Section Textgrößen für Mobilgeräte */
@media screen and (max-width: 640px) { /* sm Breakpoint */
    .hero-section h1 {
        font-size: 2.5rem; /* text-4xl Äquivalent */
        line-height: 1.2;
    }
    .hero-section p {
        font-size: 1.125rem; /* text-lg Äquivalent */
        margin-bottom: 1.5rem; /* Weniger Margin */
    }
    .hero-section .flex-col.md\:flex-row a { /* Buttons in Hero-Sektion */
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Spenden Sektion - Boxen untereinander auf Mobilgeräten */
@media screen and (max-width: 767px) { /* md Breakpoint */
    #spenden .flex-col.md\:flex-row {
        /* Die Tailwind-Klassen flex-col md:flex-row sollten das regeln.
           Hier nur, falls zusätzliche Anpassungen nötig sind. */
    }
    #spenden .flex-col.md\:flex-row > div { /* PayPal und Überweisung Boxen */
        width: 100%; /* Volle Breite */
        margin-bottom: 1.5rem;
    }
    #spenden .flex-col.md\:flex-row > div:last-child {
        margin-bottom: 0;
    }
     #spenden #qr-code-area, #spenden #bank-details-area {
        min-height: auto; /* Höhe anpassen, da sie nicht mehr nebeneinander sind */
    }
    #spenden #qr-code-image {
        width: 120px; height: 120px; /* Kleinere QR-Codes */
    }
}

/* Sponsoren Bereich auf Mobilgeräten */
@media screen and (max-width: 767px) { /* md Breakpoint */
    #sponsoren-grid .sponsor-item img { /* Logo etwas kleiner auf mobil */
        height: 4.5rem; /* ca. h-18 */
    }
     #sponsoren-grid .sponsor-item h3 {
        font-size: 1.125rem; /* text-lg */
    }
    #sponsoren-grid .sponsor-item p {
        font-size: 0.875rem; /* text-sm */
    }
    #sponsoren-grid .sponsor-item .sponsor-toggle-button {
        font-size: 0.875rem; /* text-sm */
    }
}


/* Kontaktformular auf Mobilgeräten */
@media screen and (max-width: 640px) {
    #kontakt .max-w-2xl { /* Container des Kontaktformulars */
        padding: 1rem; /* Weniger Padding im Formular-Container */
    }
    #kontakt h3 { /* Überschrift "Schreib uns eine Nachricht" */
        font-size: 1.5rem; /* Etwas kleiner */
    }
}

/* Allgemeine Schriftgrößen für Body-Text und Paragraphen auf sehr kleinen Screens */
@media screen and (max-width: 480px) {
    body {
        font-size: 0.9rem;
    }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.1rem; }
    p, li { font-size: 0.9rem; }

    /* Footer-Text kleiner */
    footer .text-sm {
        font-size: 0.75rem;
    }
}