/* ==========================================================================
   Apple Developer Academy Prep 2026 - Modern Glassmorphism Design System
   ========================================================================== */

/* --- CSS Variables & Palettes --- */
:root {
    --bg-dark: #07090e;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --text-muted: #6e6e73;
    
    /* Category Accent Colors */
    --color-logic: #00ff88;
    --color-logic-glow: rgba(0, 255, 136, 0.15);
    
    --color-prog: #00d4ff;
    --color-prog-glow: rgba(0, 212, 255, 0.15);
    
    --color-design: #ff2a85;
    --color-design-glow: rgba(255, 42, 133, 0.15);
    
    --color-biz: #ff9e00;
    --color-biz-glow: rgba(255, 158, 0, 0.15);
    
    --color-mix: #a200ff;
    --color-mix-glow: rgba(162, 0, 255, 0.15);
    
    --color-success: #00ff88;
    --color-danger: #ff2a85;
}

/* --- Base Layout --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Ambient Background Glows --- */
.glow-bg {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.45;
}

.glow-bg-1 {
    top: 10%;
    left: 15%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(162, 0, 255, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    animation: floatGlow1 20s infinite alternate ease-in-out;
}

.glow-bg-2 {
    bottom: 15%;
    right: 10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    animation: floatGlow2 25s infinite alternate ease-in-out;
}

/* --- Header / Navigation --- */
.app-header {
    background: rgba(7, 9, 14, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    gap: 10px;
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 1.5rem;
}

.year-badge {
    background: linear-gradient(135deg, var(--color-prog), var(--color-mix));
    color: #000;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 4px;
}

.app-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link-danger {
    color: var(--color-design);
}
.nav-link-danger:hover {
    background: rgba(255, 42, 133, 0.15) !important;
    color: #ff559c !important;
}

/* --- Main Content Section --- */
.app-main {
    flex: 1;
    padding: 40px 0;
}

/* --- Footer --- */
.app-footer {
    border-top: 1px solid var(--card-border);
    padding: 24px 0;
    background: rgba(7, 9, 14, 0.9);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* --- Glassmorphic Container Panels --- */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Dashboard Section --- */
.welcome-banner {
    margin-bottom: 40px;
    text-align: center;
}

.welcome-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 30%, #a2a2a7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

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

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

.stat-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.05);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.1, 0.8, 0.2, 1);
}

/* Color Helpers */
.text-cyan { color: var(--color-prog); }
.text-green { color: var(--color-logic); }
.text-gold { color: var(--color-biz); }

.bg-cyan { background: var(--color-prog); }
.bg-green { background: var(--color-logic); }
.bg-gold { background: var(--color-biz); }

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Categories Deck */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.category-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.category-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

.category-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #000;
    font-weight: 700;
    margin-bottom: 20px;
}

.category-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.category-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex: 1;
}

.category-progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.category-progress-text span {
    font-weight: 600;
    color: var(--text-primary);
}

.category-accuracy {
    color: var(--color-logic) !important;
}

