/**
 * Cosmos DEX Terminal - Professional UI
 * Modern, accessible design with light/dark theme support
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================
   THEME VARIABLES - Dark Mode (Default)
   ============================================ */
:root {
    /* Background layers */
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #1f1f2e;
    
    /* Surface colors */
    --surface-primary: rgba(30, 30, 45, 0.95);
    --surface-secondary: rgba(40, 40, 60, 0.85);
    --surface-hover: rgba(50, 50, 75, 0.95);
    
    /* Border colors */
    --border-primary: rgba(124, 58, 237, 0.15);
    --border-secondary: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(124, 58, 237, 0.5);
    --border-hover: rgba(139, 92, 246, 0.35);
    
    /* Text colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #64748b;
    --text-disabled: #475569;
    
    /* Brand colors */
    --brand-primary: #7c3aed;
    --brand-secondary: #8b5cf6;
    --brand-tertiary: #a78bfa;
    --brand-accent: #06b6d4;
    --brand-accent-light: #22d3ee;
    
    /* Semantic colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    
    /* Success/Warning/Error backgrounds */
    --bg-success: rgba(16, 185, 129, 0.1);
    --bg-warning: rgba(245, 158, 11, 0.1);
    --bg-error: rgba(239, 68, 68, 0.1);
    --bg-info: rgba(59, 130, 246, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.55);
    
    /* Glow effects */
    --glow-brand: 0 0 20px rgba(124, 58, 237, 0.3);
    --glow-accent: 0 0 20px rgba(6, 182, 212, 0.25);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================
   THEME VARIABLES - Light Mode
   ============================================ */
[data-theme="light"] {
    /* Background layers */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-elevated: #ffffff;
    
    /* Surface colors */
    --surface-primary: rgba(255, 255, 255, 0.98);
    --surface-secondary: rgba(248, 250, 252, 0.95);
    --surface-hover: rgba(241, 245, 249, 0.98);
    
    /* Border colors */
    --border-primary: rgba(124, 58, 237, 0.2);
    --border-secondary: rgba(0, 0, 0, 0.08);
    --border-focus: rgba(124, 58, 237, 0.6);
    --border-hover: rgba(139, 92, 246, 0.4);
    
    /* Text colors */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --text-disabled: #cbd5e1;
    
    /* Shadows - lighter for light mode */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.18);
    
    /* Glow effects - subtler in light mode */
    --glow-brand: 0 0 16px rgba(124, 58, 237, 0.15);
    --glow-accent: 0 0 16px rgba(6, 182, 212, 0.12);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Background gradient overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.08), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.06), transparent 40%);
    opacity: 0.5;
    z-index: 0;
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.04), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.03), transparent 40%);
}

/* ============================================
   LAYOUT STRUCTURE
   ============================================ */
.shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
    background: var(--surface-primary);
    border-right: 1px solid var(--border-secondary);
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xl);
    user-select: none;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.sidebar nav a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sidebar nav a:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border-secondary);
    transform: translateX(2px);
}

.sidebar nav a.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(6, 182, 212, 0.08));
    color: var(--brand-primary);
    border-color: var(--border-primary);
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main {
    padding: var(--spacing-xl);
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================
   TOP BAR / HEADER
   ============================================ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    flex-wrap: wrap;
}

.topbar > div {
    flex: 1;
    min-width: 300px;
}

.topbar h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar p {
    color: var(--text-tertiary);
    font-size: 0.9375rem;
    line-height: 1.6;
    max-width: 700px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    appearance: none;
    border: 1px solid var(--border-secondary);
    background: var(--surface-secondary);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.theme-toggle:active {
    transform: translateY(0);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    appearance: none;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

/* Primary button */
.btn:not(.ghost):not(.secondary) {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: white;
    box-shadow: var(--shadow-sm), var(--glow-brand);
}

.btn:not(.ghost):not(.secondary):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--glow-brand);
}

.btn:not(.ghost):not(.secondary):active {
    transform: translateY(0);
}

/* Ghost button */
.btn.ghost {
    background: transparent;
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    box-shadow: none;
}

