/* ============================================
   CodCraft — Complete Design System
   Premium White/Light Theme
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    /* Background colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.85);
    --bg-input: #f1f5f9;
    --bg-code: #0f172a;
    --bg-page: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.45);
    --bg-glass-hover: rgba(255, 255, 255, 0.65);

    /* Accent colors */
    --accent-cyan: #06b6d4;
    --accent-purple: #7c3aed;
    --accent-pink: #ec4899;
    --accent-blue: #2563eb;
    --accent-indigo: #4f46e5;

    /* Status colors */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.15);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.15);

    /* Text colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-accent: #0284c7;

    /* Borders */
    --border-subtle: rgba(226, 232, 240, 0.8);
    --border-medium: rgba(203, 213, 225, 0.9);
    --border-focus: rgba(124, 58, 237, 0.4);
    --border-glass: rgba(255, 255, 255, 0.6);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #06b6d4, #7c3aed);
    --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-cool: linear-gradient(135deg, #3b82f6, #7c3aed);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 15px rgba(124, 58, 237, 0.15);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 0.12s ease;
    --transition-base: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* ---- Decorative Background ---- */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: url('../images/coding-bg.png') center/cover no-repeat fixed;
    opacity: 0.08;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    animation: orbFloat 25s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: #bfdbfe;
    top: -15%;
    right: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #ddd6fe;
    bottom: -15%;
    left: -10%;
    animation-delay: -8s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: #c7d2fe;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -16s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -50px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

/* ---- Main Container ---- */
.main-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Navigation ---- */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
    transition: all var(--transition-base);
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    margin-left: 2.5rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.nav-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation to X */
.nav-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.nav-brand:hover {
    transform: scale(1.02);
}

.nav-logo {
    font-size: 1.75rem;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(6, 182, 212, 0.3));
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 850;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.05);
}

.nav-link.active {
    color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.08);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 15%;
    width: 70%;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
    transition: transform var(--transition-fast);
}

.nav-avatar:hover {
    transform: rotate(15deg) scale(1.08);
}


.nav-username {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
    transition: var(--transition-bounce);
    text-decoration: none;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.96) translateY(0) !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.35);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-input);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1.1rem;
}

.btn-ghost:hover {
    color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.05);
}

.btn-lg { padding: 0.9rem 2.2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-bounce);
}

.card:hover {
    border-color: var(--border-medium);
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

/* ---- Form Inputs ---- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
}

.input-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.input-field {
    padding: 0.8rem 1.1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    outline: none;
}

.input-field::placeholder {
    color: var(--text-muted);
}


.input-field:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
    background: white;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .input-field {
    width: 100%;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-base);
    z-index: 2;
}

.password-toggle:hover {
    color: var(--accent-cyan);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* ---- Auth Page ---- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: radial-gradient(circle at 0% 0%, rgba(6, 182, 212, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 100% 100%, rgba(124, 58, 237, 0.04) 0%, transparent 40%),
                var(--bg-page);
    position: relative;
    overflow: hidden;
}

.auth-container {
    width: 100%;
    max-width: 460px;
    animation: fadeInUp 0.6s ease;
    z-index: 2;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    display: block;
    animation: pulse 2.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.25));
}

.auth-title {
    font-size: 2.25rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.04em;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.auth-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transition: var(--transition-bounce);
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), 0 0 25px rgba(124, 58, 237, 0.22);
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.auth-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: none;
    flex-direction: column;
}

.auth-form.active {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-error {
    display: none;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    animation: shake 0.4s ease;
}

.auth-error.show { display: block; }

.auth-success {
    display: none;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    color: var(--success);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auth-success.show { display: block; }

/* ---- Dashboard ---- */
.dashboard-content {
    padding: 2.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-welcome {
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.6s ease;
    display: flex;
    align-items: center;
    gap: 3rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(241, 245, 249, 0.5) 100%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 2.5rem 3rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.dashboard-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-welcome-text { flex: 1; z-index: 1; }

.dashboard-hero-img {
    width: 180px;
    height: auto;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    z-index: 1;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.06));
    animation: floatIllustration 4s ease-in-out infinite;
}

@keyframes floatIllustration {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.welcome-text {
    font-size: 0.95rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-purple);
    margin-bottom: 0.35rem;
}

.welcome-name {
    font-size: 2.25rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.stat-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-bounce);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 10px 15px -3px rgba(124, 58, 237, 0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.stat-icon.cyan { background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(6, 182, 212, 0.04)); color: var(--accent-cyan); }
.stat-icon.purple { background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.04)); color: var(--accent-purple); }
.stat-icon.pink { background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(236, 72, 153, 0.04)); color: var(--accent-pink); }
.stat-icon.green { background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.04)); color: var(--success); }
.stat-icon.orange { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05)); color: var(--warning); }

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

