/* ============================================================
   Kroatisch Lernen -- Purple/Blue Glassmorphism Theme
   ============================================================ */

:root {
    --brand: #7c3aed;
    --brand-light: #a78bfa;
    --brand-dark: #6d28d9;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.25);
    --page-bg: #f5f3ff;
    --glow-1: rgba(124, 58, 237, 0.35);
    --glow-2: rgba(99, 102, 241, 0.3);
}

[data-bs-theme="dark"] {
    --glass-bg: rgba(30, 22, 55, 0.72);
    --glass-border: rgba(124, 58, 237, 0.2);
    --page-bg: #0c0818;
    --glow-1: rgba(124, 58, 237, 0.25);
    --glow-2: rgba(99, 102, 241, 0.2);
}

body {
    background: var(--page-bg);
    transition: background 0.4s ease;
}

/* === Gradient Text === */
.text-gradient {
    background: linear-gradient(135deg, var(--brand-light), var(--accent-light), #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-value {
    background: linear-gradient(135deg, var(--brand-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-gradient-link {
    background: linear-gradient(135deg, var(--brand-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    font-weight: 600;
}

.text-gradient-link:hover {
    filter: brightness(1.2);
}

/* === App Shell === */
.app-shell {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.app-logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--bs-body-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-logo i {
    color: var(--brand-light);
    font-size: 1rem;
}

.app-logo:hover {
    color: var(--bs-body-color);
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--bs-body-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    opacity: 0.7;
}

.app-icon-btn:hover {
    opacity: 1;
    background: rgba(124, 58, 237, 0.08);
    border-color: var(--brand-light);
    color: var(--bs-body-color);
}

.app-content {
    padding-bottom: 40px;
}

.app-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--brand-light);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    margin-bottom: 16px;
    transition: opacity 0.15s;
}

.app-back-btn:hover {
    opacity: 0.7;
}

/* === Dashboard === */
.dash-greeting h3 {
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.dash-greeting {
    margin-bottom: 28px;
}

.dash-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-light);
    margin-bottom: 12px;
}

.dash-pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.dash-pkg {
    padding: 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash-pkg:hover {
    transform: translateY(-3px);
    border-color: var(--brand-light) !important;
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.12);
}

.dash-pkg-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dash-pkg-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--brand-light);
}

.dash-pkg-desc {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    margin-bottom: 12px;
    line-height: 1.4;
}

/* === Kapitel-Grid === */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.chapter-item {
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter-item:hover {
    transform: translateY(-3px);
    border-color: var(--brand-light) !important;
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.12);
}

.chapter-item.ch-done { border-color: rgba(34, 197, 94, 0.3) !important; }
.chapter-item.ch-done:hover { border-color: #22c55e !important; box-shadow: 0 8px 28px rgba(34, 197, 94, 0.12); }
.chapter-item.ch-started { border-color: rgba(245, 158, 11, 0.3) !important; }
.chapter-item.ch-started:hover { border-color: #f59e0b !important; box-shadow: 0 8px 28px rgba(245, 158, 11, 0.1); }

.chapter-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chapter-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--brand-light);
}

.chapter-item-body {
    margin-bottom: 10px;
}

/* === Modusauswahl === */
.mode-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-light) !important;
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.12);
}

.mode-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.1);
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--brand-light);
}

/* === Quiz === */
.quiz-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.quiz-progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-progress-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-light);
    white-space: nowrap;
}

.exercise-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.quiz-done {
    text-align: center;
    padding: 32px 0;
}

.quiz-done i {
    font-size: 2.5rem;
    color: var(--brand-light);
    margin-bottom: 12px;
    display: block;
}

/* === Glass-Effekt === */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.glass-card:hover {
    box-shadow:
        0 8px 40px rgba(124, 58, 237, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-badge {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: var(--brand-light);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* === Brand === */
.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-glow {
    text-shadow: 0 0 20px var(--glow-1);
}

/* === Glow Button === */
.btn-glow {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 28px;
    font-weight: 600;
    box-shadow: 0 4px 20px var(--glow-1);
    transition: all 0.3s ease;
}

.btn-glow:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--glow-1), 0 0 60px var(--glow-2);
}

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

/* ============================================================
   Welcome / Landing Page
   ============================================================ */

.welcome-page {
    overflow-x: hidden;
}

/* Animated Background Orbs */
.welcome-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: orb-float 20s ease-in-out infinite;
}

[data-bs-theme="light"] .orb {
    opacity: 0.25;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.6), transparent 70%);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.5), transparent 70%);
    top: 50%;
    right: -10%;
    animation-delay: -7s;
    animation-duration: 25s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.4), transparent 70%);
    bottom: -5%;
    left: 30%;
    animation-delay: -14s;
    animation-duration: 22s;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(30px, 40px) scale(1.02); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

[data-bs-theme="dark"] .grid-overlay {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.06) 1px, transparent 1px);
}

/* Hero */
.welcome-main {
    position: relative;
    z-index: 1;
}

.welcome-hero {
    padding-top: 60px;
    padding-bottom: 80px;
}

