/* =========================================================================
   1. GLOBALE STYLES & FARBEN (Wissenssprung-Identität)
   ========================================================================= */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9; /* Sehr helles, freundliches Graublau */
    color: #2c3e50;            /* Dunkles Anthrazit für perfekte Lesbarkeit */
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

h2, h3 {
    color: #3a5480; /* Das originale Wissenssprung-Blau */
    margin-top: 0;
}

/* =========================================================================
   2. ANMELDE-MASKE (Startseite / index.php)
   ========================================================================= */
.login-container {
    max-width: 550px;
    margin: 60px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 90, 156, 0.1);
    text-align: center;
    border-top: 5px solid #3a5480;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #4a5568;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: #005a9c;
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.15);
    outline: none;
}

.btn-next {
    background-color: #3a5480;
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}

.btn-next:hover {
    background-color: #2a3d5e;
}

/* =========================================================================
   3. HAUPTMENÜ & FILTER - BEIDE FIXED (auswahl.php)
   ========================================================================= */
/* Das obere Hauptmenü (Höhe: ca. 60px) */
.sticky-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #3a5480;
    color: white;
    padding: 0 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1010; /* Höher als die Filterleiste */
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* NEU: Die Filterleiste bleibt beim Scrollen ebenfalls oben stehen! */
.filter-section {
    position: fixed;
    top: 60px; /* Dockt exakt unter der 60px hohen Navbar an */
    left: 0;
    width: 100%;
    background: #f8fafc;
    padding: 15px 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    box-sizing: border-box;
    border-bottom: 1px solid #e2e8f0;
}