.stat-value {
    font-size: 1.6rem;
    font-weight: 850;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.stat-label {
    font-size: 0.82rem;

    color: var(--text-muted);
    font-weight: 500;
}

/* Level Cards */
.section-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.level-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
    transition: height var(--transition-base);
}

.level-card.beginner::before { background: var(--success); }
.level-card.intermediate::before { background: var(--warning); }
.level-card.pro::before { background: var(--error); }

.level-card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-medium);
}

.level-card:hover::before {
    height: 8px;
}


.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.level-badge.beginner {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.level-badge.intermediate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.level-badge.pro {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.level-badge.python {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.level-badge.c {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.level-badge.javascript {
    background: #fefbeb;
    color: #b45309;
    border: 1px solid #fef08a;
}

.level-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.level-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.level-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.level-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.level-meta-item span { font-size: 1rem; }

.level-languages {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.lang-tag {
    padding: 0.25rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.level-best-score {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.level-best-score strong {
    color: var(--accent-cyan);
    font-weight: 700;
}

/* ---- MNC Section ---- */
.mnc-section {
    margin-top: 2.5rem;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.mnc-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.mnc-header-img {
    width: 120px;
    height: auto;
    border-radius: var(--radius-lg);
}

.mnc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.mnc-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.mnc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-subtle);
    transition: all var(--transition-base);
}

.mnc-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 8px 20px rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.3);
}

.mnc-card:hover::before {
    background: var(--gradient-primary);
    height: 4px;
}

.mnc-card-icon {
    font-size: 2.25rem;
    margin-bottom: 0.6rem;
    display: block;
    transition: transform var(--transition-fast);
}

.mnc-card:hover .mnc-card-icon {
    transform: scale(1.12) rotate(-5deg);
}

.mnc-card-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.mnc-card-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ---- Challenge Page ---- */
.challenge-content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.challenge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    animation: fadeInUp 0.4s ease;
}

.challenge-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.challenge-level-badge {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.challenge-progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.challenge-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.challenge-timer.warning {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
    background: #fffbeb;
    animation: timerPulse 1s ease-in-out infinite;
}

.challenge-timer.danger {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
    background: #fef2f2;
    animation: timerPulse 0.5s ease-in-out infinite;
}

/* Time Bonus Toast */
.time-bonus-toast {
    position: fixed;
    top: 5rem;
    right: 2rem;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #86efac;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    color: #16a34a;
    font-size: 0.95rem;
    z-index: 999;
    animation: slideInRight 0.4s ease, fadeOut 0.4s ease 1.5s forwards;
    box-shadow: var(--shadow-md);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.4);
}

/* Question Card */
.question-card {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
    animation: fadeInUp 0.5s ease;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.question-lang-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.question-lang-tag.python {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.question-lang-tag.c {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.question-lang-tag.java {
    background: rgba(236, 72, 153, 0.1);
    color: #db2777;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.question-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Company badge for MNC questions */
.company-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(124, 58, 237, 0.08);
    color: var(--accent-purple);
    border: 1px solid rgba(124, 58, 237, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* simulated macOS-style developer IDE window */
.editor-window {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 2rem;
    overflow: hidden;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    user-select: none;
}

.editor-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-close { background: #ef4444; }
.dot-minimize { background: #f59e0b; }
.dot-maximize { background: #10b981; }

.editor-tab-title {
    color: #94a3b8;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 600;
}

.editor-lang-badge {
    background: rgba(124, 58, 237, 0.25);
    color: #c4b5fd;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

.code-block {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 1.5rem !important;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.7;
    color: #f8fafc;
    overflow-x: auto;
}

/* Code syntax highlighting */
.hl-keyword { color: #f472b6; font-weight: 600; }
.hl-string { color: #34d399; }
.hl-comment { color: #64748b; font-style: italic; }
.hl-number { color: #fbbf24; }
.hl-operator { color: #38bdf8; }
.hl-type { color: #818cf8; font-weight: 600; }


/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: left;
    line-height: 1.4;
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    background: white;
    border-color: var(--accent-cyan);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.option-btn.wrong {
    background: rgba(239, 68, 68, 0.06);
    border-color: var(--error);
}

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

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all var(--transition-base);
}

.option-btn.correct .option-letter { background: var(--success); color: white; }
.option-btn.wrong .option-letter { background: var(--error); color: white; }

.option-text {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    white-space: pre-wrap;
}

/* Hint & Feedback */
.challenge-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.hint-section { flex: 1; }

.hint-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    color: #b45309;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.hint-btn:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.15);
    transform: translateY(-1px);
}

.hint-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Reveal Answer Button */
.reveal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #dc2626;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.reveal-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.12);
    transform: translateY(-1px);
}

.reveal-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hint-text {
    display: none;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-md);
    color: #92400e;
    font-size: 0.85rem;
    line-height: 1.5;
    animation: fadeInUp 0.3s ease;
}

.hint-text.show { display: block; }

.feedback-container {
    display: none;
    margin-top: 1.25rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    animation: fadeInUp 0.4s ease;
}

.feedback-container.show { display: block; }

.feedback-container.correct {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.feedback-container.wrong {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feedback-header.correct { color: var(--success); }
.feedback-header.wrong { color: var(--error); }

.feedback-explanation {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Score Modal */
.score-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.score-overlay.show { display: flex; }

.score-modal {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: scoreReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl), 0 25px 50px -12px rgba(124, 58, 237, 0.1);
}

.score-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
}

.score-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease infinite;
    display: inline-block;
}

.score-title {
    font-size: 1.75rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.score-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.score-circle {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.75rem;
    position: relative;
}

.score-circle svg {
    transform: rotate(-90deg);
    width: 140px;
    height: 140px;
}

.score-circle-bg {
    fill: none;
    stroke: var(--bg-input);
    stroke-width: 8;
}

.score-circle-fill {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 408;
    stroke-dashoffset: 408;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}

.score-circle-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    font-weight: 600;
}

.score-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 2.25rem;
}

.score-detail-item {
    padding: 0.85rem 0.75rem;
    background: rgba(248, 250, 252, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-bounce);
}

.score-detail-item:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, 0.3);
    background: white;
    box-shadow: var(--shadow-sm);
}

.score-detail-value {
    font-size: 1.25rem;
    font-weight: 850;
    color: var(--text-primary);
    line-height: 1.2;
}

.score-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-actions {
    display: flex;
    gap: 0.75rem;
}

/* ---- Compiler Page ---- */
.compiler-content {
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.compiler-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.compiler-select {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

.compiler-select:focus {
    border-color: var(--accent-cyan);
}

.compiler-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 500px;
}

.compiler-editor-panel,
.compiler-output-panel {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compiler-output {
    flex: 1;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    overflow-y: auto;
    min-height: 200px;
    background: #1e293b;
    color: #e2e8f0;
}

.stdin-input {
    padding: 0.75rem 1rem;
    border: none;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
}

.stdin-input:focus {
    background: white;
}

/* ---- Progress Page ---- */
.progress-content {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.progress-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease;
}

.progress-title {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

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

.xp-card {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.xp-level-name {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.xp-level-name.bronze { color: #b45309; }
.xp-level-name.silver { color: #6b7280; }
.xp-level-name.gold { color: #d97706; }
.xp-level-name.platinum { color: #7c3aed; }

.xp-value {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.xp-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    margin-top: 1rem;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.xp-bar-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Skills bar */
.skill-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.skill-name {
    width: 80px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.skill-track {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.skill-fill.python { background: #3b82f6; }
.skill-fill.c-lang { background: #6366f1; }
.skill-fill.java { background: #ec4899; }

.skill-percent {
    width: 40px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

/* ---- Empty States ---- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state-text { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-secondary); }
.empty-state-subtext { font-size: 0.85rem; }

/* ---- Loader ---- */
.loader {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader.show { display: inline-block; }

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideInRight 0.4s ease;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.toast.success {
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
}

.toast.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.toast.info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* ---- Confirm Dialog ---- */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1001;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.confirm-overlay.show { display: flex; }

.confirm-dialog {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: scoreReveal 0.3s ease;
}

.confirm-dialog h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.confirm-dialog p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav { padding: 0.6rem 1.25rem; position: relative; }
    .nav-title { font-size: 1.1rem; }
    .nav-toggle { display: flex; }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
        padding: 1.5rem 1.25rem;
        gap: 1.25rem;
        z-index: 99;
        margin-left: 0;
        align-items: stretch;
    }
    
    .nav-menu.active {
        display: flex;
        animation: navSlideDown 0.25s ease forwards;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
    }
    
    .nav-link {
        display: block;
        text-align: center;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    .nav-user {
        width: 100%;
        justify-content: center;
        border-top: 1px solid rgba(226, 232, 240, 0.8);
        padding-top: 1.25rem;
        margin-top: 0.25rem;
        gap: 0.75rem;
    }
    
    .nav-username {
        display: inline;
        font-size: 0.9rem;
    }
    
    .nav-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    @keyframes navSlideDown {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .dashboard-content,
    .challenge-content,
    .progress-content { padding: 1.25rem 1rem; }

    .dashboard-welcome { flex-direction: column; text-align: center; padding: 2rem 1.5rem; gap: 1.5rem; }
    .dashboard-hero-img { width: 140px; }
    .welcome-name { font-size: 1.75rem; }
    .welcome-subtitle { font-size: 0.9rem; }

    .stats-row { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 2rem; }
    .stat-card { padding: 1rem; gap: 0.75rem; }
    .stat-value { font-size: 1.35rem; }
    .stat-icon { width: 42px; height: 42px; font-size: 1.2rem; }

    .levels-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .level-card { padding: 1.75rem 1.5rem; }
    .level-title { font-size: 1.35rem; }
    
    .mnc-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .mnc-card { padding: 1.25rem 1rem; }
    .mnc-card-icon { font-size: 1.8rem; }

    .auth-container { max-width: 100%; }
    .auth-card { padding: 2rem 1.5rem; }
    .auth-title { font-size: 1.75rem; }

    .challenge-header { gap: 0.75rem; }
    .question-card { padding: 1.5rem 1.25rem; }
    .question-text { font-size: 0.95rem; }
    .code-block { padding: 1rem !important; font-size: 0.85rem !important; }
    .editor-tab-title { font-size: 0.75rem; }
    .editor-lang-badge { font-size: 0.6rem; }
    .option-btn { padding: 0.8rem 1rem; font-size: 0.9rem; }
    .option-letter { width: 24px; height: 24px; font-size: 0.75rem; }
    .option-text { font-size: 0.85rem; }

    .score-modal { padding: 2.25rem 1.5rem; }
    .score-circle { width: 120px; height: 120px; }
    .score-circle svg { width: 120px; height: 120px; }
    .score-circle-text { font-size: 1.75rem; }
    .score-details { grid-template-columns: 1fr; gap: 0.5rem; }
    .score-detail-item { padding: 0.6rem; }
    .score-actions { flex-direction: column; gap: 0.5rem; }

    .mnc-header { flex-direction: column; text-align: center; gap: 1rem; }
    .mnc-header-img { width: 100px; }
}

@media (max-width: 580px) {
    .stats-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .nav { padding: 0.5rem 0.75rem; }
    .nav-brand { gap: 0.4rem; }
    .nav-logo { font-size: 1.4rem; }
    .nav-title { font-size: 0.95rem; }
    .nav-link { padding: 0.35rem 0.5rem; font-size: 0.75rem; }
    
    .dashboard-welcome { padding: 1.5rem 1rem; }
    .welcome-name { font-size: 1.5rem; }
    .welcome-subtitle { font-size: 0.85rem; }
    .dashboard-hero-img { width: 110px; }

    .stats-row { grid-template-columns: 1fr; }
    
    .level-meta { flex-direction: column; gap: 0.4rem; }
    .auth-tabs { flex-direction: column; }
    .auth-tab { padding: 0.5rem; }
    .mnc-grid { grid-template-columns: 1fr 1fr; }
    
    .editor-tab-title { display: none; } /* Hide filename to prevent overlaps */
    .editor-header { padding: 0.6rem 0.85rem; }
    .code-block { padding: 0.85rem !important; font-size: 0.78rem !important; }
}

/* ---- Footer Branding ---- */
.footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-sans);
}

.footer-logo {
    font-size: 1.2rem;
    margin-bottom: 0.15rem;
    opacity: 0.85;
}

.footer-text {
    margin: 0;
    font-weight: 500;
}

.footer-link {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: var(--transition-fast);
}

.footer-link::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1.5px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent-purple);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.footer-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.footer-link:hover {
    color: var(--accent-cyan);
}

/* ---- Curriculum Roadmap & Resume Banner ---- */
.resume-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md), 0 0 15px rgba(124, 58, 237, 0.05);
    animation: fadeInUp 0.6s ease;
}

.resume-info {
    flex: 1;
}

.resume-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-purple);
    margin-bottom: 0.5rem;
}

.resume-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.resume-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.resume-btn {
    flex-shrink: 0;
}

.curriculum-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3.5rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.module-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-bounce);
}

.module-card:hover {
    border-color: rgba(124, 58, 237, 0.15);
    box-shadow: var(--shadow-md);
}

.module-header {
    margin-bottom: 1.5rem;
}

.module-header h3 {
    font-size: 1.3rem;
    font-weight: 850;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.module-lessons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1rem;
}

.lesson-card {
    background: white;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-bounce);
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.lesson-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.lesson-title-row {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lesson-card.completed {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.02);
}

.lesson-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.lesson-card.active {
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.12);
    background: rgba(124, 58, 237, 0.01);
}

.lesson-card:hover:not(.locked) {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.lesson-card.active:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.2);
}

.lesson-status-icon {
    font-size: 1.25rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.lesson-status-icon.check {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.lesson-status-icon.lock {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
}

.lesson-status-icon.play {
    background: rgba(124, 58, 237, 0.12);
    color: var(--accent-purple);
    animation: pulsePlay 1.5s infinite;
}

@keyframes pulsePlay {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@media (max-width: 768px) {
    .resume-banner {
        flex-direction: column;
        padding: 1.75rem 1.5rem;
        gap: 1.25rem;
        text-align: center;
    }
    .resume-btn {
        width: 100%;
    }
    .module-card {
        padding: 1.5rem 1.25rem;
    }
    .module-lessons {
        grid-template-columns: 1fr;
    }
}
