/* ==========================================================================
   DESIGN TOKENS & SYSTEM VARIABLES (LIGHT TECH THEME)
   ========================================================================== */
:root {
    /* Color Palette - Bright & Professional */
    --bg-dark: #f8fafc;            /* Haupt-Hintergrund (leichtes Off-White) */
    --bg-surface: #ffffff;         /* Karten & Sidebars (Schneeweiß) */
    --bg-surface-hover: #f1f5f9;   /* Subtle Hover State */
    
    --primary: #2563eb;            /* Tech-Blau */
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.2);
    
    --accent: #0891b2;             /* Cyan / Wissenschaftlicher Akzent */
    --accent-glow: rgba(8, 145, 178, 0.2);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;

    --text-main: #0f172a;          /* Tiefer Dunkelblau-Ton für perfekten Kontrast */
    --text-muted: #64748b;         /* Dezent für Beschreibungen */
    --border-color: #e2e8f0;       /* Feine, helle Ränder */

    /* Metrics & Transitions */
    --sidebar-width-collapsed: 72px;
    --sidebar-width-expanded: 280px;
    --transition-speed: 0.25s;
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   LEFT SIDEBAR (COLLAPSIBLE & STICKY)
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width-collapsed);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 12px;
    transition: width var(--transition-speed) var(--transition-smooth);
    overflow: hidden;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.03);
}

/* Hover-Expansion */
.sidebar:hover {
    width: var(--sidebar-width-expanded);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.08);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 20px 4px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
    color: var(--text-main);
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.sidebar:hover .brand-text {
    opacity: 1;
}

/* Nav Menu Items */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    flex-grow: 1;
}

.nav-item {
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 10px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
    transform: translateX(2px);
}

.nav-link.active {
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.icon-wrapper {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.nav-link:hover .nav-icon {
    transform: scale(1.15);
}

.nav-content {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.sidebar:hover .nav-content {
    opacity: 1;
}

.nav-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* Kompakter Audio Player */
.nav-audio {
    height: 26px;
    width: 180px;
    margin-top: 4px;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.logout-link:hover {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

/* ==========================================================================
   TOP RIGHT PROFIL WIDGET (EXPANDABLE ON HOVER)
   ========================================================================== */
.top-profile-widget {
    position: fixed;
    top: 16px;
    right: 24px;
    z-index: 900;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 6px;
    width: 210px; /* Feste Grundbreite */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    
    /* Animationen für flüssiges Ausklappen vorbereiten */
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    max-height: 50px; /* Ruhezustand: Zeigt nur die Header-Zeile */
}

.top-profile-widget:hover {
    max-height: 340px; /* Erweitert den Container für den Dropdown-Inhalt */
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-radius: 16px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background-color: var(--bg-dark);
    border: 2px solid var(--primary);
}

.profile-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.profile-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text-main);
}

.profile-role {
    font-size: 0.7rem;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* Dropdown-Inhalt & Effekte */
.profile-dropdown-content {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s;
}

.top-profile-widget:hover .profile-dropdown-content {
    opacity: 1;
    transform: translateY(0);
}

.profile-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 10px 4px 12px 4px;
}

/* Stats-Raster */
.profile-stats {
    display: flex;
    justify-content: space-between;
    padding: 0 6px 10px 6px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

/* Level XP-Balken */
.xp-progress-bar {
    height: 6px;
    background-color: var(--bg-surface-hover);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 6px 4px 6px;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
}

.xp-text {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 12px;
}

/* Buttons im Dropdown */
.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: transparent;
}

.profile-action-btn:hover {
    background-color: var(--bg-surface-hover);
    transform: translateX(3px);
}

.profile-action-btn.action-logout:hover {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-wrapper {
    margin-left: var(--sidebar-width-collapsed);
    padding: 40px 48px;
    width: calc(100% - var(--sidebar-width-collapsed));
    max-width: 1400px;
    transition: margin-left var(--transition-speed) var(--transition-smooth);
}

.content-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.content-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-main);
}

.subtitle {
    color: var(--text-muted);
    margin-top: 4px;
}

.ui-section {
    margin-bottom: 48px;
}

.ui-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   BUTTONS & MICRO-INTERACTIONS
   ========================================================================== */
.component-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: #cbd5e1;
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent);
    color: #ffffff;
}
.btn-accent:hover {
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(37, 99, 235, 0.04);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover {
    background-color: var(--danger-hover);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* ==========================================================================
   CARDS & TILES
   ========================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.ui-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.ui-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
}

.badge-unity {
    background-color: rgba(8, 145, 178, 0.1);
    color: var(--accent);
}

.ui-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    padding-right: 60px;
    color: var(--text-main);
}

