/* --- CSS Variables --- */
:root {
    --primary: #00B894;
    --primary-dark: #009678;
    --primary-light: rgba(0, 184, 148, 0.1);
    --secondary: #0F172A;
    --accent: #2563EB;
    --accent-light: rgba(37, 99, 235, 0.1);
    
    /* Gamification Colors */
    --gold: #F59E0B;
    --xp-color: #8B5CF6;
    --success: #10B981;
    
    /* Light Theme */
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --nav-bg: rgba(255, 255, 255, 0.85);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --modal-bg: rgba(255, 255, 255, 0.95);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(0, 184, 148, 0.3);
    
    /* Layout */
    --max-width: 1400px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;
    
    /* Transitions */
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0B0F19;
    --surface: #151E2E;
    --surface-hover: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --nav-bg: rgba(21, 30, 46, 0.85);
    --glass-bg: rgba(21, 30, 46, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --modal-bg: rgba(21, 30, 46, 0.95);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);
}

/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

/* Language Specific Fonts & Fixes */
body { font-family: 'Inter', sans-serif; background-color: var(--bg); color: var(--text-main); line-height: 1.6; overflow-x: hidden; transition: background-color 0.4s ease, color 0.4s ease; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', sans-serif; color: var(--text-main); line-height: 1.2; }

[lang="hi"] body { font-family: 'Noto Sans Devanagari', 'Inter', sans-serif; }
[lang="hi"] h1, [lang="hi"] h2, [lang="hi"] h3, [lang="hi"] h4 { font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif; }

[lang="gu"] body { font-family: 'Noto Sans Gujarati', 'Inter', sans-serif; }
[lang="gu"] h1, [lang="gu"] h2, [lang="gu"] h3, [lang="gu"] h4 { font-family: 'Noto Sans Gujarati', 'Poppins', sans-serif; }

[lang="ar"] body { font-family: 'Noto Sans Arabic', 'Inter', sans-serif; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4 { font-family: 'Noto Sans Arabic', 'Poppins', sans-serif; }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; background: none; font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* Accessibility */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

/* --- Loader --- */
#loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg); z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.6s ease; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--primary-light); border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Typography Helpers --- */
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; }
.text-center { text-align: center; }
.section-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.section-subtitle { font-size: 1.125rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 3rem; }

/* --- Layout --- */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 5%; }
section { padding: 6rem 0; position: relative; }

/* --- UI Components --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.875rem 1.75rem; border-radius: var(--radius-pill); font-weight: 600; transition: var(--transition); white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-secondary { background: var(--surface); color: var(--text-main); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-hover); transform: translateY(-2px); border-color: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }

.glass-card { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: var(--radius-md); box-shadow: var(--glass-shadow); }
.tag { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.75rem; border-radius: var(--radius-pill); background: var(--primary-light); color: var(--primary); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-beginner { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.badge-intermediate { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.badge-advanced { background: rgba(239, 68, 68, 0.1); color: #EF4444; }

/* --- Header & Navigation --- */
header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; transition: var(--transition); padding: 1rem 0; }
header.scrolled { background: var(--nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--glass-border); padding: 0.75rem 0; box-shadow: var(--shadow-sm); }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: 'Poppins', sans-serif; font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; }
.logo i { color: var(--primary); font-size: 1.75rem; }

.desktop-nav { display: none; }
.desktop-nav ul { display: flex; gap: 2rem; align-items: center; }
.desktop-nav a { font-weight: 500; font-size: 0.95rem; transition: var(--transition); }
.desktop-nav a:hover { color: var(--primary); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.25rem; background: var(--surface); color: var(--text-main); border: 1px solid var(--border); transition: var(--transition); position: relative; }
.icon-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.badge-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: #EF4444; border-radius: 50%; }

