/* ===== SYNTAXLAB - LIGHT THEME WITH ENHANCED ANIMATIONS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf5 100%);
    color: #1a1a2e;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Floating Background Gradients */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 60%, rgba(236, 72, 153, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 30% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(168, 85, 247, 0.07) 0%, transparent 45%);
    pointer-events: none;
    z-index: -2;
    animation: slowFloat 20s ease-in-out infinite;
}

@keyframes slowFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    33% { transform: translate(2%, 1%) scale(1.02); opacity: 1; }
    66% { transform: translate(-1%, 2%) scale(0.98); opacity: 0.85; }
}

/* Animated Floating Icons in Background */
.background-icons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.08;
    animation: floatIcon 25s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(5deg); }
    50% { transform: translateY(20px) rotate(-5deg); }
    75% { transform: translateY(-10px) rotate(3deg); }
}

.floating-icon:nth-child(1) { top: 10%; left: 5%; animation-duration: 20s; font-size: 3rem; }
.floating-icon:nth-child(2) { top: 70%; left: 15%; animation-duration: 25s; animation-delay: 2s; }
.floating-icon:nth-child(3) { top: 30%; right: 8%; animation-duration: 22s; animation-delay: 4s; }
.floating-icon:nth-child(4) { bottom: 15%; right: 20%; animation-duration: 28s; animation-delay: 1s; }
.floating-icon:nth-child(5) { top: 85%; left: 70%; animation-duration: 18s; animation-delay: 3s; }
.floating-icon:nth-child(6) { top: 45%; left: 85%; animation-duration: 24s; animation-delay: 5s; }
.floating-icon:nth-child(7) { top: 15%; left: 45%; animation-duration: 30s; animation-delay: 0.5s; }
.floating-icon:nth-child(8) { bottom: 40%; left: 10%; animation-duration: 26s; animation-delay: 2.5s; }


/* Animated Bouncing Particles */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="10" cy="20" r="2" fill="rgba(99,102,241,0.3)"/><circle cx="85" cy="45" r="1.5" fill="rgba(236,72,153,0.25)"/><circle cx="50" cy="80" r="2.5" fill="rgba(6,182,212,0.2)"/><circle cx="30" cy="60" r="1.8" fill="rgba(168,85,247,0.2)"/><circle cx="75" cy="15" r="2.2" fill="rgba(99,102,241,0.2)"/></svg>');
    background-repeat: repeat;
    background-size: 80px 80px;
    pointer-events: none;
    z-index: -1;
    animation: floatParticles 35s linear infinite;
    opacity: 0.3;
}

@keyframes floatParticles {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-120px); }
}

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-area:hover {
    transform: scale(1.02);
}

.logo-icon {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.25);
    color: white;
    transition: all 0.3s ease;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 6px 15px rgba(99, 102, 241, 0.25); }
    50% { box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4); }
}

.logo-icon:hover {
    transform: rotate(5deg) scale(1.05);
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #4a4a6a;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
.hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    animation: fadeInUp 0.8s ease-out;
}

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

.hero h1 {
    font-size: 3.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 40%, #06b6d4 70%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    animation: gradientShift 4s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #5a5a7a;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SUBJECT CARDS SECTION ===== */
.subjects-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    color: #2d2d4a;
    position: relative;
}

.section-title i {
    color: #6366f1;
    margin-right: 10px;
    animation: titleIcon 1.5s ease-in-out infinite;
}

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

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

/* Language Card Styles - Enhanced Light Theme */
.lang-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    padding: 1.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.lang-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.12), transparent);
    transition: left 0.6s ease;
}

.lang-card:hover::before {
    left: 100%;
}

.lang-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #ec4899, #06b6d4);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.lang-card:hover::after {
    transform: scaleX(1);
}

.lang-card:hover {
    transform: translateY(-12px) scale(1.02);
    background: white;
    border-color: #6366f1;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.card-icon {
    font-size: 3.8rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

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

.lang-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #2d2d4a;
}

.lang-card p {
    color: #6a6a8a;
    font-size: 0.9rem;
}

/* Badge for new language */
.lang-card .new-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
    animation: badgePulse 1.5s ease infinite;
}

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

/* ===== LANGUAGE PAGE STYLES ===== */
.language-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.language-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.language-header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.language-header .intro {
    font-size: 1.1rem;
    color: #5a5a7a;
    max-width: 800px;
    margin: 0 auto;
}

/* Two Column Layout */
.content-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Sidebar Topics - Light */
.topics-sidebar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
}

.topics-sidebar h3 {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d2d4a;
}

.topic-list {
    list-style: none;
}

.topic-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a4a6a;
    font-weight: 500;
}

.topic-list li:hover {
    color: #6366f1;
    transform: translateX(8px);
}

.topic-list i {
    width: 24px;
    font-size: 0.9rem;
    color: #6366f1;
}

/* Progress Indicator - Enhanced */
.progress-wrapper {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
}

.progress-label {
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #5a5a7a;
    font-weight: 600;
}

.progress-percent {
    color: #6366f1;
    font-weight: 700;
}

.progress-bar {
    height: 8px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    width: 0%;
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.reset-progress {
    margin-top: 12px;
    text-align: center;
}

.reset-btn {
    background: transparent;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    color: #6366f1;
    transition: all 0.3s ease;
    font-weight: 500;
}

.reset-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    transform: scale(1.02);
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.topic-section {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eef2f6;
    transition: all 0.3s ease;
    scroll-margin-top: 100px;
}

.topic-section:last-child {
    border-bottom: none;
}

.topic-section.viewed {
    border-left: 4px solid #6366f1;
    padding-left: 20px;
    background: linear-gradient(90deg, rgba(99,102,241,0.03), transparent);
}

.topic-section h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #2d2d4a;
    font-weight: 700;
}

.topic-section p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #4a4a6a;
}

.code-block {
    background: #1e1e2e;
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    border-left: 4px solid #6366f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.code-block pre {
    color: #e2e2e2;
    font-size: 0.9rem;
    font-family: 'Fira Code', monospace;
}

/* Back Button */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white;
    padding: 12px 28px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.back-home:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    margin-top: 3rem;
    color: #6a6a8a;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.5);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .topics-sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .cards-grid {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .language-container {
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .lang-card {
        padding: 1.2rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
}