/* ============================================
   ABICRACK – Modern CSS Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Light Mode Colors – warm, clean, professional */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafd;
    --bg-elevated: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.85);
    --bg-hero: linear-gradient(180deg, #f0f2ff 0%, #ffffff 50%);
    --bg-features: linear-gradient(180deg, #f8f9fc 0%, #f0f2ff 100%);

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;

    --accent-primary: #4f46e5;
    --accent-primary-light: #6366f1;
    --accent-primary-dark: #3730a3;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    --accent-gradient-text: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #db2777 100%);
    --accent-glow: rgba(79, 70, 229, 0.12);

    --border-color: #e5e7eb;
    --border-color-hover: #d1d5db;
    --border-color-subtle: #f3f4f6;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 50px -12px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
    --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(79, 70, 229, 0.1);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.12);
    --shadow-btn: 0 1px 3px rgba(79, 70, 229, 0.2), 0 4px 12px rgba(79, 70, 229, 0.15);
    --shadow-btn-hover: 0 4px 8px rgba(79, 70, 229, 0.25), 0 8px 24px rgba(79, 70, 229, 0.2);

    /* Card colors */
    --emerald: #059669;
    --emerald-bg: linear-gradient(135deg, #ecfdf5, #d1fae5);
    --emerald-border: #a7f3d0;
    --blue: #2563eb;
    --blue-bg: linear-gradient(135deg, #eff6ff, #dbeafe);
    --blue-border: #93c5fd;
    --amber: #d97706;
    --amber-bg: linear-gradient(135deg, #fffbeb, #fef3c7);
    --amber-border: #fcd34d;
    --rose: #e11d48;
    --rose-bg: linear-gradient(135deg, #fff1f2, #ffe4e6);
    --rose-border: #fda4af;
    --violet: #7c3aed;
    --violet-bg: linear-gradient(135deg, #f5f3ff, #ede9fe);
    --violet-border: #c4b5fd;
    --orange: #ea580c;
    --orange-bg: linear-gradient(135deg, #fff7ed, #ffedd5);
    --orange-border: #fdba74;
    --cyan: #0891b2;
    --cyan-bg: linear-gradient(135deg, #ecfeff, #cffafe);
    --cyan-border: #67e8f9;
    --teal: #0d9488;
    --teal-bg: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    --teal-border: #5eead4;

    /* Spacing */
    --nav-height: 72px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
    --bg-primary: #09090b;
    --bg-secondary: #111113;
    --bg-card: #18181b;
    --bg-card-hover: #1f1f23;
    --bg-elevated: #1c1c20;
    --bg-nav: rgba(9, 9, 11, 0.9);
    --bg-hero: linear-gradient(180deg, #0f0f14 0%, #09090b 50%);
    --bg-features: linear-gradient(180deg, #111113 0%, #0f0f14 100%);

    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-tertiary: #63636e;
    --text-inverse: #09090b;

    --border-color: #27272a;
    --border-color-hover: #3f3f46;
    --border-color-subtle: #1e1e22;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.15);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --shadow-btn: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-btn-hover: 0 4px 16px rgba(99,102,241,0.3);
    --accent-glow: rgba(99, 102, 241, 0.08);

    --emerald-bg: linear-gradient(135deg, #064e3b33, #06543f22);
    --emerald-border: #065f46;
    --blue-bg: linear-gradient(135deg, #1e3a5f33, #1e40af22);
    --blue-border: #1e3a5f;
    --amber-bg: linear-gradient(135deg, #78350f33, #92400e22);
    --amber-border: #78350f;
    --rose-bg: linear-gradient(135deg, #9f122233, #be123c22);
    --rose-border: #9f1239;
    --violet-bg: linear-gradient(135deg, #4c1d9533, #5b21b622);
    --violet-border: #4c1d95;
    --orange-bg: linear-gradient(135deg, #7c2d1233, #9a3412ee);
    --orange-border: #7c2d12;
    --cyan-bg: linear-gradient(135deg, #164e6333, #155e7522);
    --cyan-border: #164e63;
    --teal-bg: linear-gradient(135deg, #134e4a33, #115e5922);
    --teal-border: #134e4a;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background var(--duration-normal) var(--ease-out),
                color var(--duration-normal) var(--ease-out);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* --- Cursor Glow --- */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s;
    opacity: 0;
}
body:hover .cursor-glow { opacity: 1; }

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-color-subtle);
    z-index: 1000;
    transition: all var(--duration-normal) var(--ease-out);
}
.navbar.scrolled {
    border-bottom-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.logo-text { color: var(--text-primary); }
.logo-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
}
.theme-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/* --- User Menu --- */
.nav-user-menu { position: relative; }
.nav-user-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    cursor: pointer; font-family: inherit;
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-primary); transition: all 0.2s;
}
.nav-user-btn:hover { border-color: var(--border-color-hover); box-shadow: var(--shadow-sm); }
.nav-user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem;
}
.nav-user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; width: 220px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-xl);
    padding: 6px; display: none; z-index: 1001;
    animation: dropdownIn 0.2s var(--ease-out);
}
.nav-user-dropdown.open { display: block; }
@keyframes dropdownIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.nav-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 0.85rem; color: var(--text-secondary);
    cursor: pointer; border: none; background: none;
    width: 100%; text-align: left; font-family: inherit; transition: all 0.15s;
}
.nav-dropdown-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.nav-logout { color: #ef4444; }
.nav-logout:hover { background: #fef2f2; color: #dc2626; }
[data-theme="dark"] .nav-logout:hover { background: #7f1d1d22; }
.nav-dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 8px; }
.nav-dropdown-info { padding: 6px 12px; }
.nav-dropdown-xp { font-size: 0.75rem; font-weight: 600; color: var(--accent-primary); }
@media (max-width: 768px) {
    .nav-user-name { display: none; }
    .nav-user-btn svg:last-child { display: none; }
    .nav-user-btn { padding: 4px; }
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: none;
    cursor: pointer; padding: 4px;
}
.mobile-toggle span {
    width: 24px; height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--duration-normal) var(--ease-out);
}
.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
    font-family: inherit;
}
.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover);
    filter: brightness(1.05);
}
.btn-ghost {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-sm);
}
.btn-white {
    background: white;
    color: var(--accent-primary-dark);
    box-shadow: var(--shadow-md);
}
.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-lg {
    padding: 14px 28px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--nav-height);
    overflow: hidden;
    background: var(--bg-hero);
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.3;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 100%);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 10s ease-in-out infinite;
}
.orb-1 {
    width: 500px; height: 500px;
    background: rgba(79, 70, 229, 0.15);
    top: 5%; left: 15%;
}
.orb-2 {
    width: 400px; height: 400px;
    background: rgba(124, 58, 237, 0.1);
    top: 25%; right: 10%;
    animation-delay: -4s;
}
.orb-3 {
    width: 350px; height: 350px;
    background: rgba(219, 39, 119, 0.08);
    bottom: 15%; left: 35%;
    animation-delay: -7s;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -25px) scale(1.05); }
    66% { transform: translate(-25px, 15px) scale(0.95); }
}

.hero-container {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 28px;
    box-shadow: var(--shadow-card);
}
.badge-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px rgba(16,185,129,0.4); }
    50% { opacity: 0.6; transform: scale(1.4); box-shadow: 0 0 16px rgba(16,185,129,0.2); }
}

