
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);   /* Indigo → Violet */
    --secondary-gradient: linear-gradient(135deg, #06b6d4, #3b82f6); /* Cyan → Blue */
    --accent-gradient: linear-gradient(135deg, #f43f5e, #ef4444);    /* Rose → Red */
    --text-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);      /* Blue → Violet */

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);

    /* Shadows (simplified levels) */
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.18);

    --text-glow: 0 0 10px rgba(255, 255, 255, 0.5);
    --font-size-base: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(199, 210, 254, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(251, 207, 232, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(191, 219, 254, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #fdf2f8 0%, #eff6ff 50%, #ecfeff 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Vendor prefixes + tiny inconsistencies (harmless) */
.cta-button {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -ms-transform: translateZ(0);
}

.subject-card {
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

/* Legacy float demo (kept small) */
.legacy-teasers { margin: 2rem 0; }
.legacy-teasers .box { float:left; width: 48%; margin: 1%; background: rgba(255,255,255,0.15); padding: 1rem; border-radius: 12px; }
.legacy-teasers::after { content: ""; display: table; clear: both; }

/* Footer (intentionally simple inline usage in HTML as well) */
.site-footer { border-top: 1px solid rgba(255,255,255,0.15); }

/* Kid Mode Theme (brighter, bigger, friendlier) */
.kid-mode {
    --primary-gradient: linear-gradient(135deg, #34d399 0%, #10b981 50%, #22d3ee 100%);
    --secondary-gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
    --glass-bg: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(255, 255, 255, 0.35);
    --font-size-base: 18px;
   
}

.kid-mode .hero h1 { font-size: 4rem; }
.kid-mode .subject-icon { font-size: 4rem; }
.kid-mode .tab-button,
.kid-mode .run-button,
.kid-mode .cta-button { font-size: 1.1rem; }
.kid-mode .nav-links a { font-size: 1.05rem; }
.kid-mode .achievement-badge { transform: scale(1.05); }
.kid-mode .code-editor textarea { font-size: 16px; }

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: sparkle 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes sparkle {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-200px) rotate(360deg); }
}

.header {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-soft);
    border-radius: 0 0 20px 20px;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}
.logout-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-gradient);
  }
  
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4c51bf, #ec4899, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: var(--text-glow);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: var(--primary-gradient);
    border-radius: 10px;
    opacity: 0.1;
    z-index: -1;
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.1; transform: scale(1); }
    100% { opacity: 0.3; transform: scale(1.05); }
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    position: relative;
    z-index: 2;
}

.nav-toggle {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: rgba(255,255,255,0.9);
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
}

.auth-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #1e293b; /* dark slate instead of semi-transparent white */
    font-weight: 600;
    transition: color 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid transparent; /* simpler effect */
}
.nav-links a:hover { color: #0f172a; border-bottom-color: #3b82f6; /* match secondary gradient */ }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.hero {
    text-align: center;
    padding: 4rem 0;
    color: white;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
    50% { transform: translate(-50%, -50%) translateY(-20px); }
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}
.title-solid { color:#0b0b0b; text-shadow:none; -webkit-text-fill-color: initial; }
.kid-mode .title-solid { color:#111827; }

@keyframes glow {
    0% { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3)); }
    100% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6)); }
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cta-button {
    background: var(--primary-gradient);
    color: white;
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-hover);
    text-shadow: var(--text-glow);
}

