/* ==========================================================================
   TRADEPRO - Premium Trading Platform Template
   Version: 1.0.0
   Author: TradePro Team
   Description: Professional stock/crypto trading platform design system
   ========================================================================== */

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================== */

:root {
    /* Brand Colors - Trading Terminal Palette */
    --color-bg-primary: #0A0A0A;
    --color-bg-secondary: #111111;
    --color-bg-tertiary: #1A1A1A;
    --color-bg-card: #141414;
    --color-bg-elevated: #1E1E1E;

    /* Accent Colors */
    --color-gain: #39FF14;
    --color-gain-muted: rgba(57, 255, 20, 0.15);
    --color-gain-glow: rgba(57, 255, 20, 0.4);
    --color-loss: #FF3B3B;
    --color-loss-muted: rgba(255, 59, 59, 0.15);
    --color-loss-glow: rgba(255, 59, 59, 0.4);
    --color-warning: #FFB800;
    --color-info: #00B4FF;

    /* Primary Accent (Interactive) */
    --color-primary: #39FF14;
    --color-primary-hover: #4DFF2B;
    --color-primary-muted: rgba(57, 255, 20, 0.1);

    /* Text Colors */
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #B3B3B3;
    --color-text-tertiary: #808080;
    --color-text-muted: #666666;

    /* Border Colors */
    --color-border: #2A2A2A;
    --color-border-light: #333333;
    --color-border-focus: #39FF14;

    /* Chart Colors */
    --color-chart-green: #39FF14;
    --color-chart-red: #FF3B3B;
    --color-chart-grid: rgba(255, 255, 255, 0.05);
    --color-chart-volume: rgba(57, 255, 20, 0.3);

    /* Typography Scale */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    --text-7xl: 4.5rem;      /* 72px */
    --text-display: clamp(2.5rem, 6vw, 5rem);
    --text-hero: clamp(3rem, 8vw, 6rem);

    /* Font Families */
    --font-display: 'Roboto Condensed', system-ui, sans-serif;
    --font-mono: 'Roboto Mono', 'SF Mono', 'Menlo', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-black: 900;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.2;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    /* Spacing Scale (8px base) */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    --space-32: 8rem;     /* 128px */

    /* Border Radius */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;

    /* Shadows - Terminal Style */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow-gain: 0 0 30px rgba(57, 255, 20, 0.3);
    --shadow-glow-loss: 0 0 30px rgba(255, 59, 59, 0.3);
    --shadow-glow-primary: 0 0 40px rgba(57, 255, 20, 0.2);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-slower: 500ms ease;
    --transition-spring: 500ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
    --z-toast: 700;
}

/* ==========================================================================
   2. CSS RESET & BASE STYLES
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: var(--color-gain-muted);
    color: var(--color-gain);
}

::-moz-selection {
    background-color: var(--color-gain-muted);
    color: var(--color-gain);
}

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

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

.font-mono {
    font-family: var(--font-mono);
}

.font-display {
    font-family: var(--font-display);
}

/* Price Display */
.price-large {
    font-family: var(--font-mono);
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.02em;
}

.price-change {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.price-up {
    color: var(--color-gain);
}

.price-down {
    color: var(--color-loss);
}

/* ==========================================================================
   4. LAYOUT UTILITIES
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.container-narrow {
    max-width: 900px;
}

.container-wide {
    max-width: 1600px;
}

.section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
}

.section-lg {
    padding-top: var(--space-32);
    padding-bottom: var(--space-32);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .md\:grid-cols-1 { grid-template-columns: 1fr; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    text-decoration: none;
}

.nav-logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gain);
    border-radius: var(--radius-md);
}

.nav-logo-icon svg {
    width: 20px;
    height: 20px;
    color: var(--color-bg-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-link {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
}

.nav-link.active {
    color: var(--color-gain);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile Menu */
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    position: relative;
    transition: background var(--transition-fast);
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    transition: transform var(--transition-fast);
}

.nav-toggle span::before { top: -8px; }
.nav-toggle span::after { bottom: -8px; }

@media (max-width: 1024px) {
    .nav-links,
    .nav-actions .btn:not(.btn-primary) {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-mobile {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-bg-primary);
        padding: var(--space-6);
        transform: translateX(100%);
        transition: transform var(--transition-base);
        overflow-y: auto;
    }

    .nav-mobile.active {
        transform: translateX(0);
    }

    .nav-mobile .nav-link {
        display: block;
        padding: var(--space-4);
        font-size: var(--text-lg);
        border-bottom: 1px solid var(--color-border);
    }
}