.hero-title {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
}
.gradient-text {
    background: var(--accent-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.75;
}
.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 56px;
    flex-wrap: wrap;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 36px;
    padding: 24px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}
.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.hero-stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}
.hero-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.hero-stat-divider {
    width: 1px; height: 40px;
    background: var(--border-color);
}

/* --- Sections --- */
.section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-tag {
    display: inline-block;
    padding: 5px 16px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}
.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

/* --- Subject Cards --- */
.faecher-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.fach-card {
    position: relative;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--duration-normal) var(--ease-out);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
}
.fach-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
    border-radius: inherit;
}
.fach-card[data-color="emerald"]::before { background: var(--emerald-bg); }
.fach-card[data-color="blue"]::before { background: var(--blue-bg); }
.fach-card[data-color="amber"]::before { background: var(--amber-bg); }
.fach-card[data-color="rose"]::before { background: var(--rose-bg); }
.fach-card[data-color="violet"]::before { background: var(--violet-bg); }
.fach-card[data-color="orange"]::before { background: var(--orange-bg); }
.fach-card[data-color="cyan"]::before { background: var(--cyan-bg); }
.fach-card[data-color="teal"]::before { background: var(--teal-bg); }

.fach-card:hover::before { opacity: 1; }
.fach-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.fach-icon {
    position: relative;
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}
.fach-card[data-color="emerald"] .fach-icon { background: var(--emerald-bg); color: var(--emerald); border-color: var(--emerald-border); }
.fach-card[data-color="blue"] .fach-icon { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.fach-card[data-color="amber"] .fach-icon { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.fach-card[data-color="rose"] .fach-icon { background: var(--rose-bg); color: var(--rose); border-color: var(--rose-border); }
.fach-card[data-color="violet"] .fach-icon { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-border); }
.fach-card[data-color="orange"] .fach-icon { background: var(--orange-bg); color: var(--orange); border-color: var(--orange-border); }
.fach-card[data-color="cyan"] .fach-icon { background: var(--cyan-bg); color: var(--cyan); border-color: var(--cyan-border); }
.fach-card[data-color="teal"] .fach-icon { background: var(--teal-bg); color: var(--teal); border-color: var(--teal-border); }

.fach-name { position: relative; font-size: 1.1rem; font-weight: 700; }
.fach-desc { position: relative; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; flex-grow: 1; }
.fach-meta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}
.fach-count { font-size: 0.8rem; font-weight: 500; color: var(--text-tertiary); }
.fach-arrow {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--duration-normal) var(--ease-out);
}
.fach-card:hover .fach-arrow {
    background: var(--accent-primary);
    color: white;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* --- Features Grid --- */
.features-section { background: var(--bg-features); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
    padding: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-card);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent-primary-light);
}
.feature-icon-wrap {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; }