.category-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Category Borders & Colors */
.border-logic:hover { border-color: var(--color-logic); }
.glow-logic { background: var(--color-logic); }
.bg-logic { background: var(--color-logic); }
.btn-logic { background: var(--color-logic); color: #000; }
.btn-logic:hover { background: #33ffa0; box-shadow: 0 0 15px var(--color-logic-glow); }

.border-prog:hover { border-color: var(--color-prog); }
.glow-prog { background: var(--color-prog); }
.bg-prog { background: var(--color-prog); }
.btn-prog { background: var(--color-prog); color: #000; }
.btn-prog:hover { background: #4de3ff; box-shadow: 0 0 15px var(--color-prog-glow); }

.border-design:hover { border-color: var(--color-design); }
.glow-design { background: var(--color-design); }
.bg-design { background: var(--color-design); }
.btn-design { background: var(--color-design); color: #fff; }
.btn-design:hover { background: #ff559c; box-shadow: 0 0 15px var(--color-design-glow); }

.border-biz:hover { border-color: var(--color-biz); }
.glow-biz { background: var(--color-biz); }
.bg-biz { background: var(--color-biz); }
.btn-biz { background: var(--color-biz); color: #000; }
.btn-biz:hover { background: #ffb133; box-shadow: 0 0 15px var(--color-biz-glow); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

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

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-dark);
}
.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.btn-primary:disabled {
    background: var(--text-muted);
    color: rgba(255,255,255,0.3);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-icon-reset {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon-reset:hover {
    background: rgba(255, 42, 133, 0.15);
    color: var(--color-design);
    border-color: rgba(255, 42, 133, 0.3);
}

/* Mixed Banner */
.mix-banner {
    position: relative;
    padding: 32px;
    overflow: hidden;
    margin-bottom: 24px;
}

.mix-glow {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: var(--color-mix);
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}

.mix-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.mix-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mix-desc {
    color: var(--text-secondary);
    max-width: 700px;
    font-size: 0.95rem;
}

.btn-mix {
    background: var(--color-mix);
    color: #fff;
    padding: 12px 24px;
    font-size: 1rem;
}
.btn-mix:hover {
    background: #b52eff;
    box-shadow: 0 0 20px var(--color-mix-glow);
}

.border-mix:hover {
    border-color: var(--color-mix);
}

/* ==========================================================================
   Quiz Arena Section
   ========================================================================== */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.btn-back {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover {
    color: var(--text-primary);
}

.category-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
}

.question-tracker {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Quiz Question Card */
.quiz-card {
    padding: 36px;
    margin-bottom: 30px;
}

.question-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #000;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.question-text {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Code Snippet styling */
.code-snippet-wrapper {
    background: #0f1118;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
    overflow-x: auto;
}

.code-box {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    color: #c9d1d9;
    white-space: pre;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.option-btn {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.option-text {
    flex: 1;
    font-weight: 500;
}

/* Option States */
.option-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.option-btn.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-primary);
}

.option-btn.active .option-letter {
    background: var(--text-primary);
    color: var(--bg-dark);
    border-color: var(--text-primary);
}

.option-btn.correct {
    background: rgba(0, 255, 136, 0.08) !important;
    border-color: var(--color-success) !important;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.1);
}

.option-btn.correct .option-letter {
    background: var(--color-success) !important;
    color: #000 !important;
    border-color: var(--color-success) !important;
}

.option-btn.wrong {
    background: rgba(255, 42, 133, 0.08) !important;
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 15px rgba(255, 42, 133, 0.1);
}

.option-btn.wrong .option-letter {
    background: var(--color-danger) !important;
    color: #fff !important;
    border-color: var(--color-danger) !important;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

.quiz-action-bar {
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   Baby Explanation Panel
   ========================================================================== */
.explanation-panel {
    padding: 30px;
    margin-bottom: 40px;
    border-color: rgba(255, 255, 255, 0.12);
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    position: relative;
}

.baby-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-biz), var(--color-design));
    display: flex;
    align-items: center;
    justify-content: center;
}

.baby-icon {
    font-size: 1.25rem;
    color: #000;
}

.explanation-title-group {
    flex: 1;
}

.explanation-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
}

.explanation-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.result-badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.badge-danger {
    background: rgba(255, 42, 133, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(255, 42, 133, 0.3);
}

/* Accordion Stepper */
.explanation-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 20px;
}

/* Stepper vertical line */
.explanation-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 28px;
    bottom: 15px;
    width: 2px;
    background: rgba(255,255,255,0.06);
    z-index: 1;
}

.explanation-step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.step-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 4px;
}

.explanation-step-item:nth-child(even) .step-badge {
    background: rgba(0, 212, 255, 0.2);
    color: var(--color-prog);
}

.explanation-step-item:nth-child(odd) .step-badge {
    background: rgba(255, 158, 0, 0.2);
    color: var(--color-biz);
}

.step-text {
    color: #e5e5ea;
    font-size: 0.95rem;
    line-height: 1.6;
}

.step-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.explanation-paragraph-item {
    padding: 10px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.explanation-paragraph-item strong {
    color: var(--text-primary);
}

.inline-code {
    font-family: monospace;
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--color-prog);
}

.explanation-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}

.btn-next {
    background: var(--text-primary);
    color: var(--bg-dark);
    padding: 12px 24px;
    font-size: 0.95rem;
}
.btn-next:hover {
    background: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Visual Helpers & Diagrams
   ========================================================================== */
.visual-helper-box {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.visual-visualizer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.visual-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.visual-flow {
    display: flex;
    align-items: center;
    gap: 12px;
}

.visual-flow-columns {
    display: flex;
    gap: 40px;
    width: 100%;
    justify-content: space-around;
    padding: 10px 0;
}

.flow-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.col-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.visual-bubble {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    font-weight: 700;
    font-size: 0.9rem;
}

.visual-bubble.highlight {
    background: rgba(0, 255, 136, 0.1);
    color: var(--color-success);
    border-color: rgba(0, 255, 136, 0.3);
}

.visual-bubble.highlight-logic {
    background: rgba(0, 255, 136, 0.1);
    color: var(--color-logic);
    border-color: rgba(0, 255, 136, 0.3);
}

.visual-bubble.highlight-prog {
    background: rgba(0, 212, 255, 0.1);
    color: var(--color-prog);
    border-color: rgba(0, 212, 255, 0.3);
}

.visual-arrow {
    color: var(--text-muted);
    font-weight: bold;
}

/* Venn Diagram representation */
.venn-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px 0;
}

.venn-outer {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.venn-label-outer {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    position: absolute;
    top: 15px;
}

.venn-inner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--color-logic);
    background: rgba(0, 255, 136, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.venn-label-inner {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-logic);
    text-align: center;
    padding: 0 10px;
}

/* Code trace table */
.visual-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 400px;
}

.visual-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.visual-table td:nth-child(2) {
    color: var(--text-muted);
}

/* Array map table */
.visual-array-table {
    border-collapse: collapse;
    margin: 10px 0;
}

.visual-array-table th, .visual-array-table td {
    border: 1px solid rgba(255,255,255,0.08);
    padding: 8px 12px;
    text-align: center;
}

.visual-array-table th {
    background: rgba(255,255,255,0.03);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.target-header {
    background: rgba(0, 212, 255, 0.1) !important;
    color: var(--color-prog) !important;
}

.target-cell {
    background: rgba(0, 212, 255, 0.2) !important;
    color: var(--color-prog) !important;
    border-color: rgba(0, 212, 255, 0.4) !important;
}

/* Capsule diagrams */
.concept-capsule {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 320px;
    overflow: hidden;
}

.capsule-part {
    padding: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.capsule-part.inside {
    background: rgba(0,0,0,0.3);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
}

.capsule-part.outside {
    background: rgba(0, 212, 255, 0.1);
    color: var(--color-prog);
}

/* Comparison row */
.comparison-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 0;
}

.comp-box {
    flex: 1;
    max-width: 200px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comp-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.comp-val {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.comp-vs {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--color-design);
    font-size: 1.1rem;
}

/* BMC visual block */
.bmc-mockup-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 60px);
    gap: 6px;
    width: 100%;
    max-width: 400px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.bmc-block {
    grid-column: span 1;
    grid-row: span 1;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.6rem;
    padding: 4px;
    text-align: center;
}

.active-block {
    grid-column: 2 / span 2;
    grid-row: 1 / span 2;
    background: rgba(255, 158, 0, 0.15) !important;
    border-color: var(--color-biz) !important;
    color: var(--color-biz) !important;
    font-weight: 700;
    font-size: 0.75rem;
}

.active-block i {
    font-size: 1rem;
    margin-bottom: 4px;
}

/* ==========================================================================
   Completed Screen (Score / Final Report)
   ========================================================================== */
.completed-arena {
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.completed-glow {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-prog), var(--color-mix));
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
}

.completed-icon {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--color-prog), var(--color-mix));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
}

.completed-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.completed-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 36px;
}