.ui-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tech-tag {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}

/* ==========================================================================
   HILFE POPUP (MODAL)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.tech-note {
    margin-top: 16px;
    background-color: var(--bg-dark);
    border-left: 3px solid var(--accent);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-main);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   FORM ELEMENTS (INPUTS & DROPDOWNS)
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.input-wrapper, .select-wrapper {
    position: relative;
    width: 100%;
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Hover- & Focus-Interaktionen */
.form-control:hover, .form-select:hover {
    border-color: #cbd5e1;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: #ffffff;
}

.input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.6;
}

.select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.8rem;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 36px;
}

/* ==========================================================================
   FLIESSTEXT, UNTERSTREICHUNGEN & HIGHLIGHTS
   ========================================================================== */
.text-demo-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    line-height: 1.65;
}

.demo-paragraph {
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Starker Akzent-Schatten für fette Textabschnitte */
.text-highlight {
    color: var(--primary);
    font-weight: 700;
}

/* Technische, farbige Unterstreichung */
.text-underline {
    text-decoration: none;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 1px;
    font-weight: 500;
}

/* Gelber/Amber Marker für Aufmerksamkeit */
.text-mark {
    background-color: rgba(245, 158, 11, 0.15);
    color: #b45309;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Code Snippet Inline */
.code-inline {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Badge Tag */
.badge-tag {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
}

/* ==============================================================================
   HUB / LERN-ZENTRALE STYLES
   ============================================================================== */

.hub-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    margin-top: 0;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    color: #1e293b;
    font-size: 1.25rem;
}

.grid-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.card-btn {
    background: white;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.card-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.flex-col-between {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Badges */
.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}
.badge-completed { background: #dcfce7; color: #15803d; }
.badge-in_progress { background: #fef9c3; color: #a16207; }
.badge-new { background: #dbeafe; color: #1d4ed8; }

/* Card Content */
.card-icon-wrapper {
    text-align: center;
    margin-top: 10px;
}
.card-icon-img { height: 60px; object-fit: contain; }
.card-icon-img-sm { height: 55px; object-fit: contain; }
.card-icon-fallback { font-size: 2.5rem; }

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 15px 0 8px 0;
    color: #0f172a;
}

.card-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 15px;
}

.card-reward {
    font-size: 0.85rem;
    font-weight: bold;
    color: #8b5cf6;
}

.card-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buttons */
.btn-primary-full {
    display: block;
    text-align: center;
    background: #2563eb;
    color: white;
    padding: 8px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}
.btn-primary-full:hover { background: #1d4ed8; }

.btn-wish {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 6px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-warning-full {
    width: 100%;
    background: #f59e0b;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-dark-full {
    display: block;
    background: #0f172a;
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85rem;
    text-align: center;
}

/* Sidebar & Profile Card */
.hub-sidebar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    text-align: center;
    height: fit-content;
}

.profile-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.profile-card-hover {
    cursor: pointer;
    transition: transform 0.2s ease;
}
.profile-card-hover:hover { transform: scale(1.02); }

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3b82f6;
}

.profile-avatar-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 3px solid #3b82f6;
}

.profile-username { margin: 10px 0 5px 0; color: #0f172a; }
.profile-motto { margin: 0; color: #64748b; font-size: 0.9rem; }
.divider { margin: 15px 0; border: none; border-top: 1px solid #e2e8f0; }
.profile-xp { font-size: 1.2rem; font-weight: bold; color: #3b82f6; }
.profile-rank { margin-top: 5px; font-weight: bold; color: #059669; }
.profile-edit-hint { margin-top: 15px; font-size: 0.8rem; color: #3b82f6; font-weight: bold; }

.teacher-preview-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    padding: 15px;
    border-radius: 10px;
    color: #92400e;
}
.teacher-preview-box h3 { margin-top: 0; }
.teacher-preview-box p { font-size: 0.85rem; margin-bottom: 15px; }

/* Modals & Forms */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center; justify-content: center;
}

.modal-card {
    background: white;
    width: 90%; max-width: 480px;
    padding: 25px; border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.modal-header h3 { margin: 0; color: #0f172a; }
.modal-close { cursor: pointer; font-size: 1.5rem; }

.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 6px;
    color: #334155;
}

.form-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.text-muted { color: #64748b; }

/* ==============================================================================
   GAMES HUB STYLES
   ============================================================================== */

.games-hub-container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.page-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 4px 0 0 0;
}

.btn-primary-action {
    background: #2563eb;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background 0.2s ease, transform 0.1s ease;
    display: inline-block;
}
.btn-primary-action:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.genre-section {
    margin-bottom: 40px;
}

.genre-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Game Card Styles */
.game-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.game-thumbnail-wrapper {
    height: 160px;
    width: 100%;
    background: #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.game-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-thumbnail-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.game-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.game-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0 0 12px 0;
    flex-grow: 1;
}

.text-muted-italic {
    color: #94a3b8;
    font-style: italic;
}

.game-card-author {
    font-size: 0.75rem;
    color: #64748b;
}

.game-card-footer {
    padding: 12px 16px 16px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-badge {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-play {
    background: #2563eb;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-play:hover {
    background: #1d4ed8;
}

/* Empty State */
.empty-state-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 50px 20px;
    text-align: center;
    margin-top: 20px;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.empty-state-card h3 {
    margin: 0 0 8px 0;
    color: #1e293b;
}

.empty-state-card p {
    color: #64748b;
    margin: 0 0 20px 0;
}

.inline-btn {
    display: inline-block;
}


/* ==============================================================================
   COURSE DETAIL & LESSONS STYLES (Tech-Light + Kid Success Feedback)
   ============================================================================== */

.course-detail-container {
    max-width: 1000px;
    margin: 0 auto;
}

.course-header-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.course-title {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    color: #0f172a;
}

.course-desc {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.5;
}

.course-success-banner-sm {
    margin-top: 15px;
    background: #dcfce7;
    border: 1px solid #86efac;
    padding: 12px 16px;
    border-radius: 8px;
    color: #166534;
}

/* Big Hero Banner */
.course-completed-hero-banner {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.hero-trophy {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 8px;
}

.hero-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: white;
}

.hero-badge-text {
    margin: 8px 0 0 0;
    font-size: 1.1rem;
    opacity: 0.95;
}

.hero-xp-chip {
    display: inline-block;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1rem;
}

/* Lessons Cards */
.lessons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lesson-card {
    background: white;
    border-radius: 12px;
    padding: 22px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
    transition: border-color 0.2s ease;
}

.lesson-completed-card {
    border-color: #86efac;
    background: #f0fdf4;
}

.lesson-card.locked {
    opacity: 0.65;
    background: #f8fafc;
    border-color: #cbd5e1;
}

.lesson-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.lesson-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-lesson-perfect {
    background: #22c55e;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* Modules Inside Lessons */
.module-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.module-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: 10px;
    background: white;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

/* IN YOUR FACE SUCCESS STYLING FOR MODULES */
.module-item.module-completed {
    background: #ffffff;
    border: 2px solid #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.module-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #1e293b;
}

.module-type-icon {
    font-size: 1.2rem;
}

.in-your-face-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #22c55e;
    color: white;
    font-weight: 900;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 8px;
    margin-left: 10px;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Module Buttons */
.btn-module {
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-module-start {
    background: #2563eb;
    color: white;
}
.btn-module-start:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-module-completed {
    background: #f0fdf4;
    color: #15803d;
    border: 1.5px solid #86efac;
}
.btn-module-completed:hover {
    background: #dcfce7;
}

.locked-lesson-msg {
    color: #64748b;
    font-style: italic;
    font-size: 0.9rem;
    padding: 10px 0;
}

/* ==============================================================================
   PLAY PACKAGE / WISSENSPAKET STYLES
   ============================================================================== */

.package-layout-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 25px;
    max-width: 1300px;
    margin: 0 auto;
}

.package-card-main {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.package-type-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: 0.5px;
}

.package-main-title {
    margin: 4px 0 20px 0;
    font-size: 1.75rem;
    color: #0f172a;
}

/* Progress Bar */
.progress-section {
    margin-bottom: 30px;
}

.progress-text-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 6px;
}

.progress-bar-bg {
    background: #e2e8f0;
    border-radius: 10px;
    height: 12px;
    width: 100%;
    overflow: hidden;
}

.progress-bar-fill {
    background: #2563eb;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Content Area */
.page-subtitle {
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 15px;
}

.content-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 25px;
    white-space: pre-line;
}

/* Media Elements */
.media-box {
    margin: 25px 0;
    text-align: center;
}

.media-img {
    max-width: 100%;
    max-height: 420px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.media-video {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.media-audio-box {
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.media-audio-label {
    text-align: left;
    font-size: 0.85rem;
    font-weight: bold;
    color: #475569;
    margin: 0 0 8px 0;
}

.media-audio {
    width: 100%;
}

/* Code Snippet Box */
.code-block-wrapper {
    margin: 25px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #334155;
}

.code-block-header {
    background: #0f172a;
    color: #94a3b8;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.code-block {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 18px;
    margin: 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.95rem;
    overflow-x: auto;
    border-left: 4px solid #3b82f6;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 35px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
}

.btn-nav {
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-nav-back {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.btn-nav-back:hover { background: #e2e8f0; }

.btn-nav-next {
    background: #2563eb;
    color: white;
}
.btn-nav-next:hover { background: #1d4ed8; }

.btn-nav-disabled {
    background: #f1f5f9;
    color: #cbd5e1;
    border: 1px solid #e2e8f0;
    pointer-events: none;
}

/* IN YOUR FACE FINISH BUTTON */
.btn-finish-in-your-face {
    background: #22c55e;
    color: white;
    font-size: 1rem;
    padding: 12px 26px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    animation: pulseGlow 2s infinite;
}
.btn-finish-in-your-face:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Sidebar Mini Profile */
.package-sidebar {
    height: fit-content;
}

.mini-profile-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.mini-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3b82f6;
}

.mini-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 3px solid #3b82f6;
}

.mini-username {
    margin: 10px 0 5px 0;
    color: #0f172a;
}

.mini-xp-badge {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.package-single-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ==============================================================================
   TEACHER DASHBOARD STYLES
   ============================================================================== */

.teacher-dashboard-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.teacher-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.teacher-welcome-title {
    margin: 0 0 6px 0;
    color: #1e293b;
    font-size: 1.6rem;
}

.teacher-welcome-sub {
    color: #64748b;
    margin: 0;
}

.teacher-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.teacher-card-title {
    margin: 0;
    color: #0f172a;
    font-size: 1.2rem;
}

.mb-15 { margin-bottom: 15px; }

/* Action Buttons */
.action-buttons-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-teacher-create {
    background: #16a34a;
    color: white;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
}
.btn-teacher-create:hover { background: #15803d; transform: translateY(-1px); }

.btn-teacher-edit {
    background: #f59e0b;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.8rem;
    display: inline-block;
}
.btn-teacher-edit:hover { background: #d97706; }

.btn-teacher-blue {
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
}
.btn-teacher-blue:hover { background: #1d4ed8; }

.btn-teacher-dark {
    background: #0f172a;
    color: white;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
}
.btn-teacher-dark:hover { background: #1e293b; }

/* Classes List */
.class-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.class-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 10px;
}

.class-info h4 {
    margin: 0 0 5px 0;
    color: #0f172a;
    font-size: 1.05rem;
}

.class-meta {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Wishes Section */
.wishes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.wish-item {
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wish-unread {
    background: #fefce8;
    border-left: 4px solid #f59e0b;
}

.wish-read {
    background: #f8fafc;
    border-left: 4px solid #cbd5e1;
}

.wish-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 4px;
}

.wish-badge-new {
    background: #f59e0b;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.wish-text {
    margin: 0;
    color: #1e293b;
    font-size: 0.95rem;
}

.wish-actions {
    display: flex;
    gap: 8px;
}

.btn-wish-read {
    background: #e0f2fe;
    color: #0284c7;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: bold;
}

.btn-wish-delete {
    background: #fef2f2;
    color: #dc2626;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
}

/* Dropdown Wrapper */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu-box {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background-color: #ffffff;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.15);
    border-radius: 6px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid #e2e8f0;
}

.dropdown-item-link {
    color: #334155;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}
.dropdown-item-link:hover { background-color: #f1f5f9; }

.dropdown-wrapper:hover .dropdown-menu-box { display: block; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.stat-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2563eb;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 5px;
}

/* Sidebar Teacher */
.teacher-sidebar {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    height: fit-content;
}

.badge-teacher-role {
    background: #fef3c7;
    color: #d97706;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 10px;
}

.teacher-sidebar-username { margin: 10px 0 5px 0; color: #0f172a; }
.teacher-sidebar-email { color: #64748b; font-size: 0.85rem; margin: 0; }
.teacher-divider { margin: 15px 0; border: none; border-top: 1px solid #e2e8f0; }
.teacher-login-info { font-size: 0.85rem; color: #64748b; margin-bottom: 20px; }

.btn-teacher-logout {
    width: 100%;
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fca5a5;
    padding: 8px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}
.btn-teacher-logout:hover { background: #fee2e2; }

.text-italic-muted { color: #94a3b8; font-style: italic; margin: 0; }

/* ==============================================================================
   LOGIN PAGE & LOGO BRANDING STYLES
   ============================================================================== */

.login-page-body {
    background: #f0f4f8;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

/* DAS HYBRIDE LOGO: cod - e - du .info */
.login-logo-brand {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    user-select: none;
}

.logo-code {
    color: #2563eb; /* Blau für Code */
}

.logo-bridge {
    color: #8b5cf6; /* Lila Akzent: Das verbindende 'e' (Code + Edu) */
    background: #f3e8ff;
    padding: 0 4px;
    border-radius: 6px;
    margin: 0 1px;
}

.logo-edu {
    color: #0f172a; /* Dunkel/Schwarz für Edu */
}

.logo-domain {
    color: #64748b;
    font-size: 1.2rem;
    font-weight: 600;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

/* Form Fields */
.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.login-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-submit-login {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-submit-login:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* ==============================================================================
   STUDENT PROFILE & DASHBOARD STYLES
   ============================================================================== */

.student-dashboard-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.student-main-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    min-height: 80vh;
}

.welcome-header-card {
    margin-bottom: 25px;
}
.welcome-header-card h2 { margin: 0 0 6px 0; color: #0f172a; }
.welcome-header-card p { margin: 0; color: #64748b; }

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 15px;
}

.section-title-no-border {
    margin: 0;
    color: #0f172a;
    font-size: 1.3rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.project-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 18px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.project-icon-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.project-icon-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.project-title {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.project-date {
    font-size: 0.75rem;
    color: #64748b;
}

.project-desc {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
    margin-bottom: 15px;
}

.project-media-badges {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
}

.media-badge {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.project-progress-wrapper {
    margin-bottom: 15px;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: #334155;
}

.progress-bar-bg-sm {
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill-blue {
    background: #2563eb;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.project-card-actions {
    display: flex;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 10px;
}

.btn-project-edit {
    flex: 1;
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    padding: 6px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-project-delete {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Quiz Modules */
.quiz-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.quiz-module-card {
    border: 1px solid #e2e8f0;
    padding: 18px;
    border-radius: 10px;
    background: white;
}

.quiz-module-title { margin: 0 0 10px 0; font-size: 1rem; color: #0f172a; }
.quiz-module-status { font-size: 0.85rem; margin-bottom: 15px; color: #64748b; }
.text-success { color: #16a34a; }
.text-warning { color: #d97706; }

/* Student Sidebar */
.student-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.student-profile-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 25px;
    text-align: center;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #3b82f6;
}

.profile-avatar-placeholder-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 4px solid #3b82f6;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0f172a;
}

.profile-username {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 10px;
}

.profile-motto {
    font-style: italic;
    font-size: 0.85rem;
    color: #475569;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: bold;
}

.stat-value-green { font-size: 1rem; font-weight: bold; color: #059669; }
.stat-value-blue { font-size: 1rem; font-weight: bold; color: #2563eb; }

/* Edit Section */
.edit-section { margin-top: 15px; text-align: left; }
.btn-edit-summary {
    list-style: none;
    background: #eff6ff;
    color: #2563eb;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}
.btn-edit-summary:hover { background: #dbeafe; }

.edit-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-save-sm {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Sidebar Action & Notes Cards */
.student-action-card, .student-notes-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-logout-full {
    width: 100%;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-logout-full:hover { background: #fee2e2; }

.notes-title { margin: 0 0 10px 0; color: #0f172a; font-size: 0.95rem; }

.btn-save-note {
    margin-top: 8px;
    width: 100%;
    background: #059669;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}
.btn-save-note:hover { background: #047857; }

/* Helpers & Form Controls */
.inline-form { margin: 0; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.form-control-file { font-size: 0.8rem; }
.modal-divider { margin: 15px 0; border: none; border-top: 1px solid #e2e8f0; }
.modal-sub-heading { margin: 0 0 8px 0; font-size: 0.9rem; color: #1e293b; }
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.label-xs { font-size: 0.75rem; color: #64748b; display: block; margin-bottom: 2px; }
.mt-15 { margin-top: 15px; }

@media (max-width: 900px) {
    .student-dashboard-container { grid-template-columns: 1fr; }
}

/* ==============================================================================
   PROJECT MODALS (EINDEUTIGE KLASSEN)
   ============================================================================== */

.project-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(4px);
    z-index: 99999 !important;
    align-items: center;
    justify-content: center;
}

.project-modal-card {
    background: white;
    width: 90%;
    max-width: 500px;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

/* ==============================================================================
   PLAY QUIZ / CHALLENGE STYLES
   ============================================================================== */

.quiz-single-container {
    max-width: 1000px;
    margin: 0 auto;
}

.quiz-card-main {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.quiz-type-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: #059669;
    letter-spacing: 0.5px;
}

.quiz-main-title {
    margin: 4px 0 20px 0;
    font-size: 1.75rem;
    color: #0f172a;
}

.progress-bar-fill-green {
    background: #22c55e;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.question-wrapper {
    margin: 25px 0;
}

.question-text {
    font-size: 1.3rem;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* Options Grid */
.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.btn-quiz-option {
    background: #f8fafc;
    color: #1e293b;
    border: 2px solid #cbd5e1;
    padding: 18px 20px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-quiz-option:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.2);
}

.btn-quiz-option:active {
    transform: translateY(0);
}

/* ==============================================================================
   QUIZ RESULT STYLES (Tech-Light + Success Feedback)
   ============================================================================== */

.quiz-result-container {
    max-width: 550px;
    margin: 40px auto;
}

.quiz-result-card {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.result-icon-hero {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 15px;
    animation: popIn 0.4s ease-out;
}

.result-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 10px 0;
}

.text-success-title {
    color: #16a34a;
}

.text-danger-title {
    color: #dc2626;
}

.result-text {
    font-size: 1rem;
    color: #475569;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Big XP Chip Badge */
.result-xp-chip {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    border: 2px solid #86efac;
    font-size: 1.2rem;
    font-weight: 900;
    padding: 10px 24px;
    border-radius: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
    animation: pulseGlow 2s infinite;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-result-success-full {
    display: block;
    background: #22c55e;
    color: white;
    text-decoration: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}
.btn-result-success-full:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

.btn-result-retry-full {
    display: block;
    background: #ef4444;
    color: white;
    text-decoration: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.btn-result-retry-full:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-result-secondary-full {
    display: block;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    text-decoration: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}
.btn-result-secondary-full:hover {
    background: #e2e8f0;
}

/* ==============================================================================
   KEYSTROKE QUIZ STYLES
   ============================================================================== */

.keystroke-box-wrapper {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin: 25px 0;
}

.keystroke-hint-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
    margin: 0 0 15px 0;
}

.key-badge-visual {
    display: inline-block;
    min-width: 120px;
    padding: 15px 25px;
    background: white;
    border: 3px solid #0f172a;
    border-bottom: 6px solid #0f172a;
    border-radius: 12px;
    font-size: 1.8rem;
    font-weight: 900;
    color: #0f172a;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    user-select: none;
}

.key-success-pulse {
    background: #22c55e !important;
    color: white !important;
    border-color: #15803d !important;
    transform: scale(1.1);
}

.key-error-shake {
    animation: shake 0.3s ease-in-out;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.key-feedback-msg {
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #64748b;
}

/* Button Sperre solange Taste nicht gedrückt wurde */
.btn-keystroke-locked {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(1);
    transition: all 0.3s ease;
}