.btn.ghost:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Secondary button */
.btn.secondary {
    background: var(--surface-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn.secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Small button variant */
.btn.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Button row */
.button-row {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--surface-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    backdrop-filter: blur(12px);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.card p {
    color: var(--text-tertiary);
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
}

.card p:last-child {
    margin-bottom: 0;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid,
.hero-grid,
.trade-grid,
.trade-grid-wide {
    display: grid;
    gap: var(--spacing-xl);
}

.grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.hero-grid {
    grid-template-columns: 1.5fr 1fr;
}

.trade-grid {
    grid-template-columns: 1.2fr 0.8fr;
}

.trade-grid-wide {
    grid-template-columns: repeat(3, 1fr);
}

.two-up {
    grid-template-columns: repeat(2, 1fr);
}

.three-up {
    grid-template-columns: repeat(3, 1fr);
}

.full-span {
    grid-column: 1 / -1;
}

.hero-strip {
    margin-bottom: var(--spacing-xl);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
label {
    display: block;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.01em;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: var(--bg-elevated);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-hover);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2394a3b8' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Input groups */
.input-group {
    display: flex;
    gap: var(--spacing-sm);
}

.input-group input {
    flex: 1;
}

/* ============================================
   QUOTE BOX / INFO BOX
   ============================================ */
.quote-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.quote-box > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    gap: var(--spacing-md);
}

.quote-box > div:not(:last-child) {
    border-bottom: 1px solid var(--border-secondary);
}

.quote-box span {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
}

.quote-box strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    text-align: right;
}

/* ============================================
   CODE BOXES
   ============================================ */
.codebox {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    min-height: 120px;
    max-height: 400px;
    overflow-y: auto;
}

.codebox.shortbox {
    min-height: 80px;
    max-height: 200px;
}

.codebox.rawbox {
    min-height: 200px;
    max-height: 500px;
}

/* ============================================
   TABLES
   ============================================ */
.table-shell {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.market-table thead {
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border-secondary);
}

.market-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.market-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.market-table tbody tr {
    transition: background-color var(--transition-fast);
}

.market-table tbody tr:hover {
    background: var(--surface-hover);
}

.market-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   STAT ITEMS
   ============================================ */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    gap: var(--spacing-md);
}

.stat-item:not(:last-child) {
    border-bottom: 1px solid var(--border-secondary);
}

.stat-item span {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-item strong {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* ============================================
   LISTS
   ============================================ */
.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    padding-left: 1.75rem;
    position: relative;
    margin-bottom: var(--spacing-md);
    color: var(--text-tertiary);
    line-height: 1.6;
}

.checklist li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: 700;
}

.stat-list,
.meta-list {
    padding-left: var(--spacing-lg);
}

.compact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compact li {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-secondary);
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.compact li:last-child {
    border-bottom: none;
}

/* ============================================
   BADGES & PILLS
   ============================================ */
.trust-badge,
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
}

.trust-badge {
    margin-bottom: var(--spacing-md);
}

/* Badge variants */
.trust-badge.verified,
.pill.verified {
    background: var(--bg-success);
    border-color: var(--color-success);
    color: var(--color-success);
}

.trust-badge.known,
.pill.known {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.trust-badge.caution,
.pill.caution {
    background: var(--bg-warning);
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.trust-badge.unverified,
.trust-badge.unknown,
.pill.unverified,
.pill.unknown {
    background: var(--bg-error);
    border-color: var(--color-error);
    color: var(--color-error);
}

.pill.experimental {
    background: rgba(255, 184, 107, 0.1);
    border-color: #ffb86b;
    color: #ffb86b;
}

/* ============================================
   CHARTS
   ============================================ */
.chart-shell {
    min-height: 280px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chart-empty {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-xl);
    max-width: 400px;
    line-height: 1.7;
}

/* ============================================
   ASSET ROWS
   ============================================ */
.asset-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-secondary);
}

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

.asset-main {
    flex: 1;
}

.asset-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.asset-sub {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.asset-tags {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ============================================
   METADATA
   ============================================ */
.metadata-project {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.issue-list {
    list-style: none;
    padding: 0;
}

.issue {
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-sm);
}

.issue.error {
    color: var(--color-error);
}

.issue.warning {
    color: var(--color-warning);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.muted {
    color: var(--text-muted);
}

.small {
    font-size: 0.875rem;
}

.tiny {
    font-size: 0.75rem;
}

.text-center {
    text-align: center;
}

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

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    padding: var(--spacing-2xl);
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.stats {
    padding: var(--spacing-xl);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .trade-grid-wide {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .three-up {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 980px) {
    .shell {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-secondary);
        padding: var(--spacing-lg);
    }
    
    .sidebar nav {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .main {
        padding: var(--spacing-lg);
    }
    
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .topbar > div {
        min-width: 100%;
    }
    
    .hero-grid,
    .grid,
    .trade-grid,
    .trade-grid-wide,
    .two-up,
    .three-up {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .main {
        padding: var(--spacing-md);
    }
    
    .card {
        padding: var(--spacing-lg);
    }
    
    .topbar h1 {
        font-size: 1.75rem;
    }
    
    .brand {
        font-size: 1.25rem;
    }
    
    .button-row {
        flex-direction: column;
        width: 100%;
    }
    
    .button-row .btn {
        width: 100%;
    }
    
    .market-table {
        min-width: 500px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   CANCEL ORDER BUTTON
   ============================================ */
.cancel-order-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    margin-left: var(--spacing-sm);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ============================================
   EPIC ENHANCEMENTS - VISUAL BLING! 🚀
   ============================================ */

/* Animated gradient background */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.shell {
    background: linear-gradient(
        135deg,
        var(--bg-primary) 0%,
        var(--bg-secondary) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 75%,
        var(--bg-primary) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 30s ease infinite;
}

/* Glowing borders on hover */
.card:hover {
    box-shadow: 
        var(--shadow-md),
        0 0 20px rgba(124, 58, 237, 0.3),
        inset 0 0 20px rgba(124, 58, 237, 0.05);
}

/* Button pulse effect */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(124, 58, 237, 0); }
}

.btn:not(.ghost):not(.secondary):hover {
    animation: pulse 2s infinite;
}

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading {
    background: linear-gradient(
        90deg,
        var(--surface-primary) 0%,
        var(--surface-hover) 50%,
        var(--surface-primary) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Number counter animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-value {
    animation: countUp 0.5s ease-out;
}

/* Glow text effect */
.glow-text {
    text-shadow: 
        0 0 10px rgba(124, 58, 237, 0.5),
        0 0 20px rgba(124, 58, 237, 0.3),
        0 0 30px rgba(124, 58, 237, 0.1);
}

/* Epic hero section */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(124, 58, 237, 0.1) 0%,
        transparent 70%
    );
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Price ticker effect */
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.price-ticker {
    display: inline-block;
    animation: ticker 20s linear infinite;
}

/* Orderbook row hover effect */
.market-table tbody tr {
    position: relative;
    transition: all var(--transition-fast);
}

.market-table tbody tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-accent));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.market-table tbody tr:hover::before {
    opacity: 1;
}

/* Success/Error flash animations */
@keyframes flashSuccess {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(16, 185, 129, 0.2); }
}

@keyframes flashError {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(239, 68, 68, 0.2); }
}

.flash-success {
    animation: flashSuccess 0.5s ease-out;
}

.flash-error {
    animation: flashError 0.5s ease-out;
}

/* Progress bar */
.progress-bar {
    height: 4px;
    background: var(--border-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

/* Badge glow */
.trust-badge.verified,
.trust-badge.known {
    box-shadow: 0 0 15px currentColor;
}

/* Chart container enhancements */
.chart-shell {
    background: 
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.05), transparent 50%),
        radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.05), transparent 50%),
        var(--bg-secondary);
}

/* Sidebar brand animation */
.brand {
    position: relative;
}

.brand::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    border-radius: var(--radius-full);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

/* Status indicator pulse */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 0 0 currentColor;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 currentColor; }
    70% { box-shadow: 0 0 0 6px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.status-indicator.live {
    background-color: var(--color-success);
    color: var(--color-success);
}

/* Epic button states */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Main content padding fix */
.main {
    padding: 2rem;
    max-width: 1800px;
}

@media (max-width: 1400px) {
    .main {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main {
        padding: 1rem;
    }
}

/* Card spacing improvements */
.card {
    padding: 2rem;
}

@media (max-width: 768px) {
    .card {
        padding: 1.25rem;
    }
}

/* Enhanced grid gaps */
.grid,
.hero-grid,
.trade-grid,
.trade-grid-wide {
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid,
    .hero-grid,
    .trade-grid,
    .trade-grid-wide {
        gap: 1rem;
    }
}

/* Topbar spacing */
.topbar {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-secondary);
}

/* Live price display */
.live-price {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    text-shadow: 0 0 30px rgba(124, 58, 237, 0.3);
}

/* Quote box enhancements */
.quote-box {
    background: linear-gradient(
        135deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 100%
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Epic scrollbar */
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-accent));
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-error);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px var(--color-error);
    animation: pulse 2s infinite;
}

/* Epic table headers */
.market-table thead {
    background: linear-gradient(
        180deg,
        var(--surface-secondary) 0%,
        var(--bg-secondary) 100%
    );
}

/* Input focus glow */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 
        0 0 0 3px rgba(124, 58, 237, 0.1),
        0 0 20px rgba(124, 58, 237, 0.2);
}

/* Success/Error messages */
.message-success,
.message-error {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: countUp 0.3s ease-out;
}

.message-success {
    background: var(--bg-success);
    color: var(--color-success);
    border-left: 4px solid var(--color-success);
}

.message-error {
    background: var(--bg-error);
    color: var(--color-error);
    border-left: 4px solid var(--color-error);
}