.min-vh-75 {
    min-height: 75vh;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.7;
    opacity: 0.75;
    max-width: 480px;
    margin-top: 16px;
}

.hero-features {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.hero-feature i {
    color: var(--brand-light);
    font-size: 1.1rem;
}

/* Auth Card */
.auth-card {
    padding: 0;
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.auth-tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    position: relative;
}

.auth-tab:hover {
    opacity: 0.8;
}

.auth-tab.active {
    opacity: 1;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    border-radius: 99px;
}

.auth-form {
    padding: 28px;
}

.auth-header {
    margin-bottom: 20px;
}

.auth-header h3 {
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.auth-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

/* Glass Input */
.glass-input {
    background: rgba(124, 58, 237, 0.04) !important;
    border: 1px solid var(--glass-border) !important;
    border-left: none !important;
    border-radius: 0 12px 12px 0 !important;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.glass-input:focus {
    background: rgba(124, 58, 237, 0.08) !important;
    border-color: var(--brand-light) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
}

.glass-input-icon {
    background: rgba(124, 58, 237, 0.08) !important;
    border: 1px solid var(--glass-border) !important;
    border-right: none !important;
    border-radius: 12px 0 0 12px !important;
    color: var(--brand-light);
}

/* Features Section */
.welcome-features {
    padding: 80px 0;
}

.section-title {
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15);
}

.feature-icon-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(99, 102, 241, 0.15));
}

.feature-icon {
    font-size: 1.5rem;
    color: var(--brand-light);
}

/* Stats Teaser */
.welcome-stats {
    padding: 40px 0 60px;
}

/* ============================================================
   App (index.php) Styles
   ============================================================ */

/* === Stat-Cards === */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.1);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.55;
    margin-top: 4px;
}

.streak-glow {
    animation: glow-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(167, 139, 250, 0.3); }
    50% { box-shadow: 0 0 28px rgba(167, 139, 250, 0.6); }
}

/* === Fortschrittsbalken === */
.progress {
    border-radius: 99px;
    overflow: hidden;
    background: var(--glass-border);
}

.progress-bar {
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(90deg, var(--brand), var(--accent)) !important;
}

/* === Uebungskarte === */
.exercise-card {
    position: relative;
    overflow: hidden;
}

.card-enter {
    animation: card-slide-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes card-slide-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.empty-icon {
    font-size: 3.5rem;
    opacity: 0.25;
    color: var(--brand-light);
}

.question-text {
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 500;
}

/* === Antwort-Optionen === */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 576px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .options-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-features {
        flex-direction: column;
        gap: 10px;
    }
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid rgba(124, 58, 237, 0.2);
    border-radius: 14px;
    background: transparent;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--bs-body-color);
}

.option-btn:hover:not(.disabled) {
    border-color: var(--brand-light);
    background: rgba(124, 58, 237, 0.06);
    transform: translateY(-1px);
}

.option-btn.selected {
    border-color: var(--brand);
    background: rgba(124, 58, 237, 0.1);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.option-btn.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: pop 0.3s ease;
}

.option-btn.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    animation: shake 0.4s ease;
}

.option-btn.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.option-btn.disabled:not(.correct):not(.wrong):not(.selected) {
    opacity: 0.4;
}

.option-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.1);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    color: var(--brand-light);
}

.option-btn.selected .option-number {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
}

.option-btn.correct .option-number {
    background: #22c55e;
    color: white;
}

.option-btn.wrong .option-number {
    background: #ef4444;
    color: white;
}

/* === Animationen === */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* === Konfetti === */
.confetti-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: 0;
    animation: confetti-fall 1.2s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(300px) rotate(720deg) scale(0.3);
    }
}

/* === Tastatur-Badges === */
kbd {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.8rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* === Buttons (Bootstrap Override) === */
.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border: none;
    box-shadow: 0 2px 12px var(--glow-1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    box-shadow: 0 4px 20px var(--glow-1);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--brand-light);
    border-color: var(--brand-light);
}

.btn-outline-primary:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--brand);
    color: var(--brand-light);
}

.btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border-color: var(--brand);
    color: #fff;
}

/* === Alerts === */
.alert {
    border-radius: 14px;
    border: none;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

[data-bs-theme="dark"] .alert-success {
    color: #86efac;
}

[data-bs-theme="dark"] .alert-danger {
    color: #fca5a5;
}

/* === Admin-Panel === */
.admin-section {
    padding: 20px;
    margin-bottom: 16px;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-decoration: none;
    opacity: 0.5;
    transition: all 0.15s ease;
}

.admin-tab:hover {
    opacity: 0.8;
    background: rgba(124, 58, 237, 0.06);
    color: var(--bs-body-color);
}

.admin-tab.active {
    opacity: 1;
    background: rgba(124, 58, 237, 0.1);
    color: var(--brand-light);
}

.admin-select-row {
    margin-bottom: 16px;
}

.admin-exercise-card {
    padding: 16px;
    margin-bottom: 12px;
}

.admin-ex-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-ex-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(124, 58, 237, 0.1);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--brand-light);
}

