/* ============================================================
CSS VARIABLES & RESET
============================================================ */
:root {
    --bg-primary: #050d1a;
    --bg-secondary: #0a1628;
    --bg-card: rgba(10, 22, 40, 0.7);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --gold: #f0a500;
    --gold-light: #ffc94a;
    --gold-dim: rgba(240, 165, 0, 0.15);
    --text-primary: #e8f0fe;
    --text-secondary: #8899aa;
    --text-muted: #556677;
    --navbar-bg: rgba(5, 13, 26, 0.85);
    --sidebar-bg: rgba(8, 18, 34, 0.95);
    --shadow-gold: 0 0 20px rgba(240, 165, 0, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --accent-blue: #1e90ff;
    --accent-cyan: #00d4ff;
    --radius: 14px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #f0f4ff;
    --bg-secondary: #e4eaf8;
    --bg-card: rgba(255, 255, 255, 0.75);
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.9);
    --text-primary: #0d1b2a;
    --text-secondary: #445566;
    --text-muted: #889aaa;
    --navbar-bg: rgba(240, 244, 255, 0.88);
    --sidebar-bg: rgba(230, 238, 255, 0.97);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.4s, color 0.4s;
}

/* Animated background grid */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(240, 165, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 165, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] body::before {
    background-image:
        linear-gradient(rgba(240, 165, 0, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 165, 0, 0.06) 1px, transparent 1px);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

input {
    outline: none;
}

/* ============================================================
SCROLLBAR
============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

/* ============================================================
NAVBAR
============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--navbar-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    gap: 16px;
    transition: var(--transition);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.hamburger {
    background: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.hamburger:hover {
    background: var(--gold-dim);
    color: var(--gold);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.logo span:first-child {
    color: var(--text-primary);
}
.logo .logo-accent {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.nav-link {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    color: var(--gold);
    background: var(--gold-dim);
}

.search-wrap {
    flex: 1;
    max-width: 360px;
    position: relative;
}
.search-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
#searchInput {
    width: 100%;
    padding: 9px 16px 9px 36px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    transition: var(--transition);
}
#searchInput::placeholder {
    color: var(--text-muted);
}
#searchInput:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.1);
    background: var(--glass-hover);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.theme-toggle {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
}
.theme-toggle:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
}

.btn-login {
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text-primary);
    transition: var(--transition);
}
.btn-login:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-signup {
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0a0a0a;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(240, 165, 0, 0.3);
}
.btn-signup:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(240, 165, 0, 0.45);
}

/* ============================================================
SIDEBAR
============================================================ */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 900;
    overflow-y: auto;
    padding: 24px 0;
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed {
    transform: translateX(-240px);
}

.sidebar-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 20px 10px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}
.sidebar-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--gold-dim), transparent);
    opacity: 0;
    transition: var(--transition);
}
.sidebar-item:hover::after, .sidebar-item.active::after {
    opacity: 1;
}
.sidebar-item:hover, .sidebar-item.active {
    color: var(--gold);
    border-left-color: var(--gold);
}

.sidebar-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 12px 20px;
}

/* ============================================================
OVERLAY (mobile)
============================================================ */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 850;
    backdrop-filter: blur(4px);
}
.overlay.show {
    display: block;
}

/* ================== button que ================== */
.qa-block {
    background: #f9f9f9;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #00d4ff;
}
.sol-btn {
    background: #00d4ff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 8px;
}
.sol-btn:hover {
    background: #00b8e6;
}
.sol-div {
    margin-top: 10px;
    padding: 8px;
    background: #eef2f3;
    border-radius: 6px;
}
pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: monospace;
}

/* ============================================================
MAIN CONTENT
============================================================ */
.main {
    margin-left: 240px;
    margin-top: 70px;
    padding: 30px 24px;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}
.main.full {
    margin-left: 0;
}

