/* =========================================
   1. GRUNDLAGEN
   ========================================= */
:root {
    --primary: #2c3e50;
    --accent: #e67e22;
    --success: #27ae60;
    --danger: #c0392b;
    --light: #ecf0f1;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light);
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 { color: var(--primary); margin-top: 0; }
a { text-decoration: none; }

main {
    max-width: 1200px;
    margin: 20px auto; 
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    flex: 1; 
}

/* =========================================
   2. NAVIGATION (STICKY HAMBURGER)
   ========================================= */
.main-navbar {
    background-color: var(--primary);
    color: var(--white);
    padding: 0 20px;
    
    /* HIER IST DER SCHLÜSSEL: Sticky nimmt Platz ein! */
    position: sticky;
    top: 0;
    z-index: 9000;
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-height: 60px; /* Mindesthöhe */
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: auto;
}

.nav-brand a {
    color: var(--white);
    font-weight: 800;
    font-size: 1.4em;
    letter-spacing: 1px;
}

/* Burger Icon (Standardmäßig unsichtbar) */
.icon-burger {
    display: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 10px;
}

/* Der Wrapper für Links */
.nav-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-left: 20px;
}

.nav-links { display: flex; gap: 5px; }
.nav-user { display: flex; align-items: center; gap: 15px; }

.nav-links a, .nav-user a {
    color: #bdc3c7;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a.active, .nav-user a:hover {
    color: var(--white);
    background-color: rgba(255,255,255,0.1);
}

.logout-btn {
    background-color: var(--danger);
    color: white !important;
}