/* --- Stats Section --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-card {
    text-align: center;
    padding: 36px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--duration-normal) var(--ease-out);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.stat-number {
    font-size: 2.8rem;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; margin-bottom: 16px; }
.stat-bar { height: 4px; background: var(--bg-secondary); border-radius: var(--radius-full); overflow: hidden; }
.stat-bar-fill {
    height: 100%; width: 0;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 1.5s var(--ease-out);
}
.stat-bar-fill.animated { width: var(--fill); }

/* --- CTA Section --- */
.cta-card {
    position: relative;
    padding: 88px 40px;
    border-radius: var(--radius-xl);
    background: var(--accent-gradient);
    overflow: hidden;
    text-align: center;
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.25);
}
.cta-bg { position: absolute; inset: 0; }
.orb-cta-1 {
    width: 400px; height: 400px;
    background: rgba(255, 255, 255, 0.08);
    top: -25%; right: -5%;
    filter: blur(80px);
}
.orb-cta-2 {
    width: 250px; height: 250px;
    background: rgba(255, 255, 255, 0.06);
    bottom: -15%; left: 8%;
    filter: blur(60px);
}
.cta-content { position: relative; z-index: 1; }
.cta-content h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; color: white; margin-bottom: 12px; }
.cta-content p { font-size: 1.1rem; color: rgba(255, 255, 255, 0.85); margin-bottom: 36px; }

/* --- Footer --- */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 64px 0 32px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 12px; max-width: 280px; line-height: 1.65; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); margin-bottom: 4px; }
.footer-col a { font-size: 0.9rem; color: var(--text-secondary); transition: color var(--duration-fast); }
.footer-col a:hover { color: var(--accent-primary); }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border-color); text-align: center; }
.footer-bottom p { font-size: 0.8rem; color: var(--text-tertiary); }

/* --- Scroll Animations --- */
.animate-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.animate-in.visible { opacity: 1; transform: translateY(0); }
.animate-in:nth-child(2) { transition-delay: 0.1s; }
.animate-in:nth-child(3) { transition-delay: 0.2s; }
.animate-in:nth-child(4) { transition-delay: 0.3s; }
.animate-in:nth-child(5) { transition-delay: 0.4s; }

.fach-card, .feature-card, .stat-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-out);
}
.fach-card.visible, .feature-card.visible, .stat-card.visible { opacity: 1; transform: translateY(0); }
.fach-card:nth-child(1), .feature-card:nth-child(1), .stat-card:nth-child(1) { transition-delay: 0s; }
.fach-card:nth-child(2), .feature-card:nth-child(2), .stat-card:nth-child(2) { transition-delay: 0.06s; }
.fach-card:nth-child(3), .feature-card:nth-child(3), .stat-card:nth-child(3) { transition-delay: 0.12s; }
.fach-card:nth-child(4), .feature-card:nth-child(4), .stat-card:nth-child(4) { transition-delay: 0.18s; }
.fach-card:nth-child(5), .feature-card:nth-child(5) { transition-delay: 0.24s; }
.fach-card:nth-child(6), .feature-card:nth-child(6) { transition-delay: 0.30s; }
.fach-card:nth-child(7) { transition-delay: 0.36s; }
.fach-card:nth-child(8) { transition-delay: 0.42s; }

/* ============================================
   BIBLIOTHEK PAGE
   ============================================ */
.bib-layout { display: flex; min-height: 100vh; padding-top: var(--nav-height); }

.bib-sidebar {
    width: 320px;
    position: fixed;
    top: var(--nav-height);
    left: 0; bottom: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--duration-normal) var(--ease-out);
}
.bib-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0;
    background: var(--bg-card);
    z-index: 10;
}
.bib-search { position: relative; }
.bib-search input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--duration-fast);
}
.bib-search input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.bib-search input::placeholder { color: var(--text-tertiary); }
.bib-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }

.bib-nav { padding: 8px; }
.bib-fach { margin-bottom: 4px; }
.bib-fach-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--duration-fast);
    user-select: none;
}
.bib-fach-header:hover { background: var(--bg-secondary); }
.bib-fach-header .chevron { margin-left: auto; transition: transform var(--duration-normal) var(--ease-out); color: var(--text-tertiary); }
.bib-fach.open .chevron { transform: rotate(90deg); }
.bib-fach-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bib-topics { max-height: 0; overflow: hidden; transition: max-height var(--duration-slow) var(--ease-out); }
.bib-fach.open .bib-topics { max-height: 8000px; }
.bib-topic-link {
    display: block;
    padding: 8px 12px 8px 34px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
    line-height: 1.4;
}
.bib-topic-link:hover { background: var(--bg-secondary); color: var(--text-primary); }
.bib-topic-link.active { background: var(--accent-glow); color: var(--accent-primary); font-weight: 500; }

.bib-main { flex: 1; margin-left: 320px; min-height: calc(100vh - var(--nav-height)); }
.bib-content { max-width: 100%; margin: 0; padding: 24px 28px; }

.bib-welcome { text-align: center; padding: 80px 20px; }
.bib-welcome-icon {
    width: 80px; height: 80px;
    border-radius: var(--radius-xl);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
}
.bib-welcome h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 12px; }
.bib-welcome p { color: var(--text-secondary); max-width: 500px; margin: 0 auto; line-height: 1.7; }

.bib-iframe-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 600px;
    box-shadow: var(--shadow-card);
}
.bib-iframe-wrap iframe { width: 100%; height: calc(100vh - var(--nav-height) - 60px); border: none; }

.bib-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 20px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}
.bib-breadcrumb a { color: var(--text-secondary); transition: color var(--duration-fast); }
.bib-breadcrumb a:hover { color: var(--accent-primary); }

.bib-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bib-topic-card {
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}
.bib-topic-card:hover { transform: translateY(-3px); border-color: var(--accent-primary-light); box-shadow: var(--shadow-card-hover); }
.bib-topic-card h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.bib-topic-card p { font-size: 0.8rem; color: var(--text-tertiary); }