/* Language Dropdown */
.lang-selector { position: relative; display: inline-block; }
.lang-btn { display: flex; align-items: center; gap: 0.5rem; background: var(--surface); border: 1px solid var(--border); padding: 0.4rem 0.75rem; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 500; cursor: pointer; color: var(--text-main); transition: var(--transition); }
.lang-btn:hover { border-color: var(--primary); }
.lang-dropdown { position: absolute; top: calc(100% + 5px); right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 150px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transition-fast); z-index: 100; overflow: hidden; }
.lang-selector:hover .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-dropdown button { display: flex; align-items: center; width: 100%; gap: 0.75rem; padding: 0.75rem 1rem; font-size: 0.9rem; color: var(--text-main); transition: var(--transition-fast); text-align: left; }
.lang-dropdown button:hover { background: var(--surface-hover); color: var(--primary); }
.lang-dropdown button.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* Gamification & Global Header Elements */
.gamification-stats { display: none; align-items: center; gap: 1rem; background: var(--surface); padding: 0.35rem 1rem; border-radius: var(--radius-pill); border: 1px solid var(--border); }
.stat-badge { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; }
.stat-badge.streak { color: var(--gold); }
.stat-badge.xp { color: var(--xp-color); }

/* --- Global Universal Search (Cmd+K) Modal --- */
.search-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px); z-index: 2000; display: flex; justify-content: center; align-items: flex-start; padding-top: 10vh; opacity: 0; visibility: hidden; transition: var(--transition-fast); }
.search-modal-overlay.active { opacity: 1; visibility: visible; }
.search-modal { width: 100%; max-width: 700px; background: var(--modal-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--glass-border); overflow: hidden; transform: scale(0.95) translateY(-20px); transition: var(--transition-fast); }
.search-modal-overlay.active .search-modal { transform: scale(1) translateY(0); }

.search-modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; }
.search-modal-header i { font-size: 1.5rem; color: var(--text-muted); }
.search-modal-header input { flex: 1; background: transparent; border: none; font-size: 1.25rem; color: var(--text-main); font-family: 'Inter'; outline: none; }
.search-modal-header kbd { font-family: monospace; background: var(--surface-hover); border: 1px solid var(--border); padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; color: var(--text-muted); }

.search-tabs { display: flex; gap: 1rem; padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--surface-hover); overflow-x: auto; scrollbar-width: none; }
.search-tab { font-size: 0.85rem; font-weight: 600; padding: 0.4rem 0.8rem; border-radius: var(--radius-pill); cursor: pointer; color: var(--text-muted); transition: var(--transition-fast); white-space: nowrap; }
.search-tab.active { background: var(--primary); color: #fff; }

.search-results { max-height: 400px; overflow-y: auto; padding: 1rem; }
.search-group-title { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); margin: 1rem 0 0.5rem 0.5rem; letter-spacing: 0.5px; }
.search-result-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; border-radius: var(--radius-md); cursor: pointer; transition: var(--transition-fast); }
.search-result-item:hover { background: var(--surface-hover); }
.search-result-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: flex; justify-content: center; align-items: center; font-size: 1.25rem; }
.search-result-content flex { flex-direction: column; }
.search-result-title { font-weight: 600; font-size: 1rem; color: var(--text-main); }
.search-result-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 0.5rem; align-items: center; }