.score-display {
    display: flex;
    justify-content: center;
    margin-bottom: 36px;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid var(--color-prog);
    box-shadow: 0 0 25px var(--color-prog-glow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Outfit', sans-serif;
}

#score-percentage {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completed-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.completed-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
}

.text-pink {
    color: var(--color-design);
}

.completed-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.text-center {
    text-align: center;
}

/* ==========================================================================
   Animations & Transitions
   ========================================================================== */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Glow Correct Answer */
@keyframes pulseGlowCorrect {
    0% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.3), inset 0 0 15px rgba(0, 255, 136, 0.1); }
    100% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25); }
}

.pulse-correct {
    animation: pulseGlowCorrect 1s ease;
}

/* Wobble Wrong Answer */
@keyframes wobbleWrong {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

.wobble-wrong {
    animation: wobbleWrong 0.6s ease;
}

/* Background floating glow animations */
@keyframes floatGlow1 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(60px, -40px) scale(1.1);
    }
}

@keyframes floatGlow2 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(-70px, 50px) scale(0.95);
    }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .category-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-icon-reset {
        width: 100%;
        padding: 10px 0;
    }

    .mix-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .quiz-card {
        padding: 24px;
    }
    
    .option-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .completed-stats {
        gap: 20px;
    }
}

/* --- Riwayat Belajar & Jawaban --- */
.history-section {
    margin-top: 54px;
    margin-bottom: 54px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.history-item {
    padding: 22px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 16px;
}

.history-item-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 280px;
}