/* ============================================================
HERO SECTION
============================================================ */
.hero {
    background: linear-gradient(135deg, rgba(240, 165, 0, 0.08) 0%, rgba(30, 144, 255, 0.06) 50%, transparent 100%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 52px 44px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(240, 165, 0, 0.12) 0%, transparent 70%);
    border-radius: 50%;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(30, 144, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-dim);
    border: 1px solid rgba(240, 165, 0, 0.3);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 50px;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}
.hero h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}
.hero h1 .highlight {
    background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.7;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}
.hero-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.hero-btn-primary {
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0a0a0a;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(240, 165, 0, 0.35);
}
.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(240, 165, 0, 0.5);
}
.hero-btn-secondary {
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    transition: var(--transition);
}
.hero-btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
}
.hero-stats {
    display: flex;
    gap: 36px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.stat-item {
    text-align: left;
}
.stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
SUBJECT SCROLL BAR
============================================================ */
.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.section-title-wrap h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.section-title-wrap .line {
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.subjects-scroll-wrap {
    position: relative;
    margin-bottom: 30px;
}
.subjects-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}
.subjects-scroll::-webkit-scrollbar {
    display: none;
}
.subject-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}
.subject-pill i {
    font-size: 0.9rem;
}
.subject-pill:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
    transform: translateY(-1px);
}
.subject-pill.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-color: transparent;
    color: #0a0a0a;
    box-shadow: 0 4px 15px rgba(240, 165, 0, 0.35);
}

/* ============================================================
CONTENT SECTIONS
============================================================ */
.content-section {
    margin-bottom: 44px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.section-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.section-icon.web { background: linear-gradient(135deg, #ff6b35, #f7931e); }
.section-icon.backend { background: linear-gradient(135deg, #1e90ff, #00d4ff); }
.section-icon.database { background: linear-gradient(135deg, #00b09b, #96c93d); }
.section-icon.cyber { background: linear-gradient(135deg, #eb3349, #f45c43); }
.section-icon.networking { background: linear-gradient(135deg, #8e44ad, #3498db); }

.section-header-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
}
.section-header-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* ============================================================
GLASS CARDS
============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 22px 20px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: var(--transition);
}
.card:hover {
    border-color: rgba(240, 165, 0, 0.35);
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold), var(--shadow-card);
}
.card:hover::before {
    opacity: 1;
}
.card.selected {
    border-color: var(--gold);
    background: rgba(240, 165, 0, 0.07);
    box-shadow: var(--shadow-gold);
}

.card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 14px;
}
.card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
}
.card-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    background: var(--gold-dim);
    color: var(--gold);
}
.card-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: var(--transition);
}
.card:hover .card-arrow {
    color: var(--gold);
    transform: translateX(3px);
}

/* Ripple */
.ripple-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(240, 165, 0, 0.2);
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
}
@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* ============================================================
LIVE CODE EDITOR
============================================================ */
.editor-section {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 44px;
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.editor-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
    gap: 12px;
}
.editor-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.editor-dots {
    display: flex;
    gap: 6px;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.editor-title {
    font-size: 0.9rem;
    font-weight: 700;
}
.editor-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.editor-tabs {
    display: flex;
    gap: 4px;
}
.editor-tab {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: var(--transition);
}
.editor-tab.active {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold);
}
.editor-tab:hover {
    color: var(--gold);
}

.editor-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 380px;
}
.editor-pane {
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}
.editor-pane-header {
    padding: 10px 16px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 8px;
}
#codeArea {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px;
    color: var(--text-primary);
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    resize: none;
    tab-size: 2;
}
#codeArea:focus { outline: none; }

.output-pane {
    display: flex;
    flex-direction: column;
}
.preview-iframe {
    flex: 1;
    border: none;
    background: white;
}

.editor-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
}
.editor-info {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-right: auto;
}
.btn-run {
    padding: 9px 22px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #28c840, #20a832);
    color: white;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(40, 200, 64, 0.3);
}
.btn-run:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(40, 200, 64, 0.45);
}
.btn-clear {
    padding: 9px 22px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-clear:hover {
    border-color: #ff5f57;
    color: #ff5f57;
}

/* ============================================================
FOOTER
============================================================ */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 50px 24px 24px;
    margin-left: 240px;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}