/* --- Floating Format Switcher --- */
.format-switcher-wrapper { position: sticky; top: 72px; z-index: 990; background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0.75rem 0; transform: translateY(-100%); transition: var(--transition); opacity: 0; pointer-events: none; }
.format-switcher-wrapper.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
.format-list { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.25rem; }
.format-btn { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; color: var(--text-muted); transition: var(--transition-fast); white-space: nowrap; }
.format-btn:hover { background: var(--surface-hover); color: var(--text-main); }
.format-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* --- RTL OVERRIDES (Arabic/Urdu) --- */
[dir="rtl"] .nav-actions { margin-right: auto; margin-left: 0; }
[dir="rtl"] .logo { margin-left: auto; margin-right: 0; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .lang-dropdown button { text-align: right; }
[dir="rtl"] .search-icon { left: auto; right: 1.25rem; }
[dir="rtl"] .search-bar { padding: 1.25rem 3.5rem 1.25rem 1.5rem; text-align: right; }
[dir="rtl"] .category-card::before, [dir="rtl"] .explore-card::before { transform-origin: right; }
[dir="rtl"] .course-bookmark { left: auto; right: 1rem; }
[dir="rtl"] .course-type { right: auto; left: 1rem; }
[dir="rtl"] .ai-chat-window { right: auto; left: 2rem; transform-origin: bottom left; }
[dir="rtl"] .floating-action-group { right: auto; left: 2rem; }
[dir="rtl"] .ai-msg.system { border-bottom-left-radius: var(--radius-md); border-bottom-right-radius: 4px; }
[dir="rtl"] .ai-msg.user { border-bottom-right-radius: var(--radius-md); border-bottom-left-radius: 4px; }
[dir="rtl"] .search-trigger input { padding-left: 1.5rem; padding-right: 3.5rem; }
[dir="rtl"] .search-trigger i { left: auto !important; right: 1.25rem; }

/* --- Hero Section --- */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 6rem; position: relative; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); z-index: -1; animation: float 10s infinite ease-in-out alternate; }
.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--primary-light); }
.blob-2 { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background: var(--accent-light); animation-delay: -5s; }
@keyframes float { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(30px, 50px) scale(1.1); } }

.hero-content { text-align: center; position: relative; z-index: 10; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 800; margin-bottom: 1.5rem; letter-spacing: -1px; line-height: 1.1; }
.hero p { font-size: clamp(1.125rem, 2vw, 1.25rem); color: var(--text-muted); margin-bottom: 3rem; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

/* --- Personal Dashboard --- */
.personal-dashboard { padding: 4rem 0 2rem; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.pd-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.5rem; display: flex; align-items: center; gap: 1.5rem; box-shadow: var(--shadow-sm); transition: var(--transition); }
.pd-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.pd-icon { width: 50px; height: 50px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; }
.pd-icon.goal { background: rgba(37, 99, 235, 0.1); color: var(--accent); }
.pd-icon.streak { background: rgba(245, 158, 11, 0.1); color: var(--gold); }
.pd-icon.rank { background: rgba(139, 92, 246, 0.1); color: var(--xp-color); }
.pd-info h4 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.25rem; font-weight: 500; font-family: 'Inter'; }
.pd-info .val { font-size: 1.5rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 0.5rem; }
.pd-progress-wrap { width: 100%; height: 6px; background: var(--bg); border-radius: 3px; margin-top: 0.5rem; overflow: hidden; }
.pd-progress { height: 100%; background: var(--primary); border-radius: 3px; }

