/* ============================================================
   BASE.CSS — CSS Variables, Reset, Typography, Utilities
   Shared across all pages — DARK THEME ONLY
   ============================================================ */

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

/* ── CSS Variables — Futuristic Dark Theme ── */
:root {
    --bg: #0a0a0f;
    --bg2: #0f0f1a;
    --bg3: #141428;
    --primary-bg: #0a0a0f;
    --secondary-bg: #0f0f1a;
    --tertiary-bg: #141428;
    --card-bg: #12121f;
    --primary-color: #4dabf7;
    --primary-glow: rgba(77, 171, 247, 0.3);
    --secondary-color: #9090b0;
    --accent: #7c3aed;
    --accent2: #06b6d4;
    --accent-cyan: #4dabf7;
    --accent-purple: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #f56c6c;
    --text-primary: #e8e8f0;
    --text-secondary: #9090b0;
    --text-muted: #6060a0;
    --border-color: rgba(77, 171, 247, 0.15);
    --border-hover: rgba(77, 171, 247, 0.5);
    --header-bg: rgba(10, 10, 15, 0.92);
    --sidebar-bg: #0f0f1a;
    --menu-text-color: #e8e8f0;
    --menu-bg-hover: rgba(77, 171, 247, 0.08);
    --gradient-dark: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);
    --card-glow: 0 0 20px rgba(77, 171, 247, 0.1);
    --text-glow: 0 0 10px rgba(77, 171, 247, 0.5);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ── Base Typography ── */
html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Grid background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(77,171,247,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77,171,247,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', monospace;
}

/* ── Utilities ── */
.text-primary-color { color: var(--primary-color); }
.text-secondary-color { color: var(--secondary-color); }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted-custom { color: var(--text-muted); }
.text-info { color: var(--primary-color) !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: rgba(77,171,247,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(77,171,247,0.6); }

/* ── Animations ── */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 5px var(--primary-color)); }
    50% { filter: drop-shadow(0 0 20px var(--primary-color)); }
}

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

.float { animation: float 4s ease-in-out infinite; }

/* ── Loading Overlay ── */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 10, 15, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.loading-overlay.active { opacity: 1; pointer-events: auto; }

.spinner {
    width: 48px; height: 48px;
    border: 3px solid rgba(77, 171, 247, 0.15);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
.spinner.small {
    width: 18px; height: 18px;
    border-width: 2px;
    margin: 0 8px 0 0;
    display: inline-block;
    vertical-align: middle;
}

/* ── Markdown Body ── */
.markdown-body { font-family: inherit; color: var(--text-primary); }
.markdown-body p { margin-bottom: 1rem; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}
.markdown-body code {
    background: var(--tertiary-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--accent2);
    border: 1px solid var(--border-color);
}
.markdown-body pre {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}
.markdown-body pre code { background: transparent; padding: 0; color: inherit; border: none; }
.markdown-body ul, .markdown-body ol { margin-bottom: 1rem; padding-left: 2rem; }
.markdown-body blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    color: var(--text-secondary);
    margin: 1rem 0;
}