/* Sidebar collapse button */
.bib-collapse-btn {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast);
    flex-shrink: 0;
}
.bib-collapse-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-color-hover);
    background: var(--bg-secondary);
}

/* Expand button (visible when collapsed) */
.bib-expand-btn {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    left: 12px;
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-tertiary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 101;
    box-shadow: var(--shadow-md);
    transition: all var(--duration-fast);
}
.bib-expand-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Collapsed state */
.bib-layout.sidebar-collapsed .bib-sidebar {
    transform: translateX(-100%);
    pointer-events: none;
}
.bib-layout.sidebar-collapsed .bib-main {
    margin-left: 0;
}
.sidebar-collapsed .bib-expand-btn {
    display: flex;
    animation: pageIn 0.3s var(--ease-out);
}

/* Smooth transitions for collapse */
.bib-sidebar { transition: transform 0.35s var(--ease-out); }
.bib-main { transition: margin-left 0.35s var(--ease-out); }

.bib-sidebar-toggle {
    display: none;
    position: fixed; bottom: 24px; right: 24px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white; border: none;
    box-shadow: var(--shadow-lg), 0 4px 16px rgba(79, 70, 229, 0.3);
    cursor: pointer; z-index: 200;
    align-items: center; justify-content: center;
    transition: transform var(--duration-fast);
}
.bib-sidebar-toggle:hover { transform: scale(1.1); }

/* ============================================
   RESPONSIVE – All Screen Sizes
   ============================================ */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .container { max-width: 1320px; }
    .hero-title { font-size: 5.5rem; }
    .faecher-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .bib-sidebar { width: 360px; }
    .bib-main { margin-left: 360px; }
}

/* Desktop (1024-1439px) – default styles apply */

/* Tablet Landscape (1024px) */
@media (max-width: 1024px) {
    .faecher-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
    .bib-sidebar { transform: translateX(-100%); }
    .bib-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
    .bib-main { margin-left: 0; }
    .bib-sidebar-toggle { display: flex; }
    .section { padding: 80px 0; }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    :root { --nav-height: 60px; }
    .nav-links {
        display: none; position: fixed; top: var(--nav-height); left: 0; right: 0;
        background: var(--bg-nav); backdrop-filter: blur(24px); padding: 16px;
        flex-direction: column; border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-lg);
    }
    .nav-links.open { display: flex; }
    .nav-cta { display: none; }
    .mobile-toggle { display: flex; }
    .nav-logo { font-size: 1.3rem; }

    .hero { min-height: 90vh; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1rem; margin-bottom: 28px; }
    .hero-badge { font-size: 0.8rem; padding: 6px 14px; }
    .hero-stats { flex-direction: column; gap: 16px; padding: 20px; width: 100%; }
    .hero-stat-divider { width: 40px; height: 1px; }
    .hero-stat-number { font-size: 1.5rem; }

    .section { padding: 60px 0; }
    .section-header { margin-bottom: 40px; }
    .section-title { font-size: 1.6rem; }
    .section-subtitle { font-size: 0.95rem; }

    .faecher-grid { grid-template-columns: 1fr; gap: 12px; }
    .fach-card { padding: 20px; }
    .features-grid { grid-template-columns: 1fr; gap: 14px; }
    .feature-card { padding: 24px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-number { font-size: 2rem; }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .cta-card { padding: 48px 20px; }
    .cta-content h2 { font-size: 1.5rem; }
    .cta-buttons { flex-direction: column; width: 100%; }
    .cta-buttons .btn { width: 100%; justify-content: center; }

    .bib-content { padding: 16px 12px; }
    .bib-welcome { padding: 40px 16px; }
    .bib-welcome h2 { font-size: 1.4rem; }
    .bib-topic-grid { grid-template-columns: 1fr; }

    /* Floating elements */
    .floating-coffee { bottom: 16px; left: 16px; padding: 10px 14px; font-size: 0.8rem; }
}

/* Mobile Large (480px) */
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-container { padding: 0 16px; }
    .hero-title { font-size: 2rem; letter-spacing: -0.03em; }
    .hero-subtitle { font-size: 0.9rem; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; justify-content: center; }

    .stats-grid { grid-template-columns: 1fr; }
    .fach-card { padding: 16px; gap: 10px; }
    .fach-icon { width: 44px; height: 44px; }
    .fach-name { font-size: 1rem; }

    .section-tag { font-size: 0.65rem; }
    .feature-icon-wrap { width: 44px; height: 44px; }

    .footer { padding: 40px 0 24px; }
    .footer-brand p { font-size: 0.82rem; }

    .btn-lg { padding: 12px 24px; font-size: 0.9rem; }

    /* Cookie banner */
    .cookie-banner-inner { padding: 14px; }
    .cookie-banner-content { flex-direction: column; gap: 10px; }
    .cookie-banner-icon { width: 32px; height: 32px; }
}

/* Mobile Small (360px) */
@media (max-width: 360px) {
    :root { --nav-height: 56px; }
    .nav-logo { font-size: 1.2rem; }
    .hero-title { font-size: 1.7rem; }
    .hero-subtitle { font-size: 0.85rem; }
    .hero-badge { font-size: 0.75rem; }
    .hero-stats { padding: 16px; gap: 12px; }
    .hero-stat-number { font-size: 1.3rem; }
    .section { padding: 48px 0; }
    .section-title { font-size: 1.4rem; }
    .fach-card { padding: 14px; }
    .stat-card { padding: 20px 16px; }
    .stat-number { font-size: 1.6rem; }
    .cta-card { padding: 36px 16px; }
    .floating-coffee-text { display: none; }
    .floating-coffee { padding: 12px; border-radius: 50%; }
}