/* Container für den eigentlichen Inhalt (Tabelle) */
.content-container {
    max-width: 1050px;
    /* Großer Abstand nach oben, damit die Tabelle nicht unter den fixierten Leisten verschwindet */
    margin: 210px auto 50px auto; 
    background: #ffffff;
    padding: 35px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.counter-box {
    font-weight: bold;
    font-size: 16px;
    padding: 8px 18px;
    border-radius: 20px;
}

.status-ok { background-color: #2ecc71; color: white; }
.status-error { background-color: #e74c3c; color: white; }

/* --- NEU: STYLES FÜR DIE OFFICE-LOGOS --- */
.topic-icon {
    width: 20px;          /* Perfekte Icon-Größe für Textzeilen */
    height: 20px;
    vertical-align: middle; /* Richtet das Bild mittig zur Textlinie aus */
    margin-right: 8px;    /* Etwas Abstand zum nachfolgenden Text */
    object-fit: contain;  /* Verhindert, dass das Bild verzerrt wird */
}

/* Speziell für die Filter-Buttons, falls wir dort auch Icons wollen */
.filter-btn .topic-icon {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

/* =========================================================================
   4. FILTER-BUTTONS & TABELLEN
   ========================================================================= */
.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 6px 14px;
    background-color: #ffffff;
    color: #4a5568;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background-color: #3a5480;
    color: white;
    border-color: #3a5480;
}

.module-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.module-table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 14px;
    border-bottom: 2px solid #cbd5e1;
}

.module-table td {
    padding: 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 15px;
}

.module-row:hover {
    background-color: #f8fafc;
}

.module-row.hidden {
    display: none;
}

.btn-submit-selection {
    background-color: #2ecc71;
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit-selection:hover:not(:disabled) {
    background-color: #27ae60;
}

.btn-submit-selection:disabled {
    background-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

input[type="checkbox"].module-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* =========================================================================
   STABILES LAYOUT: SUCHFELD RECHTS OBEN
   ========================================================================= */
.search-wrapper-outer {
    float: right !important;
    margin-top: 10px !important;
    margin-right: 20px !important;
    position: relative !important;
    display: inline-block !important;
    z-index: 2000 !important; /* Stellt sicher, dass es ganz oben liegt */
}

.search-wrapper-inner {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 360px !important;  
    height: 44px !important;  
    box-sizing: border-box !important;
}

#module-search {
    width: 100% !important;
    height: 100% !important;
    padding: 0 40px 0 15px !important; 
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
    background-color: #ffffff !important;
}

#clear-search {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important; 
    cursor: pointer !important;
    color: #94a3b8 !important;
    font-size: 22px !important;
    user-select: none !important;
    font-weight: bold !important;
    line-height: 1 !important;
    z-index: 2010 !important;
}

#clear-search:hover {
    color: #475569 !important;
}

/* =========================================================================
   5. LIGHTBOX & BADGES
   ========================================================================= */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.lightbox-content {
    background-color: white;
    padding: 35px;
    border-radius: 12px;
    max-width: 550px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.lightbox-actions {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
}

.btn-cancel {
    background-color: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-cancel:hover { background-color: #cbd5e1; }

.btn-confirm {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn-confirm:hover { 
    background-color: #27ae60; 
}

.content-container {
    max-width: 1300px !important;
    width: 100% !important;
    margin: 90px auto 40px auto !important; 
    
    /* GEÄNDERT: 30px Abstand von der Überschrift zum oberen weißen Box-Rand */
    padding: 30px 20px 20px 20px !important; 
    
    box-sizing: border-box !important;
    clear: both !important;       
    position: relative !important;
    z-index: 1 !important;
}

/* STABILES TABELLEN-LAYOUT (VERHINDERT SEITLICHES VERSCHIEBEN) */
.module-table {
    table-layout: fixed !important;
    width: 100% !important;
}

.module-table td {
    vertical-align: top !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* ANIMATIONS-WRAPPER FÜR DIE BESCHREIBUNG (CSS-GRID TRICK) */
.description-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.35s ease-out, opacity 0.3s ease-out;
    overflow: hidden;
    width: 860px;
}

.description-wrapper.open {
    grid-template-rows: 1fr;
    opacity: 1;
    width: 860px;
}

.description-inner {
    min-height: 0; 
}

/* Pfeil-Animation */
.toggle-icon {
    margin-left: auto; 
    color: #94a3b8; 
    font-size: 11px;
    transition: transform 0.3s ease;
    display: inline-block;
}

/* BADGES & STYLES */
.badge-level {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    min-width: 100px;
}
.badge-einsteiger {
    background-color: #dcfce7;
    color: #166534;
}
.badge-fortgeschrittene {
    background-color: #fef9c3;
    color: #854d0e;
}
.badge-experten {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Formstabile Absicherung für das lila Kasten-Badge */
.badge-empfohlen {
    background-color: #f3e8ff;
    color: #6b21a8;            
    padding: 3px 8px;          
    border-radius: 4px;
    font-size: 13px;           
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;       
    flex-shrink: 0;            
    height: max-content;       
}

.filter-btn-recommendation:hover,
.filter-btn-recommendation.active {
    background-color: #7e22ce !important;
    color: #ffffff !important;
    border-color: #7e22ce !important;
}

.filter-btn-selected:hover,
.filter-btn-selected.active {
    background-color: #2ecc71 !important;
    color: #ffffff !important;
    border-color: #2ecc71 !important;
}

/* Checkbox rigoros verstecken */
.details-toggle-input {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
}

/* Haupt-Container */
.custom-details-wrapper {
    margin-bottom: 20px !important;
    text-align: left !important;
    background: #eef4f8 !important;
    border-radius: 4px !important;
    overflow: hidden !important; /* Das MUSS alles abschneiden */
}

/* Klickbare Zeile */
.custom-details-header {
    cursor: pointer !important;
    font-weight: bold !important;
    color: #3a5480 !important;
    padding: 10px !important;
    user-select: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Pfeil-Animation */
.custom-details-arrow {
    display: inline-block !important;
    font-size: 11px !important;
    transition: transform 0.3s ease !important;
}

/* Pfeil drehen */
.details-toggle-input:checked + .custom-details-header .custom-details-arrow {
    transform: rotate(90deg) !important;
}

/* Alternativer Klapp-Mechanismus via max-height */
.custom-details-content {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.3s ease-in-out !important;
}

/* Wenn offen, klappe bis maximal 200px auf (reicht locker für den Text) */
.details-toggle-input:checked ~ .custom-details-content {
    max-height: 200px !important;
}

/* Innerer Text-Container (wird komplett auf 0 gesetzt im geschlossenen Zustand) */
.custom-details-inner {
    font-size: 14px !important;
    padding: 5px 10px 10px 10px !important;
    margin: 0 !important; /* Setzt alle fremden Abstände zurück */
}

/* Falls dein CMS ungefragt Absätze einbaut, bändigen wir sie hier */
.custom-details-inner p, 
.custom-details-inner br {
    margin: 0 !important;
    padding: 0 !important;
}

/* Stellt sicher, dass das Overlay alles abdeckt und über allem liegt */
.lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.6) !important;
    z-index: 99999 !important;
}

/* Design für den Hilfe-Button */
.btn-help-trigger {
    background-color: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-help-trigger:hover {
    background-color: #cbd5e1;
}

/* =========================================================================
   6. ADMINISTRATIONSBEREICH (admin_dashboard.php)
   ========================================================================= */
.admin-header {
    background-color: #3a5480;
    color: white;
    padding: 25px 35px;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px 8px 8px 8px;
    border: 1px solid #e2e8f0;
    overflow: visible;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.badge-info {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.id-tag {
    font-family: 'Courier New', Courier, monospace;
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-weight: bold;
    font-size: 13px;
}

.filter-dropdown { 
    position: static; 
    display: inline-block; 
    cursor: pointer; 
    margin-left: 5px; 
    font-weight: normal; 
    color: #64748b; 
}

.dropdown-content { 
    display: none; 
    position: absolute; 
    background-color: #ffffff; 
    min-width: 200px; 
    box-shadow: 0px 8px 16px rgba(0,0,0,0.1); 
    z-index: 999 !important; 
    border-radius: 6px; 
    padding: 10px; 
    border: 1px solid #e2e8f0; 
    color: #333; 
}

.dropdown-content div { 
    padding: 8px; 
    cursor: pointer; 
    border-bottom: 1px solid #f1f5f9; 
    font-size: 13px; 
}

.dropdown-content div:hover { 
    background: #f1f5f9; 
}

.termin-manager { 
    background: white; 
    padding: 25px; 
    border-radius: 8px; 
    margin-bottom: 25px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
}

.termin-flex { 
    display: flex; 
    gap: 20px; 
    flex-wrap: wrap; 
}

.termin-form { 
    flex: 1; 
    min-width: 300px; 
}

.termin-liste { 
    flex: 1; 
    min-width: 300px; 
    border-left: 1px solid #e2e8f0; 
    padding-left: 20px; 
}

.termin-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #f8fafc; 
    padding: 8px 12px; 
    border-radius: 6px; 
    margin-bottom: 8px; 
    font-size: 14px; 
}

.btn-delete-termin { 
    text-decoration: none; 
    padding: 10px 20px; 
    cursor: pointer; 
    font-size: 12px;
    font-weight: 600;
    background-color: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 6px;
}

.admin-table { 
    table-layout: fixed; 
    width: 100%; 
}

.admin-table th, .admin-table td { 
    overflow: visible; 
    padding: 10px; 
}