footer.full {
    margin-left: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto 40px;
}
.footer-brand .logo {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 14px;
}
.footer-brand p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 240px;
}
.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition);
}
.social-btn:hover {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
}

.footer-col h4 {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.footer-col a {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    transition: var(--transition);
}
.footer-col a:hover {
    color: var(--gold);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}
.footer-bottom p {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.footer-bottom .heart {
    color: #ff5f57;
}

/* ============================================================
MODAL (Login / Signup)
============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}
.modal-overlay.show {
    display: flex;
}
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    position: relative;
    animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
}
.modal-close:hover {
    border-color: #ff5f57;
    color: #ff5f57;
}
.modal-logo {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.modal-logo .logo-accent {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.modal-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}
.modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--glass);
    border-radius: 10px;
    padding: 4px;
}
.modal-tab {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: none;
    color: var(--text-muted);
    transition: var(--transition);
}
.modal-tab.active {
    background: var(--gold);
    color: #0a0a0a;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 11px 14px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    transition: var(--transition);
}
.form-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.1);
}
.btn-modal-submit {
    width: 100%;
    padding: 12px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0a0a0a;
    transition: var(--transition);
    margin-top: 8px;
    box-shadow: 0 4px 20px rgba(240, 165, 0, 0.3);
}
.btn-modal-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(240, 165, 0, 0.45);
}
.modal-divider {
    text-align: center;
    margin: 20px 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    position: relative;
}
.modal-divider::before, .modal-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--glass-border);
}
.modal-divider::before { left: 0; }
.modal-divider::after { right: 0; }
.social-login {
    display: flex;
    gap: 10px;
}
.social-login-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.social-login-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ============================================================
BACK TO TOP
============================================================ */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0a0a0a;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(240, 165, 0, 0.4);
    z-index: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: var(--transition);
}
.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(240, 165, 0, 0.55);
}

/* ============================================================
SEARCH NO RESULTS
============================================================ */
.no-results {
    display: none;
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.no-results i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

/* ============================================================
ACTIVE SECTION INDICATOR
============================================================ */
.section-active-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    margin-left: 8px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

/* ============================================================
RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-240px);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar.collapsed {
        transform: translateX(-240px);
    }
    .main, footer {
        margin-left: 0 !important;
    }
    .navbar-nav {
        display: none;
    }
    .search-wrap {
        max-width: 180px;
    }
    .editor-body {
        grid-template-columns: 1fr;
    }
    .editor-pane {
        min-height: 240px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    .output-pane {
        min-height: 200px;
    }
    .hero {
        padding: 36px 24px;
    }
    .hero-stats {
        gap: 24px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
@media (max-width: 480px) {
    .navbar {
        padding: 0 12px;
        gap: 10px;
    }
    .logo {
        font-size: 1.2rem;
    }
    .search-wrap {
        max-width: 130px;
    }
    .btn-login, .btn-signup {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    .hero h1 {
        font-size: 1.5rem;
    }
    .hero-btns {
        flex-direction: column;
    }
    .modal {
        padding: 28px 20px;
        margin: 0 16px;
    }
}

/* ============================================================
TOAST NOTIFICATION
============================================================ */
.toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 0.82rem;
    color: var(--text-primary);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 220px;
    backdrop-filter: blur(12px);
}
.toast.show {
    transform: translateX(0);
}
.toast i {
    color: var(--gold);
}

/* ============================================================
READING PANEL
============================================================ */
.read-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1500;
    backdrop-filter: blur(5px);
}
.read-overlay.show {
    display: block;
}

.read-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    background: var(--bg-secondary);
    border-left: none;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.read-panel.open {
    transform: translateY(0);
}