/* Very tall screens (prevent hero from being too spread out) */
@media (min-height: 1000px) {
    .hero { min-height: 80vh; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { min-height: 100vh; padding-top: calc(var(--nav-height) + 16px); }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { display: none; }
    .hero-stats { flex-direction: row; }
    .hero-stat-divider { width: 1px; height: 30px; }
    .gradient-orb { display: none; }
}

/* Print */
@media print {
    .navbar, .floating-coffee, .cookie-banner, .bib-sidebar, .bib-sidebar-toggle, .bib-expand-btn { display: none !important; }
    .bib-main { margin-left: 0 !important; }
    body { background: white; color: black; }
    .hero, .cta-section { display: none; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .gradient-orb { display: none; }
    .cursor-glow { display: none; }
}

/* Touch devices */
@media (hover: none) {
    .cursor-glow { display: none; }
    .fach-card:hover { transform: none; }
    .feature-card:hover { transform: none; }
    .stat-card:hover { transform: none; }
    .bib-hide-btn { opacity: 0.5; }
}

/* PWA standalone mode */
@media (display-mode: standalone) {
    .navbar { padding-top: env(safe-area-inset-top, 0); height: calc(var(--nav-height) + env(safe-area-inset-top, 0)); }
    .hero { padding-top: calc(var(--nav-height) + env(safe-area-inset-top, 0)); }
    body { padding-bottom: env(safe-area-inset-bottom, 0); }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .grid-pattern { opacity: 0.2; }
}
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* --- Selection --- */
::selection { background: rgba(79, 70, 229, 0.15); color: var(--text-primary); }

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Page Transition --- */
.page-transition { animation: pageIn 0.5s var(--ease-out); }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* --- Tooltip --- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--duration-fast);
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================
   COOKIE / PRIVACY BANNER
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    padding: 16px;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-out);
}
.cookie-banner.visible { transform: translateY(0); }

.cookie-banner-inner {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
[data-theme="dark"] .cookie-banner-inner {
    box-shadow: 0 -4px 30px rgba(0,0,0,0.4);
}

.cookie-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.cookie-banner-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-banner-text { flex: 1; }
.cookie-banner-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.cookie-banner-text p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
.cookie-banner-text a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.cookie-btn-accept {
    padding: 10px 24px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: var(--shadow-btn);
    transition: all 0.2s;
    white-space: nowrap;
}
.cookie-btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-btn-hover);
}

.cookie-btn-more {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: color 0.2s;
}
.cookie-btn-more:hover { color: var(--accent-primary); }

@media (max-width: 640px) {
    .cookie-banner-inner { padding: 16px; }
    .cookie-banner-actions { flex-direction: column; width: 100%; }
    .cookie-btn-accept { width: 100%; text-align: center; }
}

/* ============================================
   GUEST RESTRICTIONS
   ============================================ */

/* Locked topic links for guests */
.bib-topic-link.guest-locked {
    opacity: 0.45;
    pointer-events: auto;
    cursor: pointer;
}
.bib-topic-link.guest-locked:hover {
    opacity: 0.6;
    background: var(--bg-secondary);
}
.bib-topic-link.guest-locked::before { display: none; }

/* Guest banner */
.guest-banner { margin-bottom: 24px; }
.guest-banner-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #eff6ff, #e0e7ff);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}
[data-theme="dark"] .guest-banner-inner {
    background: linear-gradient(135deg, #1e1b4b33, #312e8122);
    border-color: #4338ca44;
}
.guest-banner-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.guest-banner-text { flex: 1; min-width: 200px; }
.guest-banner-text strong { display: block; font-size: 0.9rem; color: var(--text-primary); margin-bottom: 2px; }
.guest-banner-text span { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.guest-banner-btn {
    padding: 10px 22px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: var(--shadow-btn);
    transition: all 0.2s;
    white-space: nowrap;
}
.guest-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover);
}

/* Guest modal */
.guest-modal {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.guest-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.guest-modal-card {
    position: relative; z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: pageIn 0.3s var(--ease-out);
}
.guest-modal-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
[data-theme="dark"] .guest-modal-icon { background: linear-gradient(135deg, #78350f44, #92400e33); }
.guest-modal-card h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.guest-modal-card p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.guest-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.guest-modal-register {
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow-btn);
    transition: all 0.2s;
}
.guest-modal-register:hover { transform: translateY(-2px); box-shadow: var(--shadow-btn-hover); }
.guest-modal-close {
    padding: 10px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.guest-modal-close:hover { background: var(--bg-secondary); }

/* ============================================
   ENHANCED SIDEBAR CATEGORIES
   ============================================ */

/* Quarter headers (Q1, Q2, Q3) in sidebar */
.bib-quarter-header {
    padding: 10px 12px 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border-color-subtle);
}

.bib-quarter-header::before {
    content: '';
    width: 14px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent-gradient);
    flex-shrink: 0;
}

.bib-topics .bib-quarter-header:first-child {
    margin-top: 4px;
    border-top: none;
}

/* Hide/show button */
.bib-hide-btn {
    margin-left: auto;
    padding: 2px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
    border-radius: 4px;
}
.bib-category-header:hover .bib-hide-btn { opacity: 0.6; }
.bib-hide-btn:hover { opacity: 1 !important; color: var(--accent-primary); background: var(--accent-glow); }
.bib-hide-btn.is-hidden { opacity: 0.5; }

/* Hidden category content */
.bib-category-content { transition: all 0.3s var(--ease-out); }
.bib-category-content.category-hidden {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* Subcategory headers in sidebar */
.bib-category-header {
    padding: 6px 12px 3px 26px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bib-category-header::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-tertiary);
    opacity: 0.4;
    flex-shrink: 0;
}

/* Learned dot indicator */
.bib-learned-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    display: inline-block;
    margin-right: 6px;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    vertical-align: middle;
}