/* --- Netflix-style Continue Learning Hub --- */
.learning-hub { padding: 4rem 0; overflow: hidden; }
.row-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; }
.row-header h3 { font-size: 1.5rem; font-weight: 700; }
.scrolling-wrapper { display: flex; gap: 1.5rem; overflow-x: auto; padding-bottom: 2rem; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.scrolling-wrapper::-webkit-scrollbar { display: none; }

.course-card { min-width: 320px; background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; scroll-snap-align: start; transition: var(--transition); box-shadow: var(--shadow-sm); cursor: pointer; position: relative; display: flex; flex-direction: column; }
.course-card:hover { transform: scale(1.02) translateY(-5px); box-shadow: var(--shadow-lg); z-index: 10; }
.course-img { height: 180px; background: var(--border); position: relative; overflow: hidden; }
.course-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15,23,42,0.8) 0%, transparent 100%); }
.course-type { position: absolute; top: 1rem; right: 1rem; z-index: 2; background: rgba(0,0,0,0.6); color: #fff; padding: 0.3rem 0.8rem; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600; backdrop-filter: blur(4px); display: flex; align-items: center; gap: 0.35rem; border: 1px solid rgba(255,255,255,0.2); }
.course-bookmark { position: absolute; top: 1rem; left: 1rem; z-index: 2; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); color: #fff; display: flex; justify-content: center; align-items: center; font-size: 1.1rem; transition: var(--transition-fast); }
.course-bookmark:hover { background: var(--primary); }
.progress-bar { position: absolute; bottom: 0; left: 0; height: 4px; background: rgba(255,255,255,0.2); width: 100%; z-index: 2; }
.progress-fill { height: 100%; background: var(--primary); transition: width 1s ease-in-out; }
.course-info { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.course-info h4 { font-size: 1.125rem; margin-bottom: 0.5rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.course-meta-text { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.course-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border); }
.formats-available { display: flex; gap: 0.4rem; color: var(--text-muted); font-size: 1.1rem; }
.formats-available i:hover { color: var(--primary); }

/* --- Knowledge Dashboard (Categories) --- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; margin-top: 3rem; }
.category-card { background: var(--surface); border-radius: var(--radius-md); padding: 2rem; border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; overflow: hidden; display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; cursor: pointer; }
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.category-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); transform: scaleX(0); transform-origin: left; transition: var(--transition); }
.category-card:hover::before { transform: scaleX(1); }
.cat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.cat-icon { width: 60px; height: 60px; border-radius: 12px; background: var(--primary-light); color: var(--primary); display: flex; justify-content: center; align-items: center; font-size: 2rem; }
.cat-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.cat-count { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); background: var(--bg); padding: 0.25rem 0.6rem; border-radius: var(--radius-pill); }
.category-card h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.category-card p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-grow: 1; }
.sub-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.sub-tag { font-size: 0.8rem; background: var(--bg); padding: 0.25rem 0.75rem; border-radius: var(--radius-pill); border: 1px solid var(--border); color: var(--text-muted); transition: var(--transition); }
.category-card:hover .sub-tag { border-color: var(--primary-light); color: var(--text-main); }
.cat-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.cat-link { font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; transition: var(--transition); }
.cat-link:hover { gap: 0.75rem; color: var(--primary-dark); }

/* --- Knowledge Graph Preview --- */
.graph-section { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 5rem 0; overflow: hidden; }
.graph-container { position: relative; height: 300px; display: flex; justify-content: center; align-items: center; margin-top: 3rem; }
.node { position: absolute; background: var(--bg); border: 1px solid var(--border); padding: 0.75rem 1.25rem; border-radius: var(--radius-pill); font-weight: 600; font-size: 0.9rem; box-shadow: var(--shadow-sm); z-index: 2; transition: var(--transition); cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }
.node:hover { transform: scale(1.1); border-color: var(--primary); color: var(--primary); z-index: 10; box-shadow: var(--shadow-md); }
.node-center { width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; justify-content: center; align-items: center; font-size: 2rem; box-shadow: var(--shadow-glow); z-index: 5; animation: pulse 2s infinite; }
.graph-line { position: absolute; background: var(--border); height: 2px; z-index: 1; transform-origin: left center; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.4); } 70% { box-shadow: 0 0 0 20px rgba(0, 184, 148, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0); } }

/* --- Knowledge Statistics --- */
.stats-section { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3rem; text-align: center; }
.stat-item h2 { font-size: 3.5rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--text-main); }
.stat-item p { font-size: 1.125rem; color: var(--text-muted); font-weight: 500; }

/* Call to Action / Newsletter */
.newsletter { padding: 8rem 0; position: relative; }