.history-question-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.history-question {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.history-timestamp {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.history-item-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.history-answers {
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.history-answers strong {
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Expanded Explanation inside History */
.history-explain-panel {
    width: 100%;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--card-border);
    display: none;
    animation: slideInUp 0.3s ease forwards;
}

/* --- History Tab Filters --- */
.history-tabs-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.history-tab {
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', sans-serif;
}

.history-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.history-tab.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Category Specific Active Tabs */
.history-tab.active[data-cat="logic"] {
    border-color: var(--color-logic);
    color: var(--color-logic);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
}
.history-tab.active[data-cat="programming"] {
    border-color: var(--color-prog);
    color: var(--color-prog);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}
.history-tab.active[data-cat="design"] {
    border-color: var(--color-design);
    color: var(--color-design);
    box-shadow: 0 0 12px rgba(255, 42, 133, 0.15);
}
.history-tab.active[data-cat="business"] {
    border-color: var(--color-biz);
    color: var(--color-biz);
    box-shadow: 0 0 12px rgba(255, 158, 0, 0.15);
}

/* ==========================================================================
   Academy & Learning Modules Section
   ========================================================================== */
.academy-banner {
    background: radial-gradient(135deg, rgba(0, 212, 255, 0.03) 0%, rgba(162, 0, 255, 0.03) 100%);
    border: 1px solid var(--card-border);
    padding: 30px;
    border-radius: 16px;
}

.module-workspace {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    align-items: flex-start;
}

.module-sidebar {
    width: 320px;
    padding: 24px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.sidebar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chapters-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chapter-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    align-items: center;
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.chapter-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.chapter-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
}

.chapter-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-primary);
}

.chapter-item.active .chapter-num {
    background: var(--text-primary);
    color: var(--bg-dark);
}

.chapter-item.active .chapter-title {
    color: var(--text-primary);
}

/* Category Specific Active Chapters in Sidebar */
.border-logic .chapter-item.active { border-color: var(--color-logic); }
.border-logic .chapter-item.active .chapter-num { background: var(--color-logic); color: #000; }
.border-logic .chapter-item.active .chapter-title { color: var(--color-logic); }

.border-prog .chapter-item.active { border-color: var(--color-prog); }
.border-prog .chapter-item.active .chapter-num { background: var(--color-prog); color: #000; }
.border-prog .chapter-item.active .chapter-title { color: var(--color-prog); }

.border-design .chapter-item.active { border-color: var(--color-design); }
.border-design .chapter-item.active .chapter-num { background: var(--color-design); color: #fff; }
.border-design .chapter-item.active .chapter-title { color: var(--color-design); }

.border-biz .chapter-item.active { border-color: var(--color-biz); }
.border-biz .chapter-item.active .chapter-num { background: var(--color-biz); color: #000; }
.border-biz .chapter-item.active .chapter-title { color: var(--color-biz); }

.module-content-area {
    flex: 1;
    padding: 36px;
    min-height: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.chapter-content {
    display: none;
}

.chapter-content.active {
    display: block;
}

.lesson-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 40%, #a2a2a7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lesson-intro {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

/* Custom Alert Boxes inside Lessons */
.baby-box, .formula-box, .tips-box {
    padding: 24px;
    border-radius: 14px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.baby-box {
    background: rgba(255, 158, 0, 0.03);
    border: 1px solid rgba(255, 158, 0, 0.15);
    border-left: 4px solid var(--color-biz);
}

.baby-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.baby-box-header h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--color-biz);
    font-size: 1rem;
}

.baby-box-icon {
    font-size: 1.1rem;
    color: var(--color-biz);
}

.baby-box p {
    color: #e5e5ea;
    font-size: 0.95rem;
    line-height: 1.6;
}

.formula-box {
    background: rgba(0, 212, 255, 0.03);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-left: 4px solid var(--color-prog);
}

.formula-box h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--color-prog);
    font-size: 1.05rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.formula-box ul, .formula-box ol {
    margin-left: 20px;
    color: #e5e5ea;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tips-box {
    background: rgba(0, 255, 136, 0.03);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-left: 4px solid var(--color-logic);
}

.tips-box h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--color-logic);
    font-size: 1.05rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-box p {
    color: #e5e5ea;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tips-box ul {
    margin-left: 20px;
    color: #e5e5ea;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsiveness for modules */
@media (max-width: 992px) {
    .module-workspace {
        flex-direction: column;
        align-items: stretch;
    }
    
    .module-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }
    
    .chapters-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .chapter-item {
        flex-shrink: 0;
        min-width: 200px;
    }
}