.bib-topic-link.is-learned .bib-learned-dot {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
    animation: dotPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bib-topic-link.is-learned {
    color: #059669 !important;
    font-weight: 500;
}

@keyframes dotPop {
    0% { transform: scale(0); }
    60% { transform: scale(1.6); }
    100% { transform: scale(1); }
}

/* Improved sidebar topic links */
.bib-topic-link {
    position: relative;
    overflow: hidden;
}

.bib-topic-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-primary);
    border-radius: 0 2px 2px 0;
    transition: height var(--duration-normal) var(--ease-out);
}

.bib-topic-link.active::before,
.bib-topic-link:hover::before {
    height: 60%;
}

/* Fach header badge for topic count */
.bib-fach-count {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 400;
    background: var(--bg-secondary);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    line-height: 1.6;
}

/* ============================================
   ENHANCED ANIMATIONS
   ============================================ */

/* Hover lift for all interactive cards */
.fach-card, .feature-card, .stat-card, .bib-topic-card {
    will-change: transform;
}

/* Smooth entrance for hero elements */
@keyframes heroSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.hero-badge.visible { animation: heroSlideUp 0.8s var(--ease-out) forwards; }
.hero-title.visible { animation: heroSlideUp 0.8s 0.1s var(--ease-out) forwards; }
.hero-subtitle.visible { animation: heroSlideUp 0.8s 0.2s var(--ease-out) forwards; }
.hero-actions.visible { animation: heroSlideUp 0.8s 0.3s var(--ease-out) forwards; }
.hero-stats.visible { animation: heroSlideUp 0.8s 0.4s var(--ease-out) forwards; }

/* Gradient animation on hero text */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-text {
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

/* Pulse animation for CTA button */
@keyframes pulseGlow {
    0%, 100% { box-shadow: var(--shadow-btn); }
    50% { box-shadow: var(--shadow-btn-hover), 0 0 24px rgba(79, 70, 229, 0.15); }
}

.hero-actions .btn-primary {
    animation: pulseGlow 3s ease-in-out infinite;
}
.hero-actions .btn-primary:hover {
    animation: none;
}

/* Floating badge animation */
@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.hero-badge.visible {
    animation: heroSlideUp 0.8s var(--ease-out) forwards, floatBadge 4s 1s ease-in-out infinite;
}

/* Card entrance with scale */
@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fach-card.visible { animation: cardIn 0.5s var(--ease-out) forwards; }
.feature-card.visible { animation: cardIn 0.5s var(--ease-out) forwards; }
.stat-card.visible { animation: cardIn 0.5s var(--ease-out) forwards; }

/* Counter number shimmer on finish */
@keyframes shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Improved button hover effect */
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.btn-primary { position: relative; overflow: hidden; }
.btn-primary:hover::after { opacity: 1; }

/* Nav link underline animation */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform var(--duration-normal) var(--ease-out);
}
.nav-link:hover::after {
    transform: scaleX(1);
}

/* Stat bar shimmer effect */
.stat-bar-fill.animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: barShimmer 2s 1.5s ease forwards;
}
.stat-bar-fill { position: relative; overflow: hidden; }

@keyframes barShimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* Smooth sidebar open/close */
.bib-topics {
    transition: max-height 0.4s var(--ease-out), opacity 0.3s var(--ease-out);
    opacity: 0;
}
.bib-fach.open .bib-topics {
    opacity: 1;
}

/* Active fach highlight */
.bib-fach.open > .bib-fach-header {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

/* Footer link hover */
.footer-col a {
    position: relative;
    display: inline-block;
}
.footer-col a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-primary);
    transition: width var(--duration-normal) var(--ease-out);
}
.footer-col a:hover::after {
    width: 100%;
}

/* CTA section entrance */
.cta-card {
    transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}
.cta-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 70px rgba(79, 70, 229, 0.3);
}

/* Improved search input focus */
.bib-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 2px 8px rgba(79, 70, 229, 0.08);
    background: var(--bg-card);
}

/* Welcome icon pulse */
@keyframes iconPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25); }
    50% { box-shadow: 0 12px 36px rgba(79, 70, 229, 0.35); }
}
.bib-welcome-icon {
    animation: iconPulse 3s ease-in-out infinite;
}

/* Smooth scroll indicator */
@keyframes scrollDown {
    0% { opacity: 0; transform: translateY(-8px); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateY(8px); }
}

/* Test link in sidebar (last item in each category) */
.bib-test-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 26px;
    margin: 4px 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    border: 1px dashed var(--border-color);
    line-height: 1.3;
}