/* === DROPDOWN MENÜ === */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.dropbtn {
    background-color: var(--accent);
    color: white;
    padding: 6px 12px;
    font-size: 0.9em;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px; 
    background-color: var(--white);
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 10000;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* Brücke */
.dropdown-content::before {
    content: ""; display: block; position: absolute; top: -15px; left: 0; width: 100%; height: 15px;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    display: block;
    border-bottom: 1px solid #f5f5f5;
    text-align: left;
}
.dropdown-content a:hover { background-color: #fff8e1; color: var(--accent); padding-left: 20px; transition: 0.2s; }
.dropdown:hover .dropdown-content { display: block; }


/* =========================================
   3. MOBILE RESPONSIVE (< 900px)
   ========================================= */
@media (max-width: 900px) {
    
    .main-navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        height: auto; /* Höhe passt sich an */
    }

    .nav-header {
        width: 100%;
        padding: 10px 20px;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .icon-burger {
        display: block; /* Burger anzeigen */
    }

    /* Inhalt erst mal ausblenden */
    .nav-content-wrapper {
        display: none;
        flex-direction: column;
        width: 100%;
        margin: 0;
        background-color: #233140; /* Dunklerer Hintergrund für aufgeklapptes Menü */
        padding-bottom: 20px;
    }

    /* WENN MENU OFFEN (Klasse 'responsive' via JS) */
    .main-navbar.responsive .nav-content-wrapper {
        display: flex; /* Jetzt anzeigen! */
    }

    .nav-links, .nav-user {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-links a, .nav-user a {
        display: block;
        width: 100%;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        box-sizing: border-box;
    }

    /* Mobile Dropdowns */
    .dropdown {
        display: block;
        width: 100%;
        padding: 10px 20px;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .dropbtn { 
        width: 100%; 
        text-align: left; 
        padding: 10px;
        background-color: rgba(230, 126, 34, 0.2); /* Leicht transparentes Orange */
    }
    
    /* Mobil: Dropdown Inhalt */
    .dropdown-content {
        position: static; /* Fließt im Text */
        box-shadow: none;
        background-color: #f4f4f4;
        width: 100%;
        margin-top: 5px;
        display: none; /* Erstmal zu */
    }
    
    /* Mobil: Klick (Hover) öffnet Untermenü */
    .dropdown:hover .dropdown-content, .dropdown:active .dropdown-content {
        display: block;
    }
    
    .logout-btn {
        margin: 20px;
        text-align: center;
        width: auto;
        display: inline-block;
        align-self: center;
    }
    
    /* Sonstiges Mobile Zeug */
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-checkbox { margin-top: 10px; }
    .bulk-table th { top: 0; }
}

/* =========================================
   4. RESTLICHES DESIGN (Tabelle, Buttons etc.)
   ========================================= */
.mein-button {
    display: inline-block; padding: 10px 20px; background-color: var(--primary);
    color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 1rem; text-align: center;
}
.mein-button:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.2); }

input, select, textarea {
    padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 1rem; width: 100%; box-sizing: border-box; font-family: inherit;
}

.eingabe-box {
    background: var(--white); padding: 25px; border-radius: 8px; box-shadow: var(--shadow); margin-bottom: 30px; border: 1px solid #e0e0e0;
}

/* Massenbearbeitung Tabelle */
.page-control-bar {
    display: flex; justify-content: space-between; align-items: center; padding: 20px 0;
    background-color: transparent; position: relative; z-index: 1;
}
.bulk-table { 
    width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9em; background: white; 
    margin-top: 10px; box-shadow: var(--shadow); border-radius: 8px 8px 0 0;
}
.bulk-table th { 
    background: #333; color: white; padding: 15px 10px; text-align: left; border-bottom: 2px solid #555;
    position: sticky; top: 60px; z-index: 800; 
}
.bulk-table th:first-child { border-top-left-radius: 8px; }
.bulk-table th:last-child { border-top-right-radius: 8px; }
.bulk-table td { padding: 10px; border-bottom: 1px solid #ddd; background: white; vertical-align: top; }
.bulk-table tr:hover td { background-color: #f1f7ff; }
.sticky-footer {
    position: sticky; bottom: 0; background: var(--primary); padding: 15px 20px; text-align: right;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2); z-index: 900; border-top: 4px solid var(--accent);
}

/* Filter & Karten */
.filter-bar { background: var(--white); padding: 15px; border-radius: 8px; box-shadow: var(--shadow); margin-bottom: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-btn { text-decoration: none; color: #555; padding: 8px 16px; border: 1px solid #ddd; border-radius: 20px; background: #f9f9f9; }
.filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.filter-checkbox { margin-left: auto; }

.modul-grid, .folder-grid { display: grid; gap: 20px; }
.modul-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.folder-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.modul-card, .folder-card { background: var(--white); padding: 20px; border-radius: 8px; box-shadow: var(--shadow); text-decoration: none; color: #333; border: 1px solid #eee; transition: transform 0.2s; }
.modul-card:hover, .folder-card:hover { transform: translateY(-3px); }
.kalender-border { border-top: 5px solid var(--accent); }
.doku-border { border-top: 5px solid var(--success); }

/* Notizen */
.notes-masonry { column-count: 2; column-gap: 20px; }
.note-card { background: white; padding: 15px; margin-bottom: 20px; break-inside: avoid; border-radius: 8px; box-shadow: var(--shadow); }
.note-img { width: 100%; display: block; border-radius: 4px; }

/* Kalender Spezial */
.scroll-wrapper { background: white; padding: 10px; border-radius: 8px; box-shadow: var(--shadow); overflow-x: auto; max-height: 80vh; }
.termin-badge { background-color: #eef2f5; border-left: 4px solid var(--accent); color: #333; box-shadow: 1px 1px 3px rgba(0,0,0,0.1); }
.gesperrt { background: repeating-linear-gradient(45deg, #f1f1f1, #f1f1f1 10px, #e0e0e0 10px, #e0e0e0 20px); }
.heute { background-color: #fff8e1 !important; border: 2px solid var(--accent) !important; }

/* Footer */
.main-footer { background-color: var(--primary); color: #bdc3c7; padding-top: 40px; margin-top: 60px; }
.footer-content { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.footer-bottom { text-align: center; padding: 20px; margin-top: 40px; border-top: 1px solid #34495e; background-color: #233140; }
.footer-section a { color: #bdc3c7; }
.footer-section a:hover { color: var(--accent); }

/* === FIXIERTE BOTTOM BAR (Werkzeugleiste) === */

/* Platzhalter,damit man bis ganz nach unten scrollen kann */
body {
    padding-bottom: 160px; /* Genug Platz für die Leiste */
}

.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #2c3e50; /* Dunkelblau */
    color: white;
    padding: 15px 20px;
    z-index: 9500; /* Über allem */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
    border-top: 4px solid #e67e22; /* Orange Akzent */
    
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Der Bereich für "Neues anlegen" */
.quick-add-area {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.1); /* Leicht transparent */
    padding: 8px;
    border-radius: 5px;
}

.quick-add-area input, .quick-add-area select {
    border: none;
    height: 36px;
    font-size: 0.9em;
}

.quick-add-area strong {
    font-size: 0.9em;
    text-transform: uppercase;
    color: #ccc;
    margin-right: 5px;
}

/* Der große Speicher-Button */
.big-save-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 0 #1e8449; /* 3D Effekt */
    transition: transform 0.1s;
}
.big-save-btn:hover { background-color: #2ecc71; transform: translateY(-2px); }
.big-save-btn:active { transform: translateY(2px); box-shadow: none; }

/* Mobile Anpassung für die Toolbar */
@media (max-width: 900px) {
    .bottom-toolbar { flex-direction: column; align-items: stretch; }
    .quick-add-area { flex-direction: column; }
    .quick-add-area input, .quick-add-area select, .quick-add-area button { width: 100%; }
    .big-save-btn { width: 100%; margin-top: 10px; }
    body { padding-bottom: 250px; } /* Mehr Platz auf Handy nötig */
}
/* === BARRIEREFREIHEIT & STATUS === */
.access-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px; /* Pillen-Form */
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 10px;
    border: 2px solid transparent; /* Für High-Contrast Modus */
}

/* Status: OFFEN (Gelb/Orange Hintergrund, dunkler Text für Lesbarkeit) */
.acc-offen {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

/* Status: VERSENDET (Hellgrün Hintergrund, sehr dunkler Text) */
.acc-versendet {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* Status: KEINE ZUWEISUNG (Grau) */
.acc-notiz {
    background-color: #f8f9fa;
    color: #666;
    border-color: #ddd;
}