/* ============================================
   BASE STYLES - Reset, Variables, Typography
   ============================================ */

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

/* ---- CSS Variables ---- */
:root {
    /* Dark Theme Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1429;
    --bg-tertiary: #141a2e;
    --bg-card: #1a2038;
    --bg-card-hover: #1e2545;
    --bg-code: #0d1117;
    --bg-code-header: #161b22;
    --bg-hover: rgba(97, 218, 251, 0.04);
    --bg-active: rgba(97, 218, 251, 0.08);
    --bg-input: #141a2e;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #f1f5f9;
    --text-inverse: #0f172a;

    --accent-react: #61dafb;
    --accent-purple: #a855f7;
    --accent-cyan: #22d3ee;
    --accent-green: #22c55e;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --accent-pink: #ec4899;

    --gradient-primary: linear-gradient(135deg, #61dafb 0%, #a855f7 100%);
    --gradient-card: linear-gradient(145deg, rgba(97, 218, 251, 0.05), rgba(168, 85, 247, 0.05));
    --gradient-hero: linear-gradient(135deg, rgba(97, 218, 251, 0.1) 0%, rgba(168, 85, 247, 0.1) 50%, rgba(34, 211, 238, 0.1) 100%);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(97, 218, 251, 0.3);
    --border-card: rgba(255, 255, 255, 0.08);

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 20px rgba(97, 218, 251, 0.15);
    --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.15);

    --sidebar-width: 280px;
    --header-height: 60px;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-code: #1e293b;
    --bg-code-header: #334155;
    --bg-hover: rgba(97, 218, 251, 0.06);
    --bg-active: rgba(97, 218, 251, 0.1);
    --bg-input: #f1f5f9;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-heading: #0f172a;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-active: rgba(97, 218, 251, 0.4);
    --border-card: rgba(0, 0, 0, 0.06);

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 20px rgba(97, 218, 251, 0.1);

    --gradient-card: linear-gradient(145deg, rgba(97, 218, 251, 0.03), rgba(168, 85, 247, 0.03));
    --gradient-hero: linear-gradient(135deg, rgba(97, 218, 251, 0.06) 0%, rgba(168, 85, 247, 0.06) 50%, rgba(34, 211, 238, 0.06) 100%);
}

/* ---- Global Styles ---- */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.75;
    font-size: 0.9375rem;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75em;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    font-size: 1.35rem;
    margin-top: 2rem;
    color: var(--accent-react);
}

h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

em {
    color: var(--accent-cyan);
    font-style: italic;
}

/* ---- Links ---- */
a {
    color: var(--accent-react);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

/* ---- Lists ---- */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}

li::marker {
    color: var(--accent-react);
}

/* ---- Inline Code ---- */
code:not([class*="language-"]) {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-tertiary);
    padding: 0.15em 0.45em;
    border-radius: var(--radius-xs);
    color: var(--accent-react);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* ---- Horizontal Rule ---- */
hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

/* ---- Selection ---- */
::selection {
    background: rgba(97, 218, 251, 0.25);
    color: #fff;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.3);
}

/* ---- Image ---- */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* ---- Table ---- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-hover);
}

/* ---- Blockquote ---- */
blockquote {
    border-left: 4px solid var(--accent-react);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-hover);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
}

blockquote p {
    margin-bottom: 0;
}