.bib-test-link.locked {
    color: var(--text-tertiary);
    background: transparent;
    opacity: 0.6;
}
.bib-test-link.locked:hover {
    opacity: 0.8;
    background: var(--bg-secondary);
}

.bib-test-link.unlocked {
    color: var(--accent-primary);
    background: var(--accent-glow);
    border-color: var(--accent-primary-light);
    border-style: solid;
    animation: testUnlock 0.5s var(--ease-spring);
}
.bib-test-link.unlocked:hover {
    background: rgba(79, 70, 229, 0.12);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

@keyframes testUnlock {
    0% { transform: scale(0.95); opacity: 0; }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

.bib-test-link-icon {
    width: 24px; height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bib-test-link.locked .bib-test-link-icon {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}
.bib-test-link.unlocked .bib-test-link-icon {
    background: var(--accent-gradient);
    color: white;
}

.bib-test-link-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bib-test-link-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.bib-test-link.locked .bib-test-link-badge {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}
.bib-test-link-badge.ready {
    background: #ecfdf5;
    color: #059669;
}

[data-theme="dark"] .bib-test-link-badge.ready {
    background: #064e3b44;
    color: #10b981;
}

/* Category test header */
.cat-test-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
.cat-test-header-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
}
.cat-test-header h2 { font-size: 1.4rem; font-weight: 800; margin: 0 0 4px; }
.cat-test-header p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }

/* Category test card */
.cat-test-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
    animation: pageIn 0.4s var(--ease-out);
}
.cat-test-progress { margin-bottom: 24px; }
.cat-test-progress-bar { height: 6px; background: var(--bg-secondary); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.cat-test-progress-fill { height: 100%; background: var(--accent-gradient); border-radius: 99px; transition: width 0.5s var(--ease-out); }
.cat-test-progress-info { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-tertiary); font-weight: 500; }
.cat-test-score-live { color: var(--accent-primary); }
.cat-test-question h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; line-height: 1.5; }

