/* ==========================================================
   GLOBAL VARIABLES (Dein Original)
========================================================== */
:root {
    --transition: all 0.3s ease;

    /* LIGHT THEME */
    --bg-light: linear-gradient(135deg, #eef2ff 0%, #f7faff 100%);
    --glass-light-bg: rgba(255, 255, 255, 0.35);
    --glass-light-border: rgba(255, 255, 255, 0.25);
    --glass-light-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --text-light: #1f1f1f;

    /* DARK THEME */
    --bg-dark: linear-gradient(135deg, #0d0d11 0%, #18181c 100%);
    --glass-dark-bg: rgba(25, 25, 25, 0.40);
    --glass-dark-border: rgba(255, 255, 255, 0.10);
    --glass-dark-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --text-dark: #e5e5e5;

    /* ICON COLORS */
    --ff-icon-light: #1f1f1f;
    --ff-icon-dark: #e5e5e5;

    /* LOGO COLORS */
    --ff-logo-light: #0d6efd;
    --ff-logo-dark: #82baff;
}

/* OS AUTO THEME */
@media (prefers-color-scheme: dark) {
    body:not([data-theme]) {
        background: var(--bg-dark);
        color: var(--text-dark);
    }
}

@media (prefers-color-scheme: light) {
    body:not([data-theme]) {
        background: var(--bg-light);
        color: var(--text-light);
    }
}

/* ==========================================================
   THEME: LIGHT MODE
========================================================== */
body[data-theme="glass-light"] {
    background: var(--bg-light);
    color: var(--text-light);
}

body[data-theme="glass-light"] .glass-card,
body[data-theme="glass-light"] .stat-card,
body[data-theme="glass-light"] .card-glass {
    backdrop-filter: blur(22px);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--glass-light-shadow);
    color: var(--text-light);
}

/* Logo Light */
body[data-theme="glass-light"] .logo-text,
body[data-theme="glass-light"] .navbar-brand .svg-inline--fa {
    color: var(--ff-logo-light) !important;
}

/* ==========================================================
   THEME: DARK MODE
========================================================== */
body[data-theme="glass-dark"] {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Glass Elements */
body[data-theme="glass-dark"] .glass-card,
body[data-theme="glass-dark"] .stat-card,
body[data-theme="glass-dark"] .card-glass {
    backdrop-filter: blur(25px);
    background: var(--glass-dark-bg);
    border: 1px solid var(--glass-dark-border);
    box-shadow: var(--glass-dark-shadow);
    color: var(--text-dark);
}

/* Logo Dark */
body[data-theme="glass-dark"] .logo-text,
body[data-theme="glass-dark"] .navbar-brand .svg-inline--fa {
    color: var(--ff-logo-dark) !important;
}

/* ==========================================================
   GENERAL GLASS
========================================================== */
.glass-card {
    border-radius: 22px;
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-4px);
}

/* DASHBOARD TITLE */
.dashboard-title {
    font-weight: 700;
    font-size: 1.9rem;
    margin: 30px 0 20px 20px;
}

/* ==========================================================
   STAT CARDS (Dein Original)
========================================================== */
.stat-card {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    padding: 25px;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

.stat-icon {
    position: absolute;
    right: 10px;
    top: 10px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 2;
}

/* DARK MODE FIX STATS */
body[data-theme="glass-dark"] .stat-card {
    background: rgba(25, 25, 25, 0.45);
    border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="glass-dark"] .stat-icon {
    background: rgba(40, 40, 40, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="glass-dark"] .stat-icon svg {
    filter: brightness(0.7);
}

body[data-theme="glass-dark"] .stat-card p,
body[data-theme="glass-dark"] .stat-card h3,
body[data-theme="glass-dark"] .stat-card a {
    color: #f0f0f0 !important;
}

/* ==========================================================
   LIST + STUDENT CARDS
========================================================== */
.card-glass {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.55);
    border-radius: 20px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    z-index: 1;
}

.status-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

/* Dark Fix List */
body[data-theme="glass-dark"] .list-group-item,
body[data-theme="glass-dark"] .list-group-item strong,
body[data-theme="glass-dark"] .list-group-item span {
    color: #f4f4f4 !important;
}

/* ==========================================================
   BUTTONS
========================================================== */
.btn-soft {
    border-radius: 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    transition: 0.2s;
}

.btn-soft:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* DARK MODE BUTTONS */
body[data-theme="glass-dark"] .btn-soft {
    background: rgba(40, 40, 40, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ddd !important;
}

body[data-theme="glass-dark"] .btn-soft svg {
    filter: brightness(0.75);
}

/* ==========================================================
   HEADER GLASS NAV (MODIFIZIERT FÜR DROPDOWN BLUR)
   Wir nutzen ::before, damit der Blur des Parents nicht
   den Blur des Dropdowns blockiert (Stacking Context).
   Optik ist aber 100% wie in deinem Code.
========================================================== */
.glass-nav {
    background: transparent !important;
    /* Wichtig: Hier Transparent */
    backdrop-filter: none !important;
    /* Wichtig: Hier kein Filter */
    border: none !important;
    padding: 8px 0 !important;
    position: relative;
    z-index: 2000 !important;
}

/* Der "Fake" Hintergrund für die Navbar */
.glass-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;

    /* DEIN ORIGINAL NAVBAR STYLE */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.35);
    /* Deine Farbe */
}

/* DARK MODE NAVBAR */
body[data-theme="glass-dark"] .glass-nav::before {
    background: rgba(25, 25, 25, 0.35);
    /* Deine Dark Farbe */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navbar Links & Buttons */
body[data-theme="glass-dark"] .glass-nav .nav-link {
    color: #f0f0f0 !important;
}

body[data-theme="glass-dark"] .btn-softglass {
    background: rgba(40, 40, 40, 0.55) !important;
    color: #f0f0f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="glass-dark"] .btn-softglass:hover {
    background: rgba(55, 55, 55, 0.65) !important;
}

/* ==========================================================
   DROPDOWN MENUS (DER FIX - ULTRA TRANSPARENT)
========================================================== */
.dropdown-menu,
.glass-dropdown,
.custom-glass-menu {
    /* Bootstrap Variablen killen */
    --bs-dropdown-bg: transparent !important;
    --bs-dropdown-link-active-bg: transparent !important;
    --bs-dropdown-border-width: 0 !important;

    background-image: none !important;
    background-color: transparent !important;
    margin-top: 10px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    z-index: 9999 !important;
    padding: 6px 0 !important;
}

/* Light Mode Dropdown - ULTRA TRANSPARENT (Wie zuletzt besprochen) */
body[data-theme="glass-light"] .dropdown-menu,
body[data-theme="glass-light"] .glass-dropdown,
body[data-theme="glass-light"] .custom-glass-menu {
    /* Verlauf von 8% Weiß zu 0% */
    background: rgba(255, 255, 255, 0.0) !important;

    backdrop-filter: blur(5px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(5px) saturate(180%) !important;

    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Dark Mode Dropdown */
body[data-theme="glass-dark"] .dropdown-menu,
body[data-theme="glass-dark"] .glass-dropdown,
body[data-theme="glass-dark"] .custom-glass-menu {
    background-color: rgba(30, 30, 35, 0.55) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5) !important;
}

/* Items Reset */
.dropdown-item {
    background: transparent !important;
    color: inherit !important;
    margin: 2px 5px;
    border-radius: 8px;
    width: auto !important;
    transition: 0.2s;
    font-weight: 500;
}

/* Hover Light */
body[data-theme="glass-light"] .dropdown-item {
    color: #1f1f1f !important;
}

body[data-theme="glass-light"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.4) !important;
    color: #000 !important;
}

/* Hover Dark */
body[data-theme="glass-dark"] .dropdown-item {
    color: #f1f1f1 !important;
}

body[data-theme="glass-dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

/* Icons */
.dropdown-item i,
.dropdown-item svg {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    opacity: 0.8;
}

body[data-theme="glass-dark"] .dropdown-menu .theme-switcher-label {
    color: #f1f1f1 !important;
}

body[data-theme="glass-dark"] .dropdown-menu .theme-switcher-label i {
    color: #ddd !important;
}

/* ==========================================================
   RESTLICHES DESIGN (Dein Original)
========================================================== */

/* Footer */
body[data-theme="glass-dark"] footer {
    background: rgba(25, 25, 25, 0.45) !important;
    color: #e5e5e5 !important;
}

body[data-theme="glass-light"] footer {
    background: rgba(255, 255, 255, 0.6) !important;
    color: #1f1f1f !important;
}

body[data-theme="glass-light"] footer .text-muted,
body[data-theme="glass-light"] footer a {
    color: #1f1f1f !important;
}

body[data-theme="glass-dark"] footer .text-muted,
body[data-theme="glass-dark"] footer a {
    color: #f5f5f5 !important;
}

/* Panel */
#examStatusPanel {
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.60);
    border-radius: 16px;
}

body[data-theme="glass-dark"] #examStatusPanel {
    background: rgba(25, 25, 25, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #f0f0f0;
}

/* Card Headers */
.card-glass .card-header,
.stat-card .card-header {
    background: rgba(255, 255, 255, 0);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 12px 16px;
}

.card-glass .card-header h5,
.stat-card .card-header h5 {
    color: #1f1f1f !important;
}

body[data-theme="glass-dark"] .card-glass .card-header,
body[data-theme="glass-dark"] .stat-card .card-header {
    background: rgba(30, 30, 30, 0);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

body[data-theme="glass-dark"] .card-glass .card-header h5,
body[data-theme="glass-dark"] .stat-card .card-header h5 {
    color: #f1f1f1 !important;
}

/* Buttons Add Exam */
.btn-add-exam {
    border-radius: 12px;
    font-weight: 600;
    transition: 0.25s;
}

body[data-theme="glass-light"] .btn-add-exam {
    background: rgba(13, 110, 253, 0.15);
    border: 1px solid rgba(13, 110, 253, 0.35);
    color: #0d6efd;
}

body[data-theme="glass-light"] .btn-add-exam:hover {
    background: rgba(13, 110, 253, 0.25);
}

body[data-theme="glass-dark"] .btn-add-exam {
    background: rgba(13, 110, 253, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #82baff;
}

body[data-theme="glass-dark"] .btn-add-exam:hover {
    background: rgba(13, 110, 253, 0.30);
}

/* Inputs */
.glass-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.glass-label {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}

.glass-input,
.glass-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    font-size: 0.9rem;
    transition: all 0.25s ease;
    color: #1f1f1f;
}

.glass-input:hover,
.glass-select:hover,
.glass-input:focus,
.glass-select:focus {
    border-color: rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.75);
    outline: none;
}

.glass-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF8,%3Csvg fill='%23666' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.516 7.548a.75.75 0 0 1 1.06-.032L10 10.698l3.424-3.182a.75.75 0 0 1 1.028 1.092l-3.93 3.65a.75.75 0 0 1-1.028 0l-3.93-3.65a.75.75 0 0 1-.032-1.06Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Dark Inputs */
body[data-theme="glass-dark"] .glass-label {
    color: #e5e5e5;
    opacity: 0.9;
}

body[data-theme="glass-dark"] .glass-input,
body[data-theme="glass-dark"] .glass-select {
    background: rgba(30, 30, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e5e5e5;
}

body[data-theme="glass-dark"] .glass-input:hover,
body[data-theme="glass-dark"] .glass-select:hover,
body[data-theme="glass-dark"] .glass-input:focus,
body[data-theme="glass-dark"] .glass-select:focus {
    background: rgba(40, 40, 40, 0.65);
    border-color: rgba(255, 255, 255, 0.2);
}

body[data-theme="glass-dark"] .glass-select {
    background-image: url("data:image/svg+xml;charset=UTF8,%3Csvg fill='%23ccc' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.516 7.548a.75.75 0 0 1 1.06-.032L10 10.698l3.424-3.182a.75.75 0 0 1 1.028 1.092l-3.93 3.65a.75.75 0 0 1-1.028 0l-3.93-3.65a.75.75 0 0 1-.032-1.06Z'/%3E%3C/svg%3E");
}

/* Reset Buttons */
.glass-reset-btn {
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    transition: 0.25s ease;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.glass-reset-btn:hover {
    background: rgba(255, 255, 255, 0.85);
}

.glass-apply-btn {
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    transition: 0.25s ease;
    background: #0d6efd;
    color: white;
}

.glass-apply-btn:hover {
    background: #0b5ed7;
}

body[data-theme="glass-dark"] .glass-reset-btn {
    background: rgba(40, 40, 40, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e5e5e5;
}

body[data-theme="glass-dark"] .glass-reset-btn:hover {
    background: rgba(55, 55, 55, 0.65);
}

body[data-theme="glass-dark"] .glass-apply-btn {
    background: #0d6efd;
}

body[data-theme="glass-dark"] .glass-apply-btn:hover {
    background: #0a58ca;
}

/* Filter Bar */
.filter-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: transparent;
    backdrop-filter: blur(10px);
}

.filter-bar .form-control,
.filter-bar .form-select {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body[data-theme="glass-dark"] .filter-bar .form-control,
body[data-theme="glass-dark"] .filter-bar .form-select {
    background: rgba(40, 40, 40, 0.55);
    color: #eee;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ==========================================================
   TABLES (FLOATING GLASS ROWS)
========================================================== */
.table {
    border-collapse: separate;
    border-spacing: 0 8px; /* Abstand zwischen den Zeilen */
}

/* Header Styling */
.table thead th {
    background: transparent !important;
    border: none !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    opacity: 0.7;
    padding-bottom: 10px;
}

/* Body Rows - Der Glas Effekt */
.table tbody tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Wichtig: Damit Border-Radius funktioniert */
    border-radius: 12px; 
}

/* Die Zellen müssen transparent sein, damit der Row-Background wirkt */
.table tbody td {
    border: none !important;
    vertical-align: middle;
    padding: 16px 12px;
    background: transparent !important;
}

/* Runde Ecken für die Zeilen erzwingen */
.table tbody tr td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    padding-left: 20px;
}
.table tbody tr td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    padding-right: 20px;
}

/* --- THEME: LIGHT MODE --- */
body[data-theme="glass-light"] .table thead th { color: #1f1f1f; }

body[data-theme="glass-light"] .table tbody tr {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(255,255,255,0.5);
}

body[data-theme="glass-light"] .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.75) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* --- THEME: DARK MODE --- */
body[data-theme="glass-dark"] .table thead th { color: #ccc; }

body[data-theme="glass-dark"] .table tbody tr {
    background: rgba(30, 30, 35, 0.5) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    color: #eee;
}

body[data-theme="glass-dark"] .table tbody tr:hover {
    background: rgba(40, 40, 45, 0.7) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* Sortier-Pfeil */
.sortable { cursor: pointer; }
.sortable::after {
    content: " \f0dc"; /* FontAwesome Sort Icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.7rem;
    opacity: 0.3;
    margin-left: 5px;
}

/* Small Box Colors */
.bg-info {
    background-color: #0dcaf0 !important;
}

.bg-success {
    background-color: #198754 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

/* Small Box Layout */
.small-box {
    position: relative;
    display: block;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .075);
    color: #fff;
    overflow: hidden;
    padding: 1rem;
    transition: transform 0.2s ease-in-out;
}

.small-box:hover {
    transform: translateY(-3px);
}

.small-box h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
}

.small-box p {
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
}

.small-box .icon {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    z-index: 0;
    font-size: 4rem;
    opacity: 0.25;
    pointer-events: none;
}

.small-box-footer {
    display: block;
    color: rgba(255, 255, 255, .9);
    text-align: center;
    padding: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, .2);
    margin-top: 0.5rem;
}

.small-box-footer:hover {
    color: #fff;
    background-color: rgba(0, 0, 0, .05);
}

body[data-theme="glass-dark"] .small-box {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}



/* ==========================================================
   GLASS UPLOAD ZONE
========================================================== */
.glass-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.glass-upload-zone:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.glass-upload-zone i {
    transition: transform 0.3s ease;
}

.glass-upload-zone:hover i {
    transform: translateY(-3px) scale(1.1);
    color: var(--ff-logo-light);
    opacity: 1 !important;
}

/* Dark Mode Anpassung */
body[data-theme="glass-dark"] .glass-upload-zone {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}
body[data-theme="glass-dark"] .glass-upload-zone:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}
body[data-theme="glass-dark"] .glass-upload-zone:hover i {
    color: var(--ff-logo-dark);
}



/* Footer Dark Mode */
body[data-theme="glass-dark"] .footer {
    background: rgba(10,10,10,0.65) !important;
    backdrop-filter: blur(12px) !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
}

body[data-theme="glass-dark"] .footer .text-muted,
body[data-theme="glass-dark"] .footer a {
    color: #d0d0d0 !important;
}