.dashboard {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 2.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.dashboard::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotate 10s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.progress-widget { display:flex; align-items:center; justify-content:center; }
.progress-ring { position: relative; width:120px; height:120px; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring .ring-bg { fill:none; stroke:#e5e7eb; stroke-width:10; }
.progress-ring .ring-fg { fill:none; stroke:#93c5fd; stroke-linecap: round; stroke-width:10; stroke-dasharray: 327; stroke-dashoffset: 90; transition: stroke-dashoffset 0.6s ease; }
.progress-ring .ring-label { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:700; color:#374151; }
.prog-programming { background: var(--primary-gradient); }
.prog-math { background: var(--secondary-gradient); }
.prog-physics { background: var(--accent-gradient); }

.rank-badge { display:inline-block; background:#e0e7ff; color:#1f2937; padding:0.5rem 0.85rem; border-radius:999px; font-weight:700; }

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0.1;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.stat-card:hover::before {
    opacity: 0.2;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 255, 255, 0.4);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.subject-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.subject-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(50%, -50%);
    transition: all 0.3s ease;
}

.subject-card:hover::after {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
}

.subject-card:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 255, 255, 0.4);
}

.subject-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    height: 12px;
    margin: 1rem 0;
    overflow: hidden;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill {
    height: 100%;
    border-radius: 15px;
    background: var(--secondary-gradient);
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 1.5s ease-in-out infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.code-editor {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    color: #eee;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.code-editor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(90deg, #ff5f56, #ffbd2e, #27ca3f);
    border-radius: 15px 15px 0 0;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.code-editor textarea {
    width: 100%;
    height: 200px;
    background: transparent;
    border: none;
    color: #eee;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
    margin-top: 20px;
}

.challenge-section {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 2rem 0;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.challenge-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Challenge layout inspired by GitHub/LeetCode with personal twists */
.challenge-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.challenge-sidebar { display:block; }
.sidebar-card { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,0,0,0.05); border-radius: 12px; padding: 0.85rem; }
.tag-cloud { display:flex; flex-wrap: wrap; gap: 6px; }
.tag { background:#e9d5ff; color:#3b0764; border-radius:999px; padding: 0.25rem 0.6rem; font-size: 12px; }

.problem-cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.problem-card { background: rgba(255,255,255,0.7); border:1px solid rgba(0,0,0,0.06); border-radius: 14px; padding: 0.9rem; display:flex; flex-direction:column; justify-content:space-between; }
.pc-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 0.5rem; }
.pc-title { font-weight:700; color:#111827; }
.pc-diff { text-transform:uppercase; font-weight:800; font-size: 11px; padding: 0.2rem 0.5rem; border-radius: 999px; }
.pc-diff.easy { background:#d1fae5; color:#065f46; }
.pc-diff.medium { background:#fef3c7; color:#92400e; }
.pc-diff.hard { background:#fee2e2; color:#991b1b; }
.pc-meta { display:flex; align-items:center; justify-content:space-between; }
.pc-lang { font-weight:700; color:#374151; }
.pc-solved { color:#374151; font-size:13px; }
.pc-try { background:#a7f3d0; color:#065f46; border:none; padding: 0.45rem 0.8rem; border-radius: 10px; cursor:pointer; font-weight:700; }
.pc-try.alt { background:#bfdbfe; color:#1e3a8a; }

.difficulty {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.difficulty::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.difficulty:hover::before {
    left: 100%;
}

.easy { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); 
    color: #065f46; 
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.medium { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); 
    color: #92400e; 
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.hard { 
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); 
    color: #991b1b; 
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.run-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.run-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.run-button:hover::before {
    left: 100%;
}

.run-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.leaderboard {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 2rem 0;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.leaderboard-item:hover { background: rgba(255, 255, 255, 0.5); }

.clearfix::after { content: ""; display: table; clear: both; }
.u-mt-13 { margin-top: 13px; }
.u-pl-7 { padding-left: 7px; }
.u-mb-11 { margin-bottom: 11px; }

.rank {
    font-weight: 700;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.3rem;
}

.hidden {
    display: none;
}

.tab-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-button {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--secondary-gradient);
    transition: left 0.3s ease;
    z-index: -1;
}

.tab-button.active::before,
.tab-button:hover::before {
    left: 0;
}

.tab-button.active,
.tab-button:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.achievement-badge {
    background: var(--secondary-gradient);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.25rem;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.achievement-badge:hover::before {
    left: 100%;
}

.achievement-badge:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

/* Enhanced responsive design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .nav-toggle { display: inline-block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        right: 1rem;
        flex-direction: column;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        padding: 1rem;
        border-radius: 12px;
        backdrop-filter: blur(12px);
        width: calc(100% - 2rem);
        left: 1rem;
    }
    .nav-links.open { display: flex; }
    
    .container {
        padding: 1rem;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .subject-card:hover {
        transform: translateY(-5px);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* (Removed modal styles) */

.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.profile-avatar {
    width: 120px;
    height: 120px;
    background: var(--primary-gradient);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
  }
  