/* ==========================================================================
   Base CSS - MoltShell
   Reset, CSS Variables, Typography, Fonts
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   CSS Variables - Enterprise Blue Theme (Default)
   -------------------------------------------------------------------------- */
:root {
    /* Light Mode (Primary - Enterprise) */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --text-primary: #1a1a2e;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --primary-blue: #003399;
    --secondary-blue: #004494;
    --accent-gold: #C9A227;
    --accent-green: #059669;
    --accent-red: #DC2626;
    --accent-yellow: #D97706;
    --nav-bg: rgba(255,255,255,0.95);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 40px rgba(0, 51, 153, 0.12);
    --gradient-hero: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
    --gradient-section: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #0a0a12;
    --bg-secondary: #0f0f18;
    --bg-card: #12121c;
    --border: #1e1e2e;
    --text-primary: #f0f0f5;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary-blue: #4d7cc9;
    --secondary-blue: #6b8fd9;
    --accent-gold: #D4AF37;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #fbbf24;
    --nav-bg: rgba(10,10,18,0.95);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 10px 40px rgba(77, 124, 201, 0.15);
    --gradient-hero: linear-gradient(180deg, #0f0f18 0%, #0a0a12 100%);
    --gradient-section: linear-gradient(180deg, #0a0a12 0%, #0f0f18 100%);
}

/* --------------------------------------------------------------------------
   Neon Theme Variables (for Explorer, Docs)
   -------------------------------------------------------------------------- */
.theme-neon {
    --bg-primary: #08080c;
    --bg-secondary: #0f0f15;
    --bg-card: #12121a;
    --border: #1e1e2e;
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent-pink: #ff6eb4;
    --accent-cyan: #00d4ff;
    --accent-green: #00ff88;
    --accent-purple: #a855f7;
    --accent-red: #ff4757;
    --accent-yellow: #ffd93d;
    --gradient-1: linear-gradient(135deg, #ff6eb4 0%, #a855f7 50%, #00d4ff 100%);
    --gradient-2: linear-gradient(180deg, rgba(255,110,180,0.15) 0%, transparent 50%);
    --nav-bg: rgba(8,8,12,0.8);
    --card-shadow: none;
}

.theme-neon[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F7FA;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --text-primary: #1A1A2E;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --accent-pink: #1E56A0;
    --accent-cyan: #2E7DB3;
    --accent-green: #059669;
    --accent-purple: #163172;
    --accent-red: #DC2626;
    --accent-yellow: #D97706;
    --gradient-1: linear-gradient(135deg, #1E56A0 0%, #163172 50%, #2E7DB3 100%);
    --gradient-2: linear-gradient(180deg, rgba(30,86,160,0.08) 0%, transparent 50%);
    --nav-bg: rgba(255,255,255,0.9);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   Base Typography
   -------------------------------------------------------------------------- */
body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    font-weight: 600;
}

h3 {
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    font-weight: 600;
}

h4 {
    font-size: 1.05rem;
    font-weight: 600;
}

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

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-blue);
}

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

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

li {
    margin-bottom: 0.5rem;
}

address {
    font-style: normal;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Code Styling
   -------------------------------------------------------------------------- */
code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.9em;
    background: var(--bg-secondary);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.25rem 0;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85em;
    line-height: 1.8;
}

/* Code Syntax Highlighting */
.code-comment { color: var(--text-muted); }
.code-string { color: var(--accent-green); }
.code-keyword { color: var(--primary-blue); }
.code-function { color: var(--secondary-blue); }
.code-number { color: var(--accent-yellow); }

[data-theme="dark"] .code-string { color: #10b981; }
[data-theme="dark"] .code-keyword { color: #4d7cc9; }
[data-theme="dark"] .code-function { color: #6b8fd9; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9em;
}

th, td {
    text-align: left;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--bg-card);
}

td {
    color: var(--text-secondary);
}

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

/* --------------------------------------------------------------------------
   Selection
   -------------------------------------------------------------------------- */
::selection {
    background: var(--primary-blue);
    color: white;
}

/* --------------------------------------------------------------------------
   Transitions for Theme Changes
   -------------------------------------------------------------------------- */
body,
nav,
.card,
.btn,
.feature-card,
.hero-badge,
.btn-secondary,
.code-block,
.code-header,
.stat-card,
.standard-item,
.use-case-card,
.sidebar,
.detail-section,
.tab-btn {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