.read-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-shrink: 0;
}
.read-panel-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.read-panel-meta {
    flex: 1;
    min-width: 0;
}
.read-panel-meta h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.read-panel-meta .read-level {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 50px;
    background: var(--gold-dim);
    color: var(--gold);
    display: inline-block;
    margin-right: 8px;
}
.read-panel-meta .read-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}
.read-close {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
    flex-shrink: 0;
}
.read-close:hover {
    border-color: #ff5f57;
    color: #ff5f57;
}
.read-progress-wrap {
    height: 3px;
    background: var(--glass-border);
    flex-shrink: 0;
}
.read-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transition: width 0.4s ease;
    width: 0%;
}
.read-topics-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.read-topics-tabs::-webkit-scrollbar {
    display: none;
}
.read-topic-tab {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.73rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    white-space: nowrap;
    transition: var(--transition);
    cursor: pointer;
}
.read-topic-tab.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-color: transparent;
    color: #0a0a0a;
}
.read-topic-tab:hover:not(.active) {
    border-color: var(--gold);
    color: var(--gold);
}
.read-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.read-topic-content {
    display: none;
}
.read-topic-content.active {
    display: block;
    animation: fadeSlide 0.3s ease;
}
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.read-topic-content h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
}
.read-topic-content p {
    font-size: 0.855rem;
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 14px;
}
.read-topic-content ul {
    list-style: none;
    margin-bottom: 14px;
}
.read-topic-content ul li {
    font-size: 0.84rem;
    color: var(--text-secondary);
    padding: 7px 0 7px 22px;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}
.read-topic-content ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--gold);
    font-size: 0.75rem;
    top: 8px;
}
.read-code-block {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: #c8e6ff;
    line-height: 1.75;
    overflow-x: auto;
    margin-bottom: 14px;
    white-space: pre;
}
.code-comment { color: #6a8a6a; }
.code-kw  { color: #cc99cd; }
.code-str { color: #7ec8e3; }
.code-fn  { color: #f0a500; }
.read-tip {
    background: rgba(240, 165, 0, 0.08);
    border: 1px solid rgba(240, 165, 0, 0.25);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.8rem;
    color: var(--gold-light);
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.read-tip i {
    margin-top: 2px;
    flex-shrink: 0;
}
.read-info {
    background: rgba(30, 144, 255, 0.07);
    border: 1px solid rgba(30, 144, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.read-info i {
    margin-top: 2px;
    flex-shrink: 0;
}
.read-panel-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.15);
}
.read-nav-btn {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.read-nav-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}
.read-nav-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}
.read-topic-counter {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}
@media (max-width: 600px) {
    .read-panel {
        width: 100vw;
    }
}

/* ============================================================
PROFILE AVATAR & DROPDOWN (LearnHub Auth)
============================================================ */
.nav-profile {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #000;
    cursor: pointer;
    border: 2px solid var(--gold, #f0a500);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    letter-spacing: 0.5px;
}
.nav-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 14px rgba(240,165,0,0.5);
}
.profile-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 260px;
    background: var(--card-bg, #0a1628);
    border: 1px solid rgba(240,165,0,0.25);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    display: none;
    z-index: 9999;
    animation: dropIn 0.22s ease;
}
.profile-dropdown.open { display: block; }
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-big-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #000;
    flex-shrink: 0;
    border: 2px solid rgba(240,165,0,0.4);
}
.profile-info { overflow: hidden; }
.profile-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text, #e8f0fe);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-email {
    font-size: 0.75rem;
    color: var(--text-muted, #8899aa);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.profile-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 12px 0;
}
.profile-joined {
    font-size: 0.78rem;
    color: var(--text-muted, #8899aa);
    text-align: center;
}
.profile-logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(235,51,73,0.12);
    border: 1px solid rgba(235,51,73,0.3);
    border-radius: 10px;
    color: #eb3349;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.profile-logout-btn:hover {
    background: rgba(235,51,73,0.22);
    transform: scale(1.02);
}
.form-group input:focus {
    outline: none;
    border-color: var(--gold, #f0a500);
}