.admin-ex-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-ex-opts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.admin-ex-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-inline-form {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.admin-list-item:last-child {
    border-bottom: none;
}

/* === Modals === */
.modal-content.glass-card {
    box-shadow: 0 16px 70px rgba(0, 0, 0, 0.3);
}

/* === Form Controls (dark theme) === */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.25);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background: rgba(124, 58, 237, 0.12);
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

[data-bs-theme="dark"] .form-select option {
    background: #1c1434;
    color: #e2e8f0;
}

/* Stat-Cards etwas heller im Dark Mode */
[data-bs-theme="dark"] .stat-card {
    background: rgba(35, 25, 65, 0.8);
    border-color: rgba(124, 58, 237, 0.18);
}

/* Glass-Cards besser sichtbar */
[data-bs-theme="dark"] .glass-card {
    background: rgba(28, 20, 52, 0.78);
    border-color: rgba(124, 58, 237, 0.18);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .glass-card:hover {
    box-shadow:
        0 8px 40px rgba(124, 58, 237, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.2);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.35);
}

/* === Responsive === */
@media (max-width: 768px) {
    .stat-value {
        font-size: 1.25rem;
    }
    .question-text {
        font-size: 1.1rem;
    }
    .welcome-hero {
        padding-top: 30px;
        padding-bottom: 40px;
    }
    .section-title {
        font-size: 1.5rem;
    }
}

/* === Charts === */

/* Bar Chart */
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 120px;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.chart-bar-wrap {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.chart-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    min-height: 2px;
}

.chart-bar-total {
    background: rgba(124, 58, 237, 0.2);
}

.chart-bar-correct {
    background: var(--brand-light);
}

[data-bs-theme="light"] .chart-bar-total {
    background: rgba(124, 58, 237, 0.12);
}

.chart-bar-label {
    font-size: 0.65rem;
    color: var(--bs-secondary-color);
    margin-top: 4px;
    white-space: nowrap;
}

.chart-legend {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

.chart-legend-total {
    background: rgba(124, 58, 237, 0.25);
}

.chart-legend-correct {
    background: var(--brand-light);
}

/* Donut Chart */
.donut-chart {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        var(--color) calc(var(--pct) * 1%),
        rgba(124, 58, 237, 0.1) calc(var(--pct) * 1%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.donut-center {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--glass-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

[data-bs-theme="dark"] .donut-center {
    background: rgba(28, 20, 52, 0.95);
}

[data-bs-theme="light"] .donut-center {
    background: #fff;
}

/* === Card Hover === */
.card-hover {
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    border-color: var(--brand-light) !important;
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.18);
}

.card-hover:active {
    transform: translateY(-1px);
}

.card-hover.border-success:hover {
    border-color: #22c55e !important;
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.15);
}

.card-hover.border-warning:hover {
    border-color: #f59e0b !important;
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.12);
}

/* === Light-Mode Fixes === */
[data-bs-theme="light"] .progress {
    background: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .option-btn {
    border-color: rgba(124, 58, 237, 0.25);
    background: rgba(124, 58, 237, 0.03);
}

[data-bs-theme="light"] .option-btn:hover:not(.disabled) {
    background: rgba(124, 58, 237, 0.08);
    border-color: var(--brand);
}

[data-bs-theme="light"] .option-number {
    background: rgba(124, 58, 237, 0.12);
    color: var(--brand);
}

/* === Zuordnungsmodus (Matching) === */
.match-container {
    display: flex;
    gap: 24px;
}

.match-col {
    flex: 1;
    min-width: 0;
}

.match-col-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-light);
    margin-bottom: 10px;
    padding-left: 2px;
}

.match-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 2px solid rgba(124, 58, 237, 0.2);
    border-radius: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    color: var(--bs-body-color);
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.match-item .match-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(124, 58, 237, 0.1);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    color: var(--brand-light);
}

.match-item:hover:not(.is-matched):not(.is-correct):not(.is-wrong) {
    border-color: var(--brand-light);
    background: rgba(124, 58, 237, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.1);
}

.match-item.is-selected {
    border-color: var(--brand);
    background: rgba(124, 58, 237, 0.12);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.match-item.is-selected .match-num {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
}

.match-item.is-matched {
    border-color: var(--brand-light);
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.match-item.is-correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
    opacity: 1;
    pointer-events: none;
    animation: pop 0.3s ease;
}

.match-item.is-correct .match-num {
    background: #22c55e;
    color: #fff;
}

.match-item.is-wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
    opacity: 1;
    pointer-events: none;
    animation: shake 0.4s ease;
}

.match-item.is-wrong .match-num {
    background: #ef4444;
    color: #fff;
}

[data-bs-theme="light"] .match-item {
    border-color: rgba(124, 58, 237, 0.25);
    background: rgba(255, 255, 255, 0.85);
}

[data-bs-theme="dark"] .match-item {
    border-color: rgba(124, 58, 237, 0.25);
    background: rgba(30, 22, 55, 0.6);
}

@media (max-width: 576px) {
    .match-container {
        flex-direction: column;
        gap: 16px;
    }
}

/* === Nav Pills === */
.nav-pills .nav-link {
    color: var(--bs-body-color);
    opacity: 0.6;
    border-radius: 10px;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    opacity: 1;
}
