/* ==========================================================================
   1. VARIABLES & RESET (Abgestimmt auf deinen Galileo-Style)
   ========================================================================= */
:root {
    --bg-color: #f8f9fa;         /* Reizarmes Hellgrau */
    --card-bg: #ffffff;          /* Reines Weiß */
    --border-color: #e2e5e9;     /* Sanfte Trennlinien */
    --brand-dark: #37404e;       /* Haupt-Schiefergrau */
    --brand-light: #727e8e;      /* Helles Grau */
    --brand-blue: #4169e1;       /* Königsblau */
    --brand-blue-hover: #2e54c7; 
    --error-red: #d32f2f;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--brand-dark);
    font-family: var(--font-family);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    display: block; /* Verhindert das unkontrollierte Zentrieren auf Dashboard-Seiten */
    min-height: 100vh;
    padding: 24px;
}

/* Hilfsklasse, um Inhalte nur auf der Login-Seite vertikal zu zentrieren */
.flex-center {
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   2. ANMELDEMASKE (SCHMUTZFREIES RASTER)
   ========================================================================= */
.login-wrapper {
    width: 100%;
    max-width: 440px;
    background-color: var(--card-bg);
    padding: 48px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin: auto; /* Perfekte Zentrierung innerhalb von .flex-center */
}

.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.logo-img {
    height: 55px;
    width: auto;
    display: inline-block;
}

h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-dark);
    text-align: center;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: var(--brand-light);
    text-align: center;
    margin-bottom: 32px;
}

/* Formular-Elemente */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: var(--brand-dark);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #ffffff;
    color: var(--brand-dark);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-group input:focus {
    border-color: var(--brand-blue);
}

/* Fehler- und Feedback-Boxen */
.alert-box {
    background-color: #fde8e8;
    border: 1px solid #f8b4b4;
    color: var(--error-red);
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    background-color: var(--brand-blue);
    color: #ffffff;
    border: none;
    padding: 14px;
    font-weight: bold;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 0 #2b4cad;
    transition: all 0.1s ease;
}

.btn:hover {
    background-color: var(--brand-blue-hover);
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent;
}

/* Zurück zur Webseite-Link */
.back-link {
    display: block;
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--brand-light);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    color: var(--brand-blue);
}

/* ==========================================================================
   3. DASHBOARD-LAYOUT (SIDEBAR + MAIN COCKPIT)
   ========================================================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    width: 100%;
    max-width: 1800px; /* Perfekte Ausnutzung deines großen Bildschirms */
    margin: 0 auto;
    min-height: calc(100vh - 48px);
}

/* Links: Das Sideboard */
.sidebar {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-top h2 {
    text-align: left;
    font-size: 20px;
    margin-bottom: 4px;
}

.sidebar-section {
    margin-top: 32px;
}

.sidebar-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--brand-light);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Theme-Auswahl untereinander in der Sidebar */
.theme-selector-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-btn, .info-btn {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--brand-dark);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.theme-btn:hover, .info-btn:hover {
    background-color: var(--brand-blue);
    color: #ffffff;
    border-color: var(--brand-blue);
}

/* Rechts: Das Haupt-Cockpit */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Die unaufgeregte 5-Tage-Wochenübersicht */
.week-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Genau 5 Spalten (Mo - Fr) */
    gap: 16px;
    flex: 1;
}

.day-column {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px 16px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-header {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--brand-light);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

/* Einzelne Terminkarten im Wochenplan */
.appointment-card {
    background-color: var(--bg-color);
    border-left: 4px solid var(--brand-blue);
    padding: 12px;
    border-radius: 4px;
    font-size: 14.5px;
}

.appointment-time {
    font-weight: bold;
    color: var(--brand-blue);
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}

/* Responsive Verhalten */
@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Sidebar wandert mobil nach oben */
    }
    .week-container {
        grid-template-columns: 1fr; /* Spalten untereinander auf kleinen Bildschirmen */
    }
}
/* ==========================================================================
   4. AVATAR-PROFIL LAYOUTS
   ========================================================================= */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.avatar-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 2.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.avatar-circle:hover {
    transform: scale(1.05);
    border-color: var(--brand-blue);
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 22px;
    font-weight: bold;
    color: var(--brand-blue);
    text-transform: uppercase;
    user-select: none;
}
/* ==========================================================================
   5. AVATAR SELECTION MODAL
   ========================================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.avatar-modal {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.modal-overlay.is-active .avatar-modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--brand-light);
}

.modal-close-btn:hover {
    color: var(--error-red);
}

/* Raster für die Avatare im Modal */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.avatar-option {
    border: 2px solid var(--border-color);
    border-radius: 50%;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.avatar-option:hover {
    border-color: var(--brand-blue);
    transform: scale(1.05);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Der Abmelden-Button am Fuß der Sidebar */
.logout-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    color: var(--brand-dark);
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

/* Dezentes, reizarmes Signal-Rot beim Hovern im hellen Modus */
.logout-link:hover {
    background-color: #fee2e2; 
    color: #ef4444;
    border-color: #fca5a5;
}
/* ==========================================================================
   6. TERMIN-STATUS & ANIMATIONEN (HAKEN & HERZ)
   ========================================================================= */
.appointment-card {
    position: relative; /* Wichtig für die absolute Positionierung der Badges */
    overflow: hidden;
}

/* Erledigte Termine leicht ausgrauen für weniger visuelle Ablenkung */
.appointment-card.status-erledigt {
    opacity: 0.7;
    border-left-color: var(--brand-light) !important;
}

/* Allgemeine Status-Plakette oben rechts */
.status-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 16px;
    line-height: 1;
    user-select: none;
}

/* 1. DER GRÜNE HAKEN */
.checkmark-badge {
    color: #10b981; /* Sattes, reizarmes Smaragd-Grün */
    font-weight: bold;
    font-size: 18px;
}

/* 2. DAS PULSIERENDE HERZ */
.heart-badge {
    display: inline-block;
    transform-origin: center;
    animation: heartPulse 1.4s infinite ease-in-out;
}

/* Die unaufgeregte Puls-Animation */
@keyframes heartPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.25); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}
/* ==========================================================================
   7. STYLEGERECHTE DEAKTIVIERUNG (ZENTRALER BTN-INACTIVE STANDARD)
   ========================================================================= */
.theme-btn.btn-inactive {
    background-color: #2e374a !important;
    color: #64748b !important;
    border: 1px solid #334155 !important;
    opacity: 0.6;
    pointer-events: none; /* Verhindert Klicks im Browser vollständig */
    box-shadow: none !important;
}
/* Maximierte Breite für das geöffnete Elternmappen-Fenster */
#eltern-zone-modal-overlay .avatar-modal {
    max-width: 95vw !important;  /* Nutzt bis zu 95% der Bildschirmbreite */
    width: 92% !important;
    height: 90vh !important;     /* Nutzt bis zu 90% der Bildschirmhöhe */
    max-height: 95vh !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Sorgt dafür, dass der zukünftige Inhalt im Fenster scrollbar bleibt */
#eltern-zone-modal-overlay .avatar-modal > div:last-child {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}