.cat-test-answers { display: flex; flex-direction: column; gap: 10px; }
.cat-test-answer {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 14px 18px; background: var(--bg-secondary); border: 2px solid var(--border-color);
    border-radius: var(--radius-md); cursor: pointer; font-family: inherit; font-size: 0.9rem;
    text-align: left; color: var(--text-primary); transition: all 0.2s var(--ease-out);
}
.cat-test-answer:hover { border-color: var(--accent-primary); background: var(--accent-glow); transform: translateX(4px); }
.cat-test-letter {
    width: 32px; height: 32px; border-radius: 8px; background: var(--border-color);
    color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; flex-shrink: 0; transition: all 0.2s;
}
.cat-test-answer:hover .cat-test-letter { background: var(--accent-primary); color: white; }
.cat-test-icon { margin-left: auto; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.cat-test-answer.correct { border-color: #10b981; background: #ecfdf5; }
.cat-test-answer.correct .cat-test-letter { background: #10b981; color: white; }
.cat-test-answer.correct .cat-test-icon { color: #10b981; }
.cat-test-answer.wrong { border-color: #ef4444; background: #fef2f2; }
.cat-test-answer.wrong .cat-test-letter { background: #ef4444; color: white; }
.cat-test-answer.wrong .cat-test-icon { color: #ef4444; }

.cat-test-explanation { margin-top: 20px; animation: pageIn 0.3s ease; }
.cat-test-correct-box, .cat-test-wrong-box {
    padding: 16px 20px; border-radius: var(--radius-md); font-size: 0.9rem; line-height: 1.6;
}
.cat-test-correct-box { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.cat-test-wrong-box { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.cat-test-correct-box strong { color: #059669; }
.cat-test-wrong-box strong { color: #dc2626; }
.cat-test-correct-box p, .cat-test-wrong-box p { margin-top: 6px; }

.cat-test-nav { margin-top: 20px; display: flex; justify-content: flex-end; }
.cat-test-next-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
    background: var(--accent-gradient); color: white; border: none; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600; cursor: pointer; font-family: inherit;
    box-shadow: 0 2px 8px rgba(79,70,229,0.2); transition: all 0.2s;
}
.cat-test-next-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(79,70,229,0.3); }

/* Results */
.cat-test-results { text-align: center; }
.cat-test-circle {
    width: 150px; height: 150px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; margin: 0 auto 24px;
    animation: pageIn 0.8s var(--ease-out);
}
.cat-test-circle-inner {
    width: 120px; height: 120px; border-radius: 50%; background: var(--bg-card);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cat-test-big-score { font-size: 2rem; font-weight: 900; }
.cat-test-small-score { font-size: 0.8rem; color: var(--text-tertiary); }
.cat-test-results h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.cat-test-results > p { color: var(--text-secondary); margin-bottom: 28px; }

.cat-test-overview { margin-bottom: 28px; text-align: left; }
.cat-test-overview h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.cat-test-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-test-dot {
    width: 32px; height: 32px; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700;
}
.cat-test-dot.correct { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.cat-test-dot.wrong { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.cat-test-review { text-align: left; margin: 24px 0; padding: 24px; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-lg); }
.cat-test-review h3 { font-size: 1rem; font-weight: 700; color: #92400e; margin-bottom: 16px; }
.cat-test-review-item { padding: 16px; background: var(--bg-card); border-radius: var(--radius-md); margin-bottom: 12px; border: 1px solid var(--border-color); }
.cat-test-review-q { font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; }
.cat-test-review-correct { font-size: 0.85rem; margin-bottom: 4px; }
.cat-test-review-expl { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }

.cat-test-perfect { padding: 32px; background: #ecfdf5; border-radius: var(--radius-lg); margin: 24px 0; }
.cat-test-perfect h3 { color: #059669; font-size: 1.2rem; margin-bottom: 8px; }

/* Stats grid */
.cat-test-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
    text-align: center;
}
.cat-test-stat {
    padding: 16px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color-subtle);
}
.cat-test-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.cat-test-stat-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cat-test-grade-note {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

/* Correct details (collapsible) */
.cat-test-details { margin-bottom: 20px; }
.cat-test-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    list-style: none;
}
.cat-test-summary::-webkit-details-marker { display: none; }
.correct-summary { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.correct-summary:hover { background: #d1fae5; }
.cat-test-details[open] .cat-test-summary svg { transform: rotate(180deg); }
.cat-test-details-content { padding-top: 12px; }

/* Review items */
.cat-test-review { text-align: left; margin: 20px 0; }
.cat-test-review-header { margin-bottom: 16px; }
.cat-test-review-header h3 { font-size: 1rem; font-weight: 700; color: #dc2626; margin-bottom: 4px; }
.cat-test-review-header p { font-size: 0.85rem; color: var(--text-secondary); }

.cat-test-review-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
    animation: pageIn 0.3s var(--ease-out);
}
.cat-test-review-item.wrong-item { border-left: 3px solid #ef4444; }
.cat-test-review-item.correct-item { border-left: 3px solid #10b981; }

.cat-test-review-num {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.wrong-item .cat-test-review-num { background: #fef2f2; color: #dc2626; }
.correct-item .cat-test-review-num { background: #ecfdf5; color: #059669; }

.cat-test-review-body { flex: 1; min-width: 0; }
.cat-test-review-q { font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; line-height: 1.5; }
.cat-test-review-wrong-answer,
.cat-test-review-right-answer { font-size: 0.85rem; margin-bottom: 4px; padding: 6px 10px; border-radius: 6px; }
.cat-test-review-wrong-answer { background: #fef2f2; }
.cat-test-review-right-answer { background: #ecfdf5; }
.cat-test-label-wrong { color: #dc2626; font-weight: 600; margin-right: 4px; }
.cat-test-label-right { color: #059669; font-weight: 600; margin-right: 4px; }
.cat-test-review-expl { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.65; margin-top: 10px; padding: 10px 12px; background: var(--bg-secondary); border-radius: 8px; }
.cat-test-review-time { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 6px; }
.cat-test-time { font-size: 0.7rem; color: var(--text-tertiary); margin-left: 8px; }
.cat-test-review-a { font-size: 0.85rem; color: var(--text-secondary); }

.cat-test-perfect { padding: 40px; background: #ecfdf5; border-radius: var(--radius-lg); margin: 24px 0; text-align: center; }
.cat-test-perfect-icon { font-size: 3rem; margin-bottom: 12px; }
.cat-test-perfect h3 { color: #059669; font-size: 1.3rem; margin-bottom: 8px; }
.cat-test-perfect p { color: #065f46; }

.cat-test-recommendation {
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin: 20px 0;
    text-align: left;
}
.cat-test-recommendation h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.cat-test-recommendation p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

.cat-test-q-number {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

@media (max-width: 640px) {
    .cat-test-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.cat-test-actions { display: flex; justify-content: center; margin-top: 20px; }
.cat-test-retry {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
    background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
}
.cat-test-retry:hover { background: var(--border-color); }

/* Better mobile sidebar animation */
@media (max-width: 1024px) {
    .bib-sidebar {
        transition: transform 0.35s var(--ease-out);
        box-shadow: none;
    }
    .bib-sidebar.open {
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.15);
    }
}

/* ============================================
   BUY ME A COFFEE
   ============================================ */

/* Floating coffee button */
.floating-coffee {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #ffdd00;
    color: #1a1a2e;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255, 221, 0, 0.3), 0 2px 6px rgba(0,0,0,0.1);
    z-index: 900;
    transition: all var(--duration-normal) var(--ease-out);
    text-decoration: none;
    animation: coffeeIn 0.6s 1s var(--ease-out) both;
}

.floating-coffee:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 24px rgba(255, 221, 0, 0.4), 0 4px 12px rgba(0,0,0,0.12);
}

.floating-coffee svg {
    flex-shrink: 0;
}

@keyframes coffeeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hide text on small screens */
@media (max-width: 640px) {
    .floating-coffee-text {
        display: none;
    }
    .floating-coffee {
        padding: 14px;
        border-radius: 50%;
    }
}

/* CTA section coffee button */
.cta-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-coffee {
    background: #ffdd00;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(255, 221, 0, 0.3);
}

.btn-coffee:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 221, 0, 0.4);
    filter: brightness(1.05);
}

/* Avoid overlap with bib sidebar toggle */
@media (max-width: 1024px) {
    .floating-coffee {
        bottom: 24px;
        left: 24px;
    }
}

[data-theme="dark"] .floating-coffee {
    background: #ffdd00;
    color: #1a1a2e;
}

[data-theme="dark"] .btn-coffee {
    background: #ffdd00;
    color: #1a1a2e;
}