/* ==========================================================================
   6. BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn-primary {
    background: var(--color-gain);
    color: var(--color-bg-primary);
    border-color: var(--color-gain);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-glow-gain);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border-light);
}

.btn-secondary:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
}

.btn-buy {
    background: var(--color-gain);
    color: var(--color-bg-primary);
}

.btn-buy:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-glow-gain);
}

.btn-sell {
    background: var(--color-loss);
    color: var(--color-text-primary);
}

.btn-sell:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-glow-loss);
}

/* ==========================================================================
   7. CARDS
   ========================================================================== */

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-padded {
    padding: var(--space-6);
}

.card-hover {
    transition: all var(--transition-base);
}

.card-hover:hover {
    border-color: var(--color-border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Trading Card */
.trading-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.trading-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.trading-card-symbol {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.trading-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
}

.trading-card-icon.btc { background: linear-gradient(135deg, #F7931A 0%, #FF9500 100%); color: white; }
.trading-card-icon.eth { background: linear-gradient(135deg, #627EEA 0%, #8B9EFF 100%); color: white; }
.trading-card-icon.stock { background: var(--color-bg-tertiary); color: var(--color-text-primary); }

.trading-card-name {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
}

.trading-card-ticker {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.trading-card-price {
    text-align: right;
}

.trading-card-value {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.trading-card-change {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.trading-card-chart {
    height: 80px;
    margin: var(--space-4) 0;
    position: relative;
}

/* Market Card */
.market-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.market-card:hover {
    border-color: var(--color-border-light);
    background: var(--color-bg-tertiary);
}

/* ==========================================================================
   8. TRADING INTERFACE COMPONENTS
   ========================================================================== */

/* Candlestick Chart Container */
.chart-container {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.chart-symbol {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.chart-symbol-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #F7931A 0%, #FF9500 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-xs);
    color: white;
}

.chart-symbol-name {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
}

.chart-symbol-pair {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.chart-price {
    text-align: right;
}

.chart-price-value {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}

.chart-price-change {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.chart-timeframes {
    display: flex;
    gap: var(--space-1);
}

.chart-timeframe {
    padding: var(--space-1) var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-timeframe:hover {
    color: var(--color-text-secondary);
    background: var(--color-bg-tertiary);
}

.chart-timeframe.active {
    color: var(--color-gain);
    background: var(--color-gain-muted);
}

.chart-area {
    height: 400px;
    padding: var(--space-4);
    position: relative;
}

/* Candlestick */
.candlestick {
    position: absolute;
    bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.candlestick-wick {
    width: 1px;
}

.candlestick-body {
    width: 10px;
    min-height: 4px;
    border-radius: 1px;
}

.candlestick.up .candlestick-wick,
.candlestick.up .candlestick-body {
    background: var(--color-gain);
}

.candlestick.down .candlestick-wick,
.candlestick.down .candlestick-body {
    background: var(--color-loss);
}

/* Volume Bars */
.volume-bar {
    position: absolute;
    bottom: 0;
    width: 10px;
    border-radius: 2px 2px 0 0;
    opacity: 0.3;
}

.volume-bar.up { background: var(--color-gain); }
.volume-bar.down { background: var(--color-loss); }

/* Order Panel */
.order-panel {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.order-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
}

.order-tab {
    flex: 1;
    padding: var(--space-4);
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.order-tab.buy {
    color: var(--color-text-muted);
}

.order-tab.buy.active,
.order-tab.buy:hover {
    color: var(--color-gain);
    background: var(--color-gain-muted);
}

.order-tab.sell {
    color: var(--color-text-muted);
}

.order-tab.sell.active,
.order-tab.sell:hover {
    color: var(--color-loss);
    background: var(--color-loss-muted);
}

.order-form {
    padding: var(--space-5);
}

.order-type-toggle {
    display: flex;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-1);
    margin-bottom: var(--space-4);
}

.order-type-btn {
    flex: 1;
    padding: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.order-type-btn.active {
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
}

.order-field {
    margin-bottom: var(--space-4);
}

.order-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.order-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.order-input-wrapper:focus-within {
    border-color: var(--color-primary);
}

.order-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: transparent;
    border: none;
    outline: none;
}

.order-input-suffix {
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    background: var(--color-bg-secondary);
    border-left: 1px solid var(--color-border);
}

.order-slider {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.order-slider-btn {
    flex: 1;
    padding: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.order-slider-btn:hover {
    border-color: var(--color-border-light);
    color: var(--color-text-secondary);
}

.order-slider-btn.active {
    border-color: var(--color-gain);
    color: var(--color-gain);
    background: var(--color-gain-muted);
}

.order-summary {
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.order-summary-row:last-child {
    margin-bottom: 0;
}

.order-summary-label {
    color: var(--color-text-muted);
}

.order-summary-value {
    font-family: var(--font-mono);
    color: var(--color-text-primary);
}

/* Order Book */
.orderbook {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.orderbook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.orderbook-title {
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
}

.orderbook-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.orderbook-list {
    max-height: 200px;
    overflow-y: auto;
}

.orderbook-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: var(--space-1) var(--space-5);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    position: relative;
}

.orderbook-row::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
}

.orderbook-row.ask::before {
    background: var(--color-loss);
}

.orderbook-row.bid::before {
    background: var(--color-gain);
}

.orderbook-price {
    font-weight: var(--font-medium);
}

.orderbook-row.ask .orderbook-price {
    color: var(--color-loss);
}

.orderbook-row.bid .orderbook-price {
    color: var(--color-gain);
}

.orderbook-spread {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-5);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

/* Ticker Tape */
.ticker-tape {
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
    white-space: nowrap;
    padding: var(--space-3) 0;
}

.ticker-tape-inner {
    display: flex;
    animation: ticker-scroll 60s linear infinite;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-6);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.ticker-symbol {
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.ticker-price {
    color: var(--color-text-secondary);
}

.ticker-change {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.ticker-change.up {
    color: var(--color-gain);
    background: var(--color-gain-muted);
}

.ticker-change.down {
    color: var(--color-loss);
    background: var(--color-loss-muted);
}

/* Portfolio Donut */
.portfolio-donut {
    position: relative;
    width: 200px;
    height: 200px;
}

.portfolio-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.portfolio-donut-value {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}

.portfolio-donut-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: var(--space-8);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border);
}

.stat-item {
    flex: 1;
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

/* ==========================================================================
   9. HERO SECTION
   ========================================================================== */

.hero {
    min-height: 100vh;
    padding-top: 72px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.hero-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(57, 255, 20, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 255, 20, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.hero-bg-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(57, 255, 20, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-12);
    align-items: center;
}

@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
}

.hero-text {
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-gain-muted);
    border: 1px solid rgba(57, 255, 20, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-gain);
    margin-bottom: var(--space-6);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--color-gain);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-size: var(--text-hero);
    font-weight: var(--font-black);
    line-height: 1;
    margin-bottom: var(--space-6);
    letter-spacing: -0.03em;
}

.hero-title-highlight {
    color: var(--color-gain);
    text-shadow: 0 0 40px var(--color-gain-glow);
}

.hero-description {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.hero-stats {
    display: flex;
    gap: var(--space-10);
}

.hero-stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.hero-stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* Hero Terminal */
.hero-terminal {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl), var(--shadow-glow-primary);
}

.hero-terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.hero-terminal-dots {
    display: flex;
    gap: var(--space-2);
}

.hero-terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.hero-terminal-dot.red { background: #FF5F56; }
.hero-terminal-dot.yellow { background: #FFBD2E; }
.hero-terminal-dot.green { background: #27CA40; }

.hero-terminal-tabs {
    display: flex;
    gap: var(--space-4);
}

.hero-terminal-tab {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.hero-terminal-tab:hover,
.hero-terminal-tab.active {
    color: var(--color-text-primary);
}

.hero-terminal-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
}

@media (max-width: 768px) {
    .hero-terminal-body {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   10. FEATURES SECTION
   ========================================================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    padding: var(--space-8);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--color-gain);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gain-muted);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-gain);
}

.feature-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-3);
}

.feature-description {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

/* ==========================================================================
   11. PRICING SECTION
   ========================================================================== */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    align-items: stretch;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
}

.pricing-card {
    position: relative;
    padding: var(--space-8);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border-color: var(--color-gain);
    box-shadow: var(--shadow-glow-gain);
}

.pricing-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--space-2) var(--space-4);
    background: var(--color-gain);
    color: var(--color-bg-primary);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-name {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}

.pricing-description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-6);
}

.pricing-price {
    margin-bottom: var(--space-6);
}

.pricing-currency {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    vertical-align: top;
}

.pricing-amount {
    font-family: var(--font-mono);
    font-size: var(--text-5xl);
    font-weight: var(--font-bold);
}

.pricing-period {
    font-size: var(--text-base);
    color: var(--color-text-muted);
}

.pricing-features {
    list-style: none;
    margin-bottom: var(--space-8);
    flex: 1;
}

.pricing-feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.pricing-feature svg {
    width: 20px;
    height: 20px;
    color: var(--color-gain);
    flex-shrink: 0;
}

/* ==========================================================================
   12. MARKETS SECTION
   ========================================================================== */

.markets-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
    overflow-x: auto;
    padding-bottom: var(--space-2);
}

.markets-tab {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.markets-tab:hover {
    color: var(--color-text-secondary);
    border-color: var(--color-border-light);
}

.markets-tab.active {
    color: var(--color-gain);
    background: var(--color-gain-muted);
    border-color: var(--color-gain);
}

.markets-table {
    width: 100%;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.markets-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 120px;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.markets-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 120px;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-fast);
}

.markets-table-row:last-child {
    border-bottom: none;
}

.markets-table-row:hover {
    background: var(--color-bg-tertiary);
}

.market-name {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.market-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-xs);
}

.market-symbol {
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
}

.market-fullname {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.market-price {
    font-family: var(--font-mono);
    font-weight: var(--font-semibold);
}

.market-change {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.market-volume {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.market-cap {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.market-chart {
    height: 40px;
    width: 100px;
}

@media (max-width: 1024px) {
    .markets-table-header,
    .markets-table-row {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .markets-table-header > *:nth-child(n+4),
    .markets-table-row > *:nth-child(n+4) {
        display: none;
    }
}

/* ==========================================================================
   13. TESTIMONIALS
   ========================================================================== */

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

@media (max-width: 1024px) {
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
}

.testimonial-card {
    padding: var(--space-8);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.testimonial-rating {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}

.testimonial-star {
    width: 20px;
    height: 20px;
    color: var(--color-warning);
}

.testimonial-text {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    color: var(--color-gain);
}

.testimonial-name {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.testimonial-role {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ==========================================================================
   14. CTA SECTION
   ========================================================================== */

.cta-section {
    text-align: center;
    padding: var(--space-24) 0;
    background: linear-gradient(180deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.cta-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(57, 255, 20, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: var(--text-display);
    font-weight: var(--font-black);
    margin-bottom: var(--space-6);
}

.cta-description {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

.cta-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
}

/* ==========================================================================
   15. FOOTER
   ========================================================================== */

.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    text-decoration: none;
    margin-bottom: var(--space-4);
}

.footer-description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.footer-social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.footer-social-link:hover {
    color: var(--color-gain);
    border-color: var(--color-gain);
}

.footer-social-link svg {
    width: 20px;
    height: 20px;
}

.footer-heading {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
}

.footer-link {
    display: block;
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-text-primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.footer-legal {
    display: flex;
    gap: var(--space-6);
}

.footer-legal a {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--color-text-primary);
}

/* ==========================================================================
   16. FORMS
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-gain);
    box-shadow: 0 0 0 3px var(--color-gain-muted);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

.form-error {
    color: var(--color-loss);
}

/* ==========================================================================
   17. ANIMATIONS
   ========================================================================== */

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

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Glow Pulse */
@keyframes glow-pulse {
    0%, 100% { box-shadow: var(--shadow-glow-gain); }
    50% { box-shadow: 0 0 60px rgba(57, 255, 20, 0.4); }
}

.animate-glow-pulse {
    animation: glow-pulse 3s ease-in-out infinite;
}

/* Number Counter */
@keyframes count-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chart Line Drawing */
@keyframes draw-line {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

.chart-line {
    stroke-dasharray: 1000;
    animation: draw-line 2s ease-out forwards;
}

/* Typing Effect */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--color-gain);
    margin-left: 2px;
    animation: blink 1s infinite;
}

/* ==========================================================================
   18. UTILITY CLASSES
   ========================================================================== */

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-gain { color: var(--color-gain); }
.text-loss { color: var(--color-loss); }

/* Background */
.bg-primary { background: var(--color-bg-primary); }
.bg-secondary { background: var(--color-bg-secondary); }
.bg-card { background: var(--color-bg-card); }

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

.pt-20 { padding-top: var(--space-20); }
.pb-20 { padding-bottom: var(--space-20); }
.py-20 { padding-top: var(--space-20); padding-bottom: var(--space-20); }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: var(--space-4);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    z-index: 9999;
}

/* ==========================================================================
   19. PAGE-SPECIFIC STYLES
   ========================================================================== */

/* API Documentation */
.api-endpoint {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.api-method {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
}

.api-method.get { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.api-method.post { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.api-method.put { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.api-method.delete { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.code-block {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    overflow-x: auto;
}

.code-block pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.code-block code {
    font-family: inherit;
}

/* News Cards */
.news-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-6);
    padding: var(--space-6);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
}

.news-card:hover {
    border-color: var(--color-border-light);
    transform: translateX(8px);
}

.news-image {
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-tertiary);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-meta {
    display: flex;
    gap: var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.news-tag {
    color: var(--color-gain);
    font-weight: var(--font-medium);
}

.news-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
    line-height: var(--leading-snug);
}

.news-excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

@media (max-width: 768px) {
    .news-card {
        grid-template-columns: 1fr;
    }
}

/* Security Badges */
.security-badge {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.security-badge-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gain-muted);
    border-radius: var(--radius-md);
}

.security-badge-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-gain);
}

.security-badge-title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.security-badge-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* App Download */
.app-store-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--color-text-primary);
    color: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.app-store-btn:hover {
    transform: scale(1.02);
}

.app-store-btn svg {
    width: 28px;
    height: 28px;
}

.app-store-text {
    text-align: left;
}

.app-store-small {
    font-size: var(--text-xs);
    opacity: 0.7;
}

.app-store-name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
}

/* ==========================================================================
   20. PRINT STYLES
   ========================================================================== */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    .nav,
    .footer,
    .btn,
    .ticker-tape {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ==========================================================================
   21. DARK MODE (LIGHT THEME OVERRIDES)
   ========================================================================== */

html[data-theme="light"],
html[data-theme="light"].dark {
    /* Light theme backgrounds */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F8F8F8;
    --color-bg-tertiary: #F0F0F0;
    --color-bg-card: #FFFFFF;
    --color-bg-elevated: #FAFAFA;

    /* Light theme text */
    --color-text-primary: #1A1A1A;
    --color-text-secondary: #4A4A4A;
    --color-text-tertiary: #7A7A7A;
    --color-text-muted: #999999;

    /* Light theme borders */
    --color-border: #E0E0E0;
    --color-border-light: #CCCCCC;

    /* Light theme chart grid */
    --color-chart-grid: rgba(0, 0, 0, 0.05);
}

/* Light mode adjustments */
html[data-theme="light"] {
    --color-gain-glow: rgba(57, 255, 20, 0.2);
    --color-loss-glow: rgba(255, 59, 59, 0.2);
    --color-primary-muted: rgba(57, 255, 20, 0.08);
}

html[data-theme="light"] body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
}

html[data-theme="light"] .nav {
    background-color: rgba(255, 255, 255, 0.7);
    border-bottom-color: var(--color-border);
}

html[data-theme="light"] .nav-logo,
html[data-theme="light"] .nav-link,
html[data-theme="light"] .btn-ghost {
    color: var(--color-text-primary);
}

html[data-theme="light"] .btn-ghost:hover {
    background-color: var(--color-bg-secondary);
}

html[data-theme="light"] .card,
html[data-theme="light"] .section-card {
    background-color: var(--color-bg-card);
    border-color: var(--color-border);
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6 {
    color: var(--color-text-primary);
}

html[data-theme="light"] .footer {
    background-color: var(--color-bg-secondary);
    border-top-color: var(--color-border);
    color: var(--color-text-secondary);
}

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: var(--color-text-tertiary);
}

html[data-theme="light"] .icon-sun {
    display: block;
}

html[data-theme="light"] .icon-moon {
    display: none;
}

/* Dark mode (already set in :root) */
html.dark .icon-sun {
    display: none;
}

html.dark .icon-moon {
    display: block;
}

/* ==========================================================================
   22. THEME TOGGLE BUTTON STYLES
   ========================================================================== */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: transparent;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-toggle:hover {
    background-color: var(--color-bg-tertiary);
    border-color: var(--color-border-light);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.2s ease;
}

.theme-toggle .hidden {
    display: none !important;
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .theme-toggle {
        transition: none;
    }
}