/* --- Footer --- */
footer { background: var(--secondary); color: #F8FAFC; padding: 6rem 0 2rem; position: relative; overflow: hidden; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4rem; margin-bottom: 4rem; position: relative; z-index: 10; }
.footer-brand .logo { color: #fff; margin-bottom: 1.5rem; }
.footer-brand p { color: #94A3B8; margin-bottom: 1.5rem; }
.footer-socials { display: flex; gap: 1rem; }
.footer-socials a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; justify-content: center; align-items: center; transition: var(--transition); color: #fff; }
.footer-socials a:hover { background: var(--primary); transform: translateY(-3px); }

.footer-links h4 { color: #fff; margin-bottom: 1.5rem; font-size: 1.125rem; }
.footer-links ul { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-links a { color: #94A3B8; transition: var(--transition); }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem; display: flex; justify-content: space-between; align-items: center; color: #64748B; font-size: 0.875rem; flex-wrap: wrap; gap: 1rem; position: relative; z-index: 10; }

/* --- Floating Action Buttons (FAB Group) --- */
.floating-action-group {
    position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; gap: 1rem; z-index: 999;
}
.fab-btn {
    width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center; 
    font-size: 2rem; cursor: pointer; transition: var(--transition); border: 2px solid rgba(255,255,255,0.2); text-decoration: none;
}
.fab-btn:hover { transform: scale(1.1) rotate(5deg); }
.ai-fab { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: var(--shadow-lg), var(--shadow-glow); }
.game-fab { background: linear-gradient(135deg, #8B5CF6, #6D28D9); color: #fff; box-shadow: var(--shadow-lg), 0 0 20px rgba(139, 92, 246, 0.4); }

/* Heal AI Chat Window Adjustment */
.ai-chat-window { position: fixed; bottom: 10rem; right: 2rem; width: 350px; max-width: calc(100vw - 4rem); background: var(--modal-bg); backdrop-filter: blur(16px); border-radius: var(--radius-lg); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.95); transition: var(--transition); z-index: 998; overflow: hidden; transform-origin: bottom right; }
.ai-chat-window.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.ai-header { padding: 1rem 1.25rem; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.ai-body { padding: 1.25rem; height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; font-size: 0.9rem; }
.ai-msg { padding: 0.75rem 1rem; border-radius: var(--radius-md); max-width: 85%; }
.ai-msg.system { background: var(--surface-hover); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg.user { background: var(--primary-light); color: var(--primary-dark); align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-input-area { padding: 1rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; background: var(--surface); }
.ai-input { flex: 1; padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg); color: var(--text-main); outline: none; }
.ai-send { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; justify-content: center; align-items: center; border: none; cursor: pointer; }

/* Translation Missing Modal */
.translation-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); z-index: 3000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: var(--transition); }
.translation-modal-overlay.active { opacity: 1; visibility: visible; }
.translation-modal { background: var(--surface); padding: 2.5rem; border-radius: var(--radius-lg); max-width: 400px; text-align: center; box-shadow: var(--shadow-lg); transform: scale(0.9); transition: var(--transition); border: 1px solid var(--border); }
.translation-modal-overlay.active .translation-modal { transform: scale(1); }
.translation-modal i { font-size: 3rem; color: var(--gold); margin-bottom: 1rem; }
.translation-modal h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.translation-modal p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }

/* Mobile Premium Bottom Navigation */
.mobile-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border); z-index: 900; padding: 0.5rem 1rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}
.mbn-list { display: flex; justify-content: space-between; align-items: center; list-style: none; }
.mbn-item { flex: 1; text-align: center; }
.mbn-link { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; color: var(--text-muted); font-size: 0.7rem; font-weight: 500; transition: var(--transition-fast); }
.mbn-link i { font-size: 1.5rem; }
.mbn-link.active { color: var(--primary); }
.mbn-link.active i { font-family: "Phosphor-Fill", sans-serif; }

/* Skeleton Loading */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%); background-size: 200% 100%; animation: skeletonLoad 1.5s infinite; border-radius: 4px; }
@keyframes skeletonLoad { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Animations */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* --- EXPLORE PAGE SPECIFICS --- */
.explore-header { padding: 8rem 0 3rem 0; position: relative; }
.explore-title { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; margin-bottom: 1rem; letter-spacing: -1px; }
.explore-subtitle { font-size: 1.125rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }

.explore-grid-section { padding-bottom: 6rem; position: relative; z-index: 10; }
.explore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 2rem; }

.explore-card {
    background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 2rem;
    display: flex; flex-direction: column; transition: var(--transition); box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden; text-decoration: none; color: inherit; z-index: 1;
}

.explore-card::before {
    content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(var(--card-color-rgb), 0.03) 100%);
    z-index: -1; opacity: 0; transition: var(--transition);
}

.explore-card:hover { transform: translateY(-8px) scale(1.01); box-shadow: var(--shadow-lg), 0 20px 40px rgba(var(--card-color-rgb), 0.1); border-color: rgba(var(--card-color-rgb), 0.4); z-index: 10; }
.explore-card:hover::before { opacity: 1; }

.ec-header { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.5rem; }
.ec-icon { width: 72px; height: 72px; border-radius: var(--radius-md); display: flex; justify-content: center; align-items: center; font-size: 2.5rem; color: rgb(var(--card-color-rgb)); background: rgba(var(--card-color-rgb), 0.1); transition: var(--transition); flex-shrink: 0; }
.explore-card:hover .ec-icon { transform: scale(1.05) rotate(-5deg); background: rgb(var(--card-color-rgb)); color: #fff; box-shadow: 0 10px 20px rgba(var(--card-color-rgb), 0.3); }

.ec-info { flex-grow: 1; }
.ec-title { font-size: 1.35rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.25rem; font-family: 'Poppins', sans-serif; }
.ec-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; }

.ec-preview { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; flex-grow: 1; }
.ec-tag { background: var(--bg); border: 1px solid var(--border); padding: 0.3rem 0.8rem; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 500; color: var(--text-muted); transition: var(--transition-fast); }
.ec-tag-more { background: rgba(var(--card-color-rgb), 0.08); color: rgb(var(--card-color-rgb)); padding: 0.3rem 0.8rem; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 600; border: 1px solid transparent; }
.explore-card:hover .ec-tag { border-color: rgba(var(--card-color-rgb), 0.3); color: var(--text-main); }

.ec-action { display: flex; justify-content: space-between; align-items: center; padding-top: 1.25rem; border-top: 1px solid var(--border); font-weight: 600; font-size: 0.95rem; color: rgb(var(--card-color-rgb)); transition: var(--transition); }
.ec-action i { font-size: 1.25rem; transition: transform 0.3s ease; }
.explore-card:hover .ec-action { color: rgb(var(--card-color-rgb)); }
.explore-card:hover .ec-action i { transform: translateX(5px); }

.color-medical { --card-color-rgb: 0, 184, 148; }     /* Teal */
.color-edu { --card-color-rgb: 245, 158, 11; }        /* Amber */
.color-tech { --card-color-rgb: 236, 72, 153; }       /* Pink */
.color-fin { --card-color-rgb: 16, 185, 129; }        /* Emerald */
.color-bus { --card-color-rgb: 59, 130, 246; }        /* Blue */
.color-mkt { --card-color-rgb: 139, 92, 246; }        /* Purple */
.color-earn { --card-color-rgb: 20, 184, 166; }       /* Teal/Cyan */
.color-des { --card-color-rgb: 244, 63, 94; }         /* Rose */
.color-mind { --card-color-rgb: 14, 165, 233; }       /* Sky */
.color-lang { --card-color-rgb: 234, 179, 8; }        /* Yellow */
.color-books { --card-color-rgb: 99, 102, 241; }      /* Indigo */
.color-media { --card-color-rgb: 239, 68, 68; }       /* Red */
.color-res { --card-color-rgb: 132, 204, 22; }        /* Lime */
.color-feat { --card-color-rgb: 249, 115, 22; }       /* Orange */

/* --- Responsive --- */
@media (min-width: 1024px) {
    .desktop-nav { display: block; }
    .mobile-menu-btn { display: none; }
    .gamification-stats { display: flex; }
}
@media (max-width: 768px) {
    .hero { padding-top: 7rem; min-height: auto; padding-bottom: 4rem; }
    .explore-header { padding: 6rem 0 2rem 0; }
    .explore-grid { grid-template-columns: 1fr; }
    .floating-action-group { bottom: 5rem; right: 1.5rem; }
    [dir="rtl"] .floating-action-group { right: auto; left: 1.5rem; }
    .ai-chat-window { bottom: 13rem; right: 1rem; left: 1rem; width: auto; max-width: none; }
    [dir="rtl"] .ai-chat-window { right: 1rem; left: 1rem; }
    .mobile-bottom-nav { display: block; }
    body { padding-bottom: 70px; }
}