/* ===================================
   COINTRACKERLY ORGANIZED DESIGN SYSTEM
   =================================== */

/* ===================================
   1. CSS VARIABLES & ROOT CONFIGURATION
   =================================== */

:root {
    /* 1.1 Brand Colors */
    --brand-gold-50: #fffbeb;
    --brand-gold-100: #fef3c7;
    --brand-gold-200: #fde68a;
    --brand-gold-300: #fcd34d;
    --brand-gold-400: #fbbf24;
    --brand-gold-500: #f59e0b;
    --brand-gold-600: #d97706;
    --brand-gold-700: #b45309;
    --brand-gold-800: #92400e;
    --brand-gold-900: #78350f;
    
    /* 1.2 Primary Colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* 1.3 Accent Colors */
    --accent-50: #faf5ff;
    --accent-100: #f3e8ff;
    --accent-200: #e9d5ff;
    --accent-300: #d8b4fe;
    --accent-400: #c084fc;
    --accent-500: #a855f7;
    --accent-600: #9333ea;
    --accent-700: #7c3aed;
    --accent-800: #6b21a8;
    --accent-900: #581c87;
    
    /* 1.4 Success Colors */
    --green-50: #ecfdf5;
    --green-100: #d1fae5;
    --green-200: #a7f3d0;
    --green-300: #6ee7b7;
    --green-400: #34d399;
    --green-500: #10b981;
    --green-600: #059669;
    --green-700: #047857;
    --green-800: #065f46;
    --green-900: #064e3b;
    
    /* 1.5 Error Colors */
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-300: #fca5a5;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    --red-800: #991b1b;
    --red-900: #7f1d1d;
    
    /* 1.6 Warning Colors */
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-300: #fdba74;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --orange-800: # CAMELCase9a3412;
    --orange-900: #7c2d12;
    
    /* 1.7 Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 1.8 Theme Colors - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-elevated: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-inverse: #ffffff;
    --text-brand: var(--primary-600);
    
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --border-focus: var(--primary-500);
    --border-brand: var(--primary-500);
    
    /* 1.9 Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-brand: 0 10px 25px -5px rgba(37, 99, 235, 0.2), 0 4px 6px -4px rgba(37, 99, 235, 0.1);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);
    
    /* 1.10 Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.2rem;
    --space-xl: 1.5rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* 1.nosebleed Font Sizes - REDUCED */
    --text-xs: 0.7rem;
    --text-sm: 0.8rem;
    --text-base: 0.9rem;
    --text-lg: 1rem;
    --text-xl: 1.1rem;
    --text-2xl: 1.35rem;
    --text-3xl: 1.7rem;
    --text-4xl: 2rem;
    --text-5xl: 2.75rem;
    
    /* 1.12 Layout - UPDATED WITH INCREASED WIDTH */
    --header-height: 72px;
    --header-height-mobile: 64px;
    --footer-height: auto;
    --max-width: 1500px; /* Increased from 1400px */
    --max-width-ultra: 1600px; /* New ultra-wide breakpoint */
    --sidebar-width: 350px;
    
    /* Enhanced spacing for larger screens */
    --container-padding-large: clamp(2rem, 5vw, 4rem);
    --grid-gap-large: clamp(2rem, 3vw, 3rem);
    
    /* 1.13 Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* 1.14 Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* 1.15 Typography */
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    /* 1.16 Brand Variables */
    --brand-primary: var(--primary-600);
    --brand-secondary: var(--accent-600);
    --brand-accent: var(--brand-gold-500);
    --crypto-positive: var(--green-500);
    --crypto-negative: var(--red-500);
}

/* 1.17 Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252a3a;
    --bg-elevated: #1e2332;
    --bg-glass: rgba(15, 20, 25, 0.9);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-inverse: #0f1419;
    --text-brand: var(--primary-400);
    
    --border-primary: #334155;
    --border-secondary: #475569;
    --border-focus: var(--primary-400);
    --border-brand: var(--primary-400);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);
    --shadow-brand: 0 10px 25px -5px rgba(59, 130, 246, 0.3), 0 4px 6px -4px rgba(59, 30, 246, 0.2);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.4);
    
    --brand-primary: var(--primary-400);
    --brand-secondary: var(--accent-400);
    --brand-accent: var(--brand-gold-400);
    --crypto-positive: var(--green-400);
    --crypto-negative: var(--red-400);

    color-scheme: dark;
}

/* Ultra-wide responsive design */
@media (min-width: 1600px) {
    .container {
        max-width: var(--max-width-ultra);
        padding: 0 var(--container-padding-large);
    }
    
    .main-grid {
        grid-template-columns: 400px 1fr; /* Increased sidebar width */
        gap: var(--grid-gap-large);
    }
    
    .chart-section {
        height: clamp(500px, 65vh, 700px); /* Increased chart height */
    }
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .container {
        max-width: var(--max-width);
        padding: 0 clamp(2rem, 4vw, 3rem);
    }
    
    .main-grid {
        grid-template-columns: 375px 1fr;
        gap: clamp(2rem, 2.5vw, 2.5rem);
    }
}

/* ===================================
   2. RESET & BASE STYLES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
}

/* ===================================
   3. TYPOGRAPHY - UPDATED FONT WEIGHTS
   =================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.2;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.025em;
}

h1 { 
    font-size: var(--text-4xl); 
    font-weight: 700;
    color: var(--text-primary);
}

h2 { 
    font-size: var(--text-3xl); 
    font-weight: 600;
}

h3 { 
    font-size: var(--text-2xl); 
    font-weight: 600;
}

h4 { font-size: var(--text-xl); font-weight: 600; }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 600; }

p {
    margin: 0;
    color: var(--text-secondary);
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover {
    color: var(--brand-secondary);
    text-decoration: underline;
}

/* ===================================
   4. LAYOUT COMPONENTS
   =================================== */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.main-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.main-content-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    min-width: 0;
}

.sidebar {
    display: flex;
    flex-direction: column;
    height: fit-content;
position: static;
    min-width: 0;
}

/* ===================================
   5. CARD COMPONENTS - UPDATED WITH IMPROVED HEADER
   =================================== */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-lg);
}

.card-premium {
    background: var(--bg-glass);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-brand);
    position: relative;
    overflow: hidden;
}

/* COMPACT & CENTERED COIN HEADER STYLES FROM PASTE.TXT */
.card-header {
    padding: clamp(0.75rem, 2vw, 1rem); /* Reduced padding */
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 1.5vw, 1rem); /* Reduced gap */
    min-height: auto;
    text-align: center;
    position: relative;
}

.card-header-main {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
}

.card-header-content {
    flex: 1;
    min-width: 0;
}

.card-header-title {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.2;
}

.card-header-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
    opacity: 0.8;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 32px; /* Compact button height */
}

.card-action-btn:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.card-action-btn.primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.card-action-btn.primary:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
}

.card-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ===================================
   6. BUTTON COMPONENTS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-base);
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-700);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

/* ===================================
   7. CHART COMPONENTS
   =================================== */

.chart-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    height: clamp(400px, 60vh, 600px);
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chart-section:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-xl);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    flex-wrap: wrap;
    gap: clamp(0.75rem, 2vw, 1rem);
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
    background: var(--bg-secondary);
    min-height: 80px;
    position: relative;
}


.chart-title-section {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1rem);
    min-width: 0;
    flex: 1;
}

.chart-title-info {
    min-width: 0;
    flex: 1;
}

.chart-title-info h1 {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
}

.chart-container {
    flex: 1;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    min-height: 0;
}

/* ===================================
   8. COIN COMPONENTS WITH ENHANCED FIXES
   =================================== */

.coin-logo-small {
    width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--bg-primary);
    background: var(--bg-primary);
    padding: 2px;
    flex-shrink: 0;
}

.coin-logo-small:hover {
    box-shadow: var(--shadow-lg);
}

.coin-symbol {
    color: var(--text-brand);
    font-weight: 700;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.price-info-inline {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 1rem);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.current-price {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
}

/* Header Top Section - Better Centering */
.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: clamp(0.5rem, 1.5vw, 0.75rem); /* Reduced gap */
}

/* Coin Main Info - Compact Layout */
.coin-main-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, 1.5vw, 0.75rem); /* Reduced gap */
    flex: none;
    text-align: center;
}

/* Coin Identity - Smaller Text */
.coin-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
}

/* SIGNIFICANTLY SMALLER COIN NAME */
.coin-name-enhanced {
    font-size: clamp(1rem, 2.5vw, 1.2rem); /* Much smaller - was 1.2rem, 3vw, 1.4rem */
    font-weight: 600; /* Reduced from 700 */
    color: var(--text-primary);
    margin-bottom: 0.2rem; /* Reduced margin */
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
}

/* SMALLER COIN SYMBOL */
.coin-symbol-enhanced {
    font-size: clamp(0.7rem, 1.5vw, 0.8rem); /* Smaller - was 0.8rem, 2vw, 0.9rem */
    color: var(--text-brand);
    font-weight: 600;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.6rem; /* Reduced padding */
    border-radius: var(--radius-full);
    display: inline-block;
    text-align: center;
}

/* SMALLER LOGO */
.coin-logo-enhanced {
    width: clamp(40px, 6vw, 48px); /* Smaller - was 48px, 8vw, 56px */
    height: clamp(40px, 6vw, 48px);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* ===================================
   9. PRICE CHANGE INDICATORS
   =================================== */

.price-change {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.6rem, 2vw, 1rem);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: clamp(0.8rem, 2vw, 1rem);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.price-change.positive {
    background: var(--green-100);
    color: var(--green-700);
    border: 1px solid var(--green-200);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.price-change.negative {
    background: var(--red-100);
    color: var(--red-700);
    border: 1px solid var(--red-200);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .price-change.positive {
    background: var(--green-900);
    color: var(--green-300);
    border-color: var(--green-700);
}

[data-theme="dark"] .price-change.negative {
    background: var(--red-900);
    color: var(--red-300);
    border-color: var(--red-700);
}

/* ===================================
   10. TIME BUTTONS
   =================================== */

.time-buttons {
    display: flex;
    gap: clamp(0.3rem, 1vw, 0.5rem);
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border: 2px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
}

.time-buttons::-webkit-scrollbar {
    display: none;
}

.time-btn {
    padding: clamp(0.4rem, 1.5vw, 0.5rem) clamp(0.6rem, 2vw, 1rem);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    white-space: nowrap;
    min-width: 44px;
    position: relative;
    overflow: hidden;
}

.time-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.time-btn.active {
    background: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-brand);
}

/* ===================================
   11. COIN INFO CARD
   =================================== */

.coin-info-card {
    background: linear-gradient(180deg, var(--bg-elevated), var(--bg-secondary));
    border-radius: var(--radius-2xl);
    padding: 0;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.coin-info-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--border-secondary);
}

.coin-cover-header {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--brand-primary), var(--accent-600));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.coin-cover-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: var(--space-lg);
}

.coin-logo-cover {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: var(--shadow-glow);
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: var(--space-md);
    background: white;
    padding: 4px;
}

.coin-logo-cover:hover {
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
}

.coin-name-cover {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.coin-ticker-cover {
    font-size: var(--text-lg);
    opacity: 0.95;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===================================
   12. STATS & PRICING
   =================================== */

.coin-price-section {
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-primary);
    text-align: center;
    position: relative;
}

/* Live Price Section - Compact */
.live-price-section {
    text-align: center;
    padding: clamp(0.75rem, 2vw, 1rem) 0; /* Reduced padding */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Price Display Container - Smaller */
.price-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.4rem, 1.5vw, 0.6rem); /* Reduced gap */
    max-width: 100%;
}

/* MUCH SMALLER CURRENT PRICE */
.current-price-enhanced {
    font-size: clamp(1.2rem, 3vw, 1.5rem); /* Much smaller - was 1.5rem, 3.5vw, 2rem */
    font-weight: 600; /* Reduced from 700 */
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem; /* Reduced gap */
    line-height: 1.2;
    margin: 0 auto;
    text-align: center;
    letter-spacing: -0.01em;
}

/* SMALLER PRICE INDICATOR */
.price-indicator {
    position: relative;
    width: 6px; /* Smaller - was 8px */
    height: 6px;
    border-radius: 50%;
    background: var(--green-500);
    box-shadow: 0 0 6px var(--green-500); /* Reduced glow */
    animation: pulse 2s infinite;
    flex-shrink: 0;
    margin-left: 0.2rem; /* Reduced margin */
}

.price-indicator.negative {
    background: var(--red-500);
    box-shadow: 0 0 6px var(--red-500);
}

/* SMALLER PRICE CHANGE DISPLAY */
.price-change-enhanced {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem; /* Reduced gap */
    padding: clamp(0.3rem, 1vw, 0.4rem) clamp(0.6rem, 2vw, 0.8rem); /* Reduced padding */
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: clamp(0.75rem, 1.8vw, 0.85rem); /* Smaller font */
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    margin: 0 auto;
    max-width: fit-content;
}

.price-value-main {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-feature-settings: 'tnum';
    margin-top: var(--space-sm);
}

.price-change-main {
    font-size: var(--text-lg);
    font-weight: 700;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    overflow: hidden;
}

.price-change-main.positive {
    background: var(--green-100);
    color: var(--green-700);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.25);
}

.price-change-main.negative {
    background: var(--red-100);
    color: var(--red-700);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .price-change-main.positive {
    background: var(--green-900);
    color: var(--green-300);
}

[data-theme="dark"] .price-change-main.negative {
    background: var(--red-900);
    color: var(--red-300);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
}

.stat-item {
    padding: var(--space-lg);
    text-align: center;
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.stat-item:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-feature-settings: 'tnum';
    position: relative;
    z-index: 2;
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

/* ===================================
   13. QUICK ACTIONS
   =================================== */

.quick-actions {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    display: flex;
    gap: var(--space-sm);
}

.action-btn-compact {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.action-btn-compact:hover {
    background: var(--primary-700);
    box-shadow: var(--shadow-lg);
}

.action-btn-compact.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
}

.action-btn-compact.secondary:hover {
    background: var(--bg-primary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

/* ===================================
   14. VOTING SYSTEM - UPDATED WITH IMPROVED HEADER
   =================================== */

.voting-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    padding: 0;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.voting-section:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-xl);
}

/* IMPROVED VOTING HEADER LAYOUT */
.voting-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    position: relative;
}

.voting-header-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.voting-title-section {
    flex: 1;
    min-width: 0;
}

.voting-title {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    line-height: 1.3;
}

.voting-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
}

.voting-actions-horizontal {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.voting-action-compact {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 36px;
}

.voting-action-compact:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.voting-action-compact svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.voting-action-compact.menu-toggle {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.voting-action-compact.menu-toggle:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
}

/* Legacy voting header styles - keeping for backward compatibility */
.voting-actions-collapsed {
    position: absolute;
    top: clamp(0.75rem, 2vw, 1rem);
    right: clamp(0.75rem, 2vw, 1rem);
    z-index: 10;
}

.menu-toggle {
    background: var(--brand-primary);
    border: none;
    border-radius: 50%;
    width: clamp(28px, 6vw, 32px);
    height: clamp(28px, 6vw, 32px);
    color: white;
    cursor: pointer;
    font-size: clamp(0.8rem, 2vw, 1rem);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.menu-toggle:hover {
    background: var(--primary-700);
    box-shadow: var(--shadow-lg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    min-width: clamp(140px, 30vw, 160px);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.75rem, 2vw, 1rem);
    background: none;
    border: none;
    text-align: left;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    overflow: hidden;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--brand-primary);
}

.voting-content {
    padding: var(--space-lg);
    background: var(--bg-elevated);
}

.price-chart-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: clamp(0.75rem, 2vw, 1rem);
    margin-bottom: var(--space-lg);
    border: 2px solid var(--border-primary);
}

.price-chart-section:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-sm);
}

.prediction-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.5rem, 2vw, 0.75rem);
    margin-bottom: var(--space-lg);
}

.prediction-btn {
    padding: clamp(0.75rem, 2vw, 1rem);
    border: 2px solid var(--border-primary);
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    cursor: pointer;
    text-align: center;
    color: var(--text-primary);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.prediction-btn:hover {
    border-color: var(--border-secondary);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

.prediction-btn.bullish.selected {
    background: var(--green-600);
    border-color: var(--green-600);
    color: white;
}

.prediction-btn.bearish.selected {
    background: var(--red-600);
    border-color: var(--red-600);
    color: white;
    box-shadow: var(--shadow-brand);
}

/* ===================================
   15. MARKETS TABLE - UPDATED WITH IMPROVED PAGINATION
   =================================== */

.markets-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.markets-section:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-xl);
}

.markets-header {
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    position: relative;
    padding-bottom: var(--space-md);
}


.markets-subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    font-weight: 500;
}

.markets-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
}

.markets-table-container:hover {
    border-color: var(--border-secondary);
}

.markets-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    overflow: hidden;
    background: var(--bg-elevated);
}

.markets-table th {
    background: var(--bg-secondary);
    padding: clamp(0.75rem, 2vw, 1rem);
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-primary);
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    white-space: nowrap;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.markets-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-primary);
}

.markets-table td {
    padding: clamp(0.75rem, 2vw, 1rem);
    border-bottom: 1px solid var(--border-primary);
    vertical-align: middle;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    color: var(--text-primary);
    font-weight: 500;
}

.markets-table tbody tr {
    position: relative;
}

.markets-table tbody tr:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

/* Enhanced exchange info layout without names */
.exchange-pair-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.exchange-info {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Enhanced exchange logo styling */
.exchange-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-primary);
    transition: all 0.2s ease;
    cursor: help; /* Show help cursor since we have tooltip */
}

.exchange-logo:hover {
    transform: scale(1.1);
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Enhanced pair link styling */
.pair-link {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    font-size: var(--text-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pair-link:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Mobile exchange info improvements */
.mobile-exchange-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.mobile-exchange-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-primary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mobile-exchange-logo:hover {
    transform: scale(1.05);
    border-color: var(--brand-primary);
}

.mobile-exchange-details {
    flex: 1;
    min-width: 0;
}

/* Enhanced mobile pair name styling */
.mobile-pair-name {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    display: inline-block;
}

/* Improved volume bars */
.volume-bar,
.mobile-volume-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
    position: relative;
}

.volume-fill,
.mobile-volume-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--primary-700));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.volume-fill::after,
.mobile-volume-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: white;
    opacity: 0.8;
    border-radius: 1px;
}

/* Enhanced liquidity indicators */
.liquidity-indicator,
.mobile-liquidity-badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.liquidity-indicator.high,
.mobile-liquidity-badge.high {
    background: var(--green-100);
    color: var(--green-700);
    border-color: var(--green-200);
}

.liquidity-indicator.medium,
.mobile-liquidity-badge.medium {
    background: var(--orange-100);
    color: var(--orange-700);
    border-color: var(--orange-200);
}

.liquidity-indicator.low,
.mobile-liquidity-badge.low {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

/* Dark theme adjustments */
[data-theme="dark"] .exchange-logo,
[data-theme="dark"] .mobile-exchange-logo {
    border-color: var(--border-primary);
}

[data-theme="dark"] .exchange-logo:hover,
[data-theme="dark"] .mobile-exchange-logo:hover {
    border-color: var(--primary-400);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .pair-link,
[data-theme="dark"] .mobile-pair-name {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .pair-link:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
}

[data-theme="dark"] .liquidity-indicator.high,
[data-theme="dark"] .mobile-liquidity-badge.high {
    background: var(--green-900);
    color: var(--green-300);
    border-color: var(--green-700);
}

[data-theme="dark"] .liquidity-indicator.medium,
[data-theme="dark"] .mobile-liquidity-badge.medium {
    background: var(--orange-900);
    color: var(--orange-300);
    border-color: var(--orange-700);
}

[data-theme="dark"] .liquidity-indicator.low,
[data-theme="dark"] .mobile-liquidity-badge.low {
    background: var(--gray-800);
    color: var(--gray-300);
    border-color: var(--gray-700);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .exchange-logo {
        width: 28px;
        height: 28px;
    }
    
    .mobile-exchange-logo {
        width: 32px;
        height: 32px;
    }
    
    .pair-link {
        font-size: var(--text-xs);
        padding: 0.2rem 0.4rem;
    }
    
    .mobile-pair-name {
        font-size: var(--text-xs);
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .exchange-logo {
        width: 24px;
        height: 24px;
    }
    
    .mobile-exchange-logo {
        width: 28px;
        height: 28px;
    }
}

/* IMPROVED MARKETS PAGINATION */
.markets-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin-top: 0;
    gap: var(--space-md);
    flex-wrap: wrap;
    min-height: 60px; /* Compact height */
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 40px; /* Compact button height */
    white-space: nowrap;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.pagination-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
}

.pagination-info-main {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--text-base);
}

.pagination-info-sub {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 500;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.pagination-jump-input {
    width: 60px;
    padding: var(--space-xs) var(--space-sm);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
}

.pagination-jump-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pagination-jump-btn {
    padding: var(--space-xs) var(--space-sm);
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-jump-btn:hover {
    background: var(--primary-700);
    transform: scale(1.05);
}

/* ===================================
   16. BADGE COMPONENTS
   =================================== */

.crypto-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-brand);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.crypto-badge:hover {
    box-shadow: var(--shadow-sm);
}

.crypto-badge.premium {
    background: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* ===================================
   17. LOADING & ERROR STATES
   =================================== */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    margin: 0 auto;
    margin-bottom: 1rem;
}

/* ===================================
   18. GLASSMORPHISM EFFECTS
   =================================== */

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .glass {
    background: rgba(15, 20, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   19. RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    :root {
        --text-4xl: 2rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
        --space-3xl: 3rem;
        --space-2xl: 2rem;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        order: -1;
    }
    
    .chart-section {
        height: clamp(350px, 50vh, 500px);
    }
    
    /* Responsive voting header */
    .voting-header-layout {
        gap: var(--space-md);
    }
    
    .voting-actions-horizontal {
        gap: var(--space-xs);
    }
    
    .voting-action-compact {
        padding: var(--space-sm);
        min-height: 36px;
    }
}

/* MOBILE RESPONSIVE - EVEN SMALLER */
@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
        --text-4xl: 1.875rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
        --space-3xl: 2rem;
        --space-2xl: 1.5rem;
        --space-xl: 1.5rem;
        --space-lg: 1rem;
    }
    
    .container {
        padding: 0 var(--space-sm);
    }
    
    .card {
        padding: var(--space-md);
        border-radius: var(--radius-lg);
    }
    
    .btn {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--text-sm);
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .chart-title-section {
        width: 100%;
    }
    
    .time-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .coin-cover-header {
        height: 160px;
    }
    
    .coin-logo-cover {
        width: 60px;
        height: 60px;
    }
    
    .coin-name-cover {
        font-size: var(--text-xl);
    }
    
    /* Mobile card header */
    .card-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .card-header-actions {
        justify-content: center;
    }
    
    /* Mobile voting header */
    .voting-header-layout {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .voting-actions-horizontal {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Mobile markets pagination */
    .markets-pagination {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-md);
        text-align: center;
    }
    
    .pagination-controls {
        order: 2;
        justify-content: center;
    }
    
    .pagination-info {
        order: 1;
    }
    
    .pagination-jump {
        order: 3;
        justify-content: center;
    }
    
    /* MOBILE RESPONSIVE HEADER STYLES FROM PASTE.TXT */
    .header-top {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .coin-main-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .coin-logo-enhanced {
        width: 36px; /* Even smaller on mobile */
        height: 36px;
    }
    
    .coin-name-enhanced {
        font-size: 0.95rem; /* Fixed smaller size */
        font-weight: 600;
    }
    
    .coin-symbol-enhanced {
        font-size: 0.7rem; /* Fixed smaller size */
        padding: 0.2rem 0.5rem;
    }
    
    .current-price-enhanced {
        font-size: 1.1rem; /* Fixed smaller size */
        font-weight: 600;
        gap: 0.25rem;
    }
    
    .price-indicator {
        width: 5px;
        height: 5px;
        margin-left: 0.15rem;
    }
    
    .price-change-enhanced {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    

    .live-price-section {
        padding: 0.75rem 0;
    }
}

/* EXTRA SMALL SCREENS */
@media (max-width: 480px) {
    :root {
        --text-4xl: 1.5rem;
        --text-3xl: 1.25rem;
        --space-2xl: 1rem;
        --space-xl: 1rem;
    }
    
    .card {
        padding: var(--space-sm);
    }
    
    .coin-cover-header {
        height: 140px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .coin-logo-enhanced {
        width: 32px;
        height: 32px;
    }
    
    .coin-name-enhanced {
        font-size: 0.9rem;
    }
    
    .coin-symbol-enhanced {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .current-price-enhanced {
        font-size: 1rem;
        gap: 0.2rem;
    }
    
    .price-indicator {
        width: 4px;
        height: 4px;
    }
    
    .price-change-enhanced {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .live-price-section {
        padding: 0.5rem 0;
    }
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
    .current-price-enhanced {
        font-weight: 700;
    }
    
    .coin-name-enhanced {
        font-weight: 700;
    }
    
    .price-indicator {
        border: 1px solid var(--text-primary);
    }
    
    .coin-symbol-enhanced {
        border: 1px solid var(--text-brand);
    }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .price-indicator {
        animation: none;
    }
    
    .coin-logo-enhanced:hover {
        transform: none;
    }
}

/* LANDSCAPE ORIENTATION ON SMALL SCREENS */
@media (orientation: landscape) and (max-height: 600px) {
    .live-price-section {
        padding: 0.5rem 0;
    }
    
    .current-price-enhanced {
        font-size: 1rem;
    }
    
    .card-header {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .coin-cover-image {
        height: 60px;
    }
}

/* ===================================
   20. ACCESSIBILITY
   =================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
    
    .price-indicator {
        animation: none;
    }
    
    .coin-logo-enhanced:hover {
        transform: none;
    }
}

/* FOCUS STYLES FOR ACCESSIBILITY */
.current-price-enhanced:focus,
.coin-main-info:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .price-indicator {
        border: 2px solid var(--text-primary);
    }
    
    .current-price-enhanced {
        font-weight: 800;
    }
    
    .coin-symbol-enhanced {
        border: 1px solid var(--text-brand);
    }
}

/* ===================================
   21. SCROLLBAR STYLES
   =================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--brand-secondary);
}

/* ===================================
   22. PRINT STYLES
   =================================== */

@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .btn {
        border: 1px solid black !important;
    }
    
    .card {
        border: 1px solid black !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .markets-pagination,
    .card-header-actions,
    .voting-actions-horizontal {
        display: none !important;
    }
    
    .price-indicator {
        display: none !important;
    }
    
    .current-price-enhanced {
        font-size: 1.2rem !important;
        color: black !important;
    }
    
    .coin-logo-enhanced {
        width: 32px !important;
        height: 32px !important;
    }
}

/* ===================================
   23. HIGH CONTRAST MODE
   =================================== */

@media (prefers-contrast: high) {
    :root {
        --border-primary: #000000;
        --border-secondary: #000000;
        --text-secondary: #000000;
        --text-tertiary: #000000;
    }
    
    [data-theme="dark"] {
        --border-primary: #ffffff;
        --border-secondary: #ffffff;
        --text-secondary: #ffffff;
        --text-tertiary: #ffffff;
    }
    
    .card,
    .btn {
        border: 2px solid currentColor;
    }
    
    .pagination-btn,
    .card-action-btn,
    .voting-action-compact {
        border-width: 3px;
    }
}

/* ===================================
   24. UTILITY CLASSES
   =================================== */

.canvasjs-chart-credit { 
    display: none !important; 
}

#chart-line-loading { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    z-index: 2; 
}

#chart-line-block { 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 100%; 
    width: 100%; 
    overflow: hidden; 
}

#apex_area1 { 
    position: relative; 
    width: 100%; 
    height: 100%; 
    z-index: 1; 
}

/* ===================================
   25. SEARCH HIGHLIGHTS
   =================================== */

.search-highlight {
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: 2px;
    padding: 0 2px;
}

[data-theme="dark"] .search-highlight {
    background: var(--primary-900);
    color: var(--primary-300);
}

/* ===================================
   26. TOOLTIPS
   =================================== */

.enhanced-tooltip {
    font-family: var(--font-sans);
}

/* ===================================
   27. SKIP LINKS - REMOVED
   =================================== */

/* ===================================
   28. KEYBOARD NAVIGATION
   =================================== */

.keyboard-navigation *:focus {
    outline: 3px solid var(--brand-primary) !important;
    outline-offset: 2px !important;
}

/* ===================================
   29. SEARCH RESULTS
   =================================== */

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.search-results-count {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-primary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-secondary);
    color: var(--brand-primary);
}

.search-result-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: 2px;
}

.search-result-symbol {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.search-result-price {
    text-align: right;
}

.search-result-price-value {
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: 2px;
}

.search-result-change {
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ===================================
   30. THEME TOAST
   =================================== */

.theme-toast {
    font-family: var(--font-sans);
}

/* ===================================
   31. HEADER SCROLLED STATE
   =================================== */

.modern-header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: var(--z-sticky);
    height: var(--header-height);
}

.modern-header.scrolled {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: var(--shadow-xl) !important;
}

/* ===================================
   32. TRENDING TICKER
   =================================== */

.trending-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-sm) 0;
    overflow: hidden;
    z-index: 1000;
}

/* ===================================
   NEW: ENHANCED COIN INFO CARD WITH COVER IMAGE
   =================================== */

/* Enhanced Coin Info Card with Cover Image */
.enhanced-coin-card {
    width: 100%;
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Cover Image Height */
.coin-cover-image {
    position: relative;
    height: 120px; /* Reduced from 120px */
    background: url('https://pbs.twimg.com/profile_banners/357312062/1566845268/1500x500') center/cover no-repeat;
    overflow: hidden;
}

/* Light theme overlay adjustment */
[data-theme="light"] .coin-cover-image {
    background: url('https://pbs.twimg.com/profile_banners/357312062/1566845268/1500x500') center/cover no-repeat;
}

/* Fallback for when image fails to load */
.coin-cover-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--primary-600) 0%, 
        var(--accent-600) 30%,
        var(--brand-gold-500) 70%,
        var(--primary-700) 100%);
    z-index: -1;
}

/* Enhanced overlay for better text readability */
.cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    z-index: 3;
}


/* Animated Background Pattern */
.card-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--primary-600) 0%, 
        var(--accent-600) 30%,
        var(--brand-gold-500) 70%,
        var(--primary-700) 100%);
    opacity: 0.05;
    z-index: 0;
}

.card-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

/* Header Section */
.header-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.action-button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    transform: scale(1.1);
}

/* Price Change Icons */
.price-change-enhanced svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Enhanced Price Info Layout */
.price-info-inline {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 1.5rem);
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Price Value Styling */
.price-value-main {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-feature-settings: 'tnum';
    text-align: center;
    line-height: 1;
    position: relative;
}

.coin-logo-wrapper {
    position: relative;
    flex-shrink: 0;
}

.rank-badge-enhanced {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--brand-primary), var(--primary-700));
    color: white;
    border-radius: var(--radius-full);
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--bg-primary);
    box-shadow: var(--shadow-md);
    min-width: 32px;
    text-align: center;
    z-index: 3;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.price-change-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.1;
    z-index: 0;
}

.price-change-enhanced > * {
    position: relative;
    z-index: 1;
}

.price-change-enhanced.positive {
    background: linear-gradient(135deg, var(--green-100), var(--green-50));
    color: var(--green-700);
    border: 1px solid var(--green-300);
}

.price-change-enhanced.negative {
    background: linear-gradient(135deg, var(--red-100), var(--red-50));
    color: var(--red-700);
    border: 1px solid var(--red-300);
}

[data-theme="dark"] .price-change-enhanced.positive {
    background: linear-gradient(135deg, var(--green-900), var(--green-800));
    color: var(--green-300);
    border-color: var(--green-700);
}

[data-theme="dark"] .price-change-enhanced.negative {
    background: linear-gradient(135deg, var(--red-900), var(--red-800));
    color: var(--red-300);
    border-color: var(--red-700);
}

.performance-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.performance-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.metric-item {
    background: var(--bg-primary);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-primary);
    transition: all 0.2s ease;
    z-index: 1;
}

.metric-item:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

.metric-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--green-400);
    margin-bottom: 2px;
}

.metric-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Social Links Enhanced */
.social-section {
    padding: var(--space-lg);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
}

.social-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-align: center;
}

.social-links-enhanced {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.social-link-enhanced {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--brand-primary);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.social-link-enhanced:hover::before {
    width: 100%;
    height: 100%;
}

.social-link-enhanced:hover {
    color: white;
    border-color: var(--brand-primary);
    transform: translateY(-4px);
}

.social-link-enhanced svg {
    position: relative;
    z-index: 1;
}

/* Mobile Markets Card Layout */
.mobile-markets-cards {
    display: none;
}

.mobile-market-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.mobile-market-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.mobile-market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.mobile-market-rank {
    background: var(--brand-primary);
    color: white;
    font-weight: 700;
    font-size: var(--text-xs);
    padding: 4px 8px;
    border-radius: var(--radius-full);
    min-width: 24px;
    text-align: center;
}

.mobile-market-price {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-exchange-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.mobile-exchange-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-exchange-details h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.mobile-pair-name {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin: 0;
}

.mobile-market-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.mobile-stat-item {
    text-align: center;
    padding: var(--space-xs);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.mobile-stat-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.mobile-stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-volume-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.mobile-volume-fill {
    height: 100%;
    background: var(--brand-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.mobile-liquidity-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
}

.mobile-liquidity-badge.high {
    background: var(--green-100);
    color: var(--green-700);
}

.mobile-liquidity-badge.medium {
    background: var(--orange-100);
    color: var(--orange-700);
}

.mobile-liquidity-badge.low {
    background: var(--gray-100);
    color: var(--gray-700);
}

[data-theme="dark"] .mobile-liquidity-badge.high {
    background: var(--green-900);
    color: var(--green-300);
}

[data-theme="dark"] .mobile-liquidity-badge.medium {
    background: var(--orange-900);
    color: var(--orange-300);
}

[data-theme="dark"] .mobile-liquidity-badge.low {
    background: var(--gray-800);
    color: var(--gray-300);
}

/* Mobile Layout Ordering */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .sidebar {
        position: static;
        display: flex;
        flex-direction: column;
        order: 2; /* Place sidebar after main content on mobile */
    }
    
    .main-content-area {
        order: 1; /* Place main content first on mobile */
    }
}

/* Responsive Design for Enhanced Coin Card */
@media (max-width: 768px) {
    .enhanced-coin-card {
        margin: 0 0 var(--space-xl) 0;
        border-radius: var(--radius-xl);
    }

    .performance-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }
    
    .metric-item {
        padding: var(--space-xs);
    }
    
    .social-link-enhanced {
        width: 40px;
        height: 40px;
    }
    
    /* Show mobile markets layout */
    .markets-table-container {
        display: none;
    }
    
    .mobile-markets-cards {
        display: block;
    }
}

@media (max-width: 480px) {
    
    .social-links-enhanced {
        gap: var(--space-xs);
    }
    
    .social-link-enhanced {
        width: 36px;
        height: 36px;
    }
}

/* Hide old coin info card styles to prevent conflicts */
.coin-info-card,
.coin-cover-header,
.cover-gradient,
.coin-cover-content,
.coin-logo-cover,
.coin-rank-badge,
.coin-name-cover,
.coin-ticker-cover,
.coin-social-links,
.social-link,
.stats-grid,
.stat-item,
.stat-value,
.stat-label {
    display: none !important;
}
/* ===================================
   MODAL SYSTEM STYLES - ADD TO GLOBAL-STYLES.CSS
   =================================== */

/* Modal Overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: var(--space-md);
    box-sizing: border-box;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.7);
}

/* Modal Content */
.modal-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    border-top-left-radius: var(--radius-2xl);
    border-top-right-radius: var(--radius-2xl);
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Balance Modal Specific Styles */
.balance-info {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--bg-primary);
}

.balance-amount {
    font-size: var(--text-4xl);
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: var(--space-sm);
    font-feature-settings: 'tnum';
}

.balance-label {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    font-weight: 600;
}

.balance-actions {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-xl);
    background: var(--bg-secondary);
}

.balance-action-btn {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.balance-action-btn:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
}

.balance-action-btn.deposit {
    background: var(--green-600);
}

.balance-action-btn.deposit:hover {
    background: var(--green-700);
}

/* Stats Modal Styles */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    padding: var(--space-xl);
    background: var(--bg-primary);
}

.stat-card {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: var(--space-xs);
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* History Section */
.history-section {
    padding: var(--space-xl);
    background: var(--bg-primary);
}

.history-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-lg);
}

.history-tab {
    flex: 1;
    padding: var(--space-md);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.history-tab.active {
    color: var(--brand-primary);
}

.history-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2px;
    background: var(--brand-primary);
    border-radius: 1px;
}

.history-content {
    display: none;
}

.history-content.active {
    display: block;
}

.history-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-primary);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.history-title {
    font-weight: 700;
    color: var(--text-primary);
}

.history-date {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-md);
}

.history-stat {
    text-align: center;
}

.history-stat-value {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.history-stat-label {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Toast Notification for Modals */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--brand-primary);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: calc(var(--z-modal) + 10);
    font-weight: 600;
    max-width: 400px;
    word-wrap: break-word;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: var(--green-600);
}

.toast.error {
    background: var(--red-600);
}

.toast.info {
    background: var(--primary-600);
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .modal {
        padding: var(--space-sm);
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: var(--radius-xl);
    }
    
    .modal-header {
        padding: var(--space-lg);
        border-top-left-radius: var(--radius-xl);
        border-top-right-radius: var(--radius-xl);
    }
    
    .modal-title {
        font-size: var(--text-lg);
    }
    
    .balance-info {
        padding: var(--space-xl);
    }
    
    .balance-amount {
        font-size: var(--text-3xl);
    }
    
    .balance-actions {
        flex-direction: column;
        padding: var(--space-lg);
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        padding: var(--space-lg);
    }
    
    .history-section {
        padding: var(--space-lg);
    }
    
    .history-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toast {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
        transform: translateY(100%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: var(--space-md);
    }
    
    .balance-info {
        padding: var(--space-lg);
    }
    
    .balance-amount {
        font-size: var(--text-2xl);
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
        padding: var(--space-md);
    }
    
    .history-section {
        padding: var(--space-md);
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .history-tabs {
        flex-direction: column;
    }
    
    .history-tab {
        text-align: left;
        border-bottom: 1px solid var(--border-primary);
    }
    
    .history-tab:last-child {
        border-bottom: none;
    }
    
    .history-tab.active::after {
        left: 0;
        transform: none;
        width: 4px;
        height: 100%;
        top: 0;
        bottom: auto;
    }
}

/* Accessibility Improvements */
.modal[aria-hidden="true"] {
    display: none;
}

.modal-content:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Dark Theme Specific Adjustments */
[data-theme="dark"] .modal-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .toast {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pagination-btn {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-secondary);
}

[data-theme="dark"] .pagination-btn:hover:not(:disabled) {
    background: var(--primary-600);
    border-color: var(--primary-600);
}

[data-theme="dark"] .card-header {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-primary);
}

[data-theme="dark"] .voting-header {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-primary);
}

/* Animation Performance */
@media (prefers-reduced-motion: reduce) {
    .modal,
    .modal-content,
    .toast,
    .pagination-btn,
    .card-action-btn,
    .voting-action-compact {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .modal {
        display: none !important;
    }
}

/* ===================================
   ENHANCED DARK MODE FOR VOTING POOLS
   =================================== */

/* Voting Section Dark Mode */
[data-theme="dark"] .voting-section {
    background: var(--bg-elevated);
    border-color: var(--border-primary);
}

[data-theme="dark"] .voting-header {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-primary);
}

[data-theme="dark"] .voting-title {
    color: var(--text-primary);
}

/* Pool Options Dark Mode */
[data-theme="dark"] .pool-option {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .pool-option:hover {
    background: var(--bg-primary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .pool-option.selected {
    background: var(--primary-600);
    border-color: var(--primary-500);
    color: white;
}

/* Pool Header Elements Dark Mode */
[data-theme="dark"] .pool-title {
    color: var(--text-primary);
}

[data-theme="dark"] .pool-timer {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .pool-option.selected .pool-timer {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Learn More Button Dark Mode */
[data-theme="dark"] .learn-more-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .learn-more-btn:hover,
[data-theme="dark"] .learn-more-btn.expanded {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-500);
}

[data-theme="dark"] .pool-option.selected .learn-more-btn {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Pool Details Dark Mode */
[data-theme="dark"] .pool-details {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .pool-details.show {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .pool-option.selected .pool-details.show {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .pool-question {
    background: var(--primary-900);
    color: var(--primary-300);
    border-color: var(--primary-700);
}

[data-theme="dark"] .pool-option.selected .pool-question {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .pool-date-row {
    color: var(--text-secondary);
}

[data-theme="dark"] .pool-option.selected .pool-date-row {
    color: rgba(255, 255, 255, 0.8);
}

/* Progress Bars Dark Mode */
[data-theme="dark"] .progress-bar {
    background: var(--bg-primary);
}

[data-theme="dark"] .pool-option.selected .progress-bar {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .progress-fill {
    background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
}

[data-theme="dark"] .pool-option.selected .progress-fill {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6)) !important;
}

[data-theme="dark"] .progress-label,
[data-theme="dark"] .progress-percentage {
    color: var(--text-secondary);
}

[data-theme="dark"] .pool-option.selected .progress-label,
[data-theme="dark"] .pool-option.selected .progress-percentage {
    color: rgba(255, 255, 255, 0.9);
}

/* Pool Stats Dark Mode */
[data-theme="dark"] .pool-stat {
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .pool-option.selected .pool-stat {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .pool-stat-value,
[data-theme="dark"] .pool-stat-label {
    color: var(--text-primary);
}

[data-theme="dark"] .pool-option.selected .pool-stat-value,
[data-theme="dark"] .pool-option.selected .pool-stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Tier Badges Dark Mode */
[data-theme="dark"] .tier-early {
    background: var(--green-900);
    color: var(--green-300);
}

[data-theme="dark"] .tier-standard {
    background: var(--primary-900);
    color: var(--primary-300);
}

[data-theme="dark"] .pool-option.selected .tier-early,
[data-theme="dark"] .pool-option.selected .tier-standard {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

/* Prediction Buttons Dark Mode */
[data-theme="dark"] .prediction-btn {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .prediction-btn:hover {
    background: var(--bg-primary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .prediction-btn.bullish.selected {
    background: var(--green-600);
    border-color: var(--green-500);
    color: white;
}

[data-theme="dark"] .prediction-btn.bearish.selected {
    background: var(--red-600);
    border-color: var(--red-500);
    color: white;
}

/* Amount Section Dark Mode */
[data-theme="dark"] .amount-input {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .amount-input:focus {
    background: var(--bg-primary);
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .currency-label {
    color: var(--text-tertiary);
}

[data-theme="dark"] .submit-btn {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
}

[data-theme="dark"] .submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .submit-btn:disabled {
    background: var(--gray-600);
    color: var(--gray-400);
}

/* Estimated Win Dark Mode */
[data-theme="dark"] .estimated-win {
    background: linear-gradient(135deg, var(--green-900) 0%, var(--primary-900) 100%);
    border-color: var(--green-700);
}


[data-theme="dark"] .estimated-win-title {
    color: var(--text-secondary);
}

[data-theme="dark"] .estimated-win-amount {
    color: var(--green-400);
}

[data-theme="dark"] .estimated-win-multiplier {
    color: var(--primary-400);
}

/* Price Chart Section Dark Mode */
[data-theme="dark"] .price-chart-section {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .price-chart-section:hover {
    border-color: var(--border-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mini Chart Dark Mode */
[data-theme="dark"] .mini-chart-svg path {
    stroke: var(--green-400);
}

[data-theme="dark"] .mini-chart-svg path[fill] {
    fill: rgba(52, 211, 153, 0.2);
}

/* Menu Toggle Dark Mode */
[data-theme="dark"] .menu-toggle {
    background: var(--primary-600);
    border: 1px solid var(--primary-500);
}

[data-theme="dark"] .menu-toggle:hover {
    background: var(--primary-500);
    border-color: var(--primary-400);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Dropdown Menu Dark Mode */
[data-theme="dark"] .dropdown-menu {
    background: var(--bg-elevated);
    border-color: var(--border-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-secondary);
    border-bottom-color: var(--border-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-400);
}

[data-theme="dark"] .dropdown-item:last-child {
    border-bottom: none;
}

/* Positions Available Dark Mode */
[data-theme="dark"] .positions-available {
    background: var(--orange-900);
    border-color: var(--orange-700);
}

[data-theme="dark"] .positions-count {
    color: var(--orange-300);
}

/* Section Title Dark Mode */
[data-theme="dark"] .section-title {
    color: var(--text-primary);
}

/* Modal Dark Mode Improvements */
[data-theme="dark"] .modal-content {
    background: var(--bg-elevated);
    border-color: var(--border-primary);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-header {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-primary);
}

[data-theme="dark"] .modal-title {
    color: var(--text-primary);
}

[data-theme="dark"] .close-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Balance Modal Dark Mode */
[data-theme="dark"] .balance-info {
    background: var(--bg-primary);
}

[data-theme="dark"] .balance-amount {
    color: var(--primary-400);
}

[data-theme="dark"] .balance-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .balance-actions {
    background: var(--bg-secondary);
}

[data-theme="dark"] .balance-action-btn {
    background: var(--primary-600);
    color: white;
}

[data-theme="dark"] .balance-action-btn:hover {
    background: var(--primary-500);
}

[data-theme="dark"] .balance-action-btn.deposit {
    background: var(--green-600);
}

[data-theme="dark"] .balance-action-btn.deposit:hover {
    background: var(--green-500);
}

/* Stats Modal Dark Mode */
[data-theme="dark"] .stats-overview {
    background: var(--bg-primary);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .stat-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .stat-value {
    color: var(--primary-400);
}

[data-theme="dark"] .stat-label {
    color: var(--text-secondary);
}

/* History Section Dark Mode */
[data-theme="dark"] .history-section {
    background: var(--bg-primary);
}

[data-theme="dark"] .history-tabs {
    border-bottom-color: var(--border-primary);
    background: var(--bg-secondary);
}

[data-theme="dark"] .history-tab {
    color: var(--text-secondary);
    background: transparent;
}

[data-theme="dark"] .history-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

[data-theme="dark"] .history-tab.active {
    color: var(--primary-400);
    background: var(--bg-primary);
}

[data-theme="dark"] .history-tab.active::after {
    background: var(--primary-400);
}

[data-theme="dark"] .history-item {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .history-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .history-title {
    color: var(--text-primary);
}

[data-theme="dark"] .history-date {
    color: var(--text-tertiary);
}

[data-theme="dark"] .history-stat-value {
    color: var(--text-primary);
}

[data-theme="dark"] .history-stat-label {
    color: var(--text-secondary);
}

/* Toast Dark Mode */
[data-theme="dark"] .voting-toast {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Jobs page dark mode styles */
[data-theme="dark"] .job-card {
    background: var(--bg-elevated);
    border-color: var(--border-primary);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Focus styles for accessibility */
.pagination-btn:focus,
.card-action-btn:focus,
.voting-action-compact:focus {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
}

.voting-dropdown-item:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: -2px;
}

/* ===========================================
   ENHANCED DARK MODE FOR MODALS & UI FIXES
   =========================================== */

/* ===================================
   1. IMPROVED MODAL DARK MODE STYLES
   =================================== */

/* Enhanced Modal Overlay for Dark Mode */
[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Enhanced Modal Content Dark Mode */
[data-theme="dark"] .modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
}

/* Enhanced Modal Header Dark Mode */
[data-theme="dark"] .modal-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-title {
    color: var(--text-primary);
}

[data-theme="dark"] .close-btn {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 50%;
}

[data-theme="dark"] .close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

/* Enhanced Balance Modal Dark Mode */
[data-theme="dark"] .balance-info {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
}

[data-theme="dark"] .balance-amount {
    color: var(--primary-400);
}

[data-theme="dark"] .balance-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .balance-actions {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
}

[data-theme="dark"] .balance-action-btn {
    background: var(--primary-600);
    color: white;
    border: 1px solid var(--primary-500);
}

[data-theme="dark"] .balance-action-btn:hover {
    background: var(--primary-500);
    border-color: var(--primary-400);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .balance-action-btn.deposit {
    background: var(--green-600);
    border-color: var(--green-500);
}

[data-theme="dark"] .balance-action-btn.deposit:hover {
    background: var(--green-500);
    border-color: var(--green-400);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Enhanced Stats Modal Dark Mode */
[data-theme="dark"] .stats-overview {
    background: var(--bg-primary);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .stat-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .stat-value {
    color: var(--primary-400);
}

[data-theme="dark"] .stat-label {
    color: var(--text-secondary);
}

/* Enhanced History Section Dark Mode */
[data-theme="dark"] .history-section {
    background: var(--bg-primary);
}

[data-theme="dark"] .history-tabs {
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

[data-theme="dark"] .history-tab {
    color: var(--text-secondary);
    background: transparent;
}

[data-theme="dark"] .history-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

[data-theme="dark"] .history-tab.active {
    color: var(--primary-400);
    background: var(--bg-primary);
}

[data-theme="dark"] .history-tab.active::after {
    background: var(--primary-400);
}

[data-theme="dark"] .history-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .history-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .history-title {
    color: var(--text-primary);
}

[data-theme="dark"] .history-date {
    color: var(--text-tertiary);
}

[data-theme="dark"] .history-stat-value {
    color: var(--text-primary);
}

[data-theme="dark"] .history-stat-label {
    color: var(--text-secondary);
}

/* ===================================
   2. ENHANCED PRICE DISPLAY STYLES
   =================================== */

/* Improved Current Price Display */
.current-price-enhanced {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    line-height: 1.2;
    margin: 0 auto;
    text-align: center;
    letter-spacing: -0.01em;
}

/* Enhanced Price Indicator */
.price-indicator {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-500);
    box-shadow: 0 0 6px var(--green-500);
    animation: price-pulse 2s infinite;
    flex-shrink: 0;
    margin-left: 0.2rem;
}

@keyframes price-pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.3); 
    }
}

.price-indicator.negative {
    background: var(--red-500);
    box-shadow: 0 0 6px var(--red-500);
}

/* Enhanced Price Change Display */
.price-change-enhanced {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: clamp(0.3rem, 1vw, 0.4rem) clamp(0.6rem, 2vw, 0.8rem);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    margin: 0 auto;
    max-width: fit-content;
}

.price-change-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.1;
    z-index: 0;
}

.price-change-enhanced > * {
    position: relative;
    z-index: 1;
}

.price-change-enhanced.positive {
    background: linear-gradient(135deg, var(--green-100) 0%, var(--green-50) 100%);
    color: var(--green-700);
    border-color: var(--green-300);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.price-change-enhanced.negative {
    background: linear-gradient(135deg, var(--red-100) 0%, var(--red-50) 100%);
    color: var(--red-700);
    border-color: var(--red-300);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .price-change-enhanced.positive {
    background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
    color: var(--green-300);
    border-color: var(--green-700);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .price-change-enhanced.negative {
    background: linear-gradient(135deg, var(--red-900) 0%, var(--red-800) 100%);
    color: var(--red-300);
    border-color: var(--red-700);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Price Change Icons */
.price-change-enhanced svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Enhanced Price Info Layout */
.price-info-inline {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 1.5rem);
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Price Display Container */
.price-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.4rem, 1.5vw, 0.6rem);
    max-width: 100%;
}


/* Price Value Styling */
.price-value-main {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-feature-settings: 'tnum';
    text-align: center;
    line-height: 1;
    position: relative;
}

/* ===================================
   3. ENHANCED VOTING SYSTEM FIXES
   =================================== */

/* Enhanced Voting Title Styling */
.voting-title {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    line-height: 1.3;
    text-align: center;
    padding: 0 1rem;
}

.voting-title .title-line {
    display: block;
    margin: 0.2rem 0;
}

[data-theme="dark"] .voting-title {
    color: var(--text-primary);
}

/* Enhanced Pool Selection Styling */
.pool-option {
    background: var(--bg-elevated);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pool-option:hover::before {
    background: var(--primary-500);
}

.pool-option.selected {
    border-color: var(--primary-500);
    background: var(--primary-600);
    color: white;
    box-shadow: var(--shadow-xl);
}

[data-theme="dark"] .pool-option {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .pool-option:hover {
    background: var(--bg-primary);
    border-color: var(--border-secondary);
}

[data-theme="dark"] .pool-option.selected {
    background: var(--primary-600);
    border-color: var(--primary-500);
    color: white;
}

/* Enhanced Amount Section */
.amount-input {
    width: 100%;
    padding: 1.2rem 4rem 1.2rem 1.5rem;
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-xl);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.amount-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: var(--bg-primary);
}

[data-theme="dark"] .amount-input {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .amount-input:focus {
    background: var(--bg-primary);
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Enhanced Currency Label */
.currency-label {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .currency-label {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
    color: var(--text-tertiary);
}

/* Enhanced Submit Button */
.submit-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.submit-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

[data-theme="dark"] .submit-btn {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
}

[data-theme="dark"] .submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

/* Enhanced Estimated Win Display */
.estimated-win {
    background: linear-gradient(135deg, var(--green-50) 0%, var(--primary-50) 100%);
    border: 2px solid var(--green-200);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.estimated-win-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.estimated-win-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--green-600);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}

.estimated-win-multiplier {
    font-size: 0.85rem;
    color: var(--primary-600);
    font-weight: 700;
}

[data-theme="dark"] .estimated-win {
    background: linear-gradient(135deg, var(--green-900) 0%, var(--primary-900) 100%);
    border-color: var(--green-700);
}

[data-theme="dark"] .estimated-win-title {
    color: var(--text-secondary);
}

[data-theme="dark"] .estimated-win-amount {
    color: var(--green-400);
}

[data-theme="dark"] .estimated-win-multiplier {
    color: var(--primary-400);
}

/* ===================================
   4. RESPONSIVE IMPROVEMENTS
   =================================== */

@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        max-height: 95vh;
        border-radius: var(--radius-xl);
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .balance-info {
        padding: 1.5rem;
    }
    
    .balance-amount {
        font-size: 2.5rem;
    }
    
    .balance-actions {
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .balance-action-btn {
        width: 100%;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
        gap: 1rem;
    }
    
    .current-price-enhanced {
        font-size: 1.1rem;
    }
    
    .price-change-enhanced {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .amount-input {
        font-size: 1.2rem;
        padding: 1rem 3.5rem 1rem 1.2rem;
    }
    
    .currency-label {
        font-size: 1rem;
        right: 1.2rem;
    }
    
    .submit-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .estimated-win {
        padding: 1.2rem;
    }
    
    .estimated-win-amount {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        border-radius: var(--radius-lg);
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .balance-info {
        padding: 1rem;
    }
    
    .balance-amount {
        font-size: 2rem;
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }
    
    .voting-title {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    
    .pool-option {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .amount-input {
        font-size: 1.1rem;
        padding: 0.9rem 3rem 0.9rem 1rem;
    }
    
    .currency-label {
        font-size: 0.9rem;
        right: 1rem;
    }
    
    .submit-btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .estimated-win {
        padding: 1rem;
    }
    
    .estimated-win-amount {
        font-size: 1.6rem;
    }
    
    .price-change-enhanced {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .current-price-enhanced {
        font-size: 1rem;
    }
    
    .price-indicator {
        width: 4px;
        height: 4px;
    }
}

/* ===================================
   5. ACCESSIBILITY IMPROVEMENTS
   =================================== */

.modal:focus-within {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.balance-action-btn:focus,
.submit-btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.amount-input:focus {
    outline: none;
}

.pool-option:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modal-content,
    .balance-info,
    .stats-overview,
    .pool-option,
    .estimated-win {
        border-width: 2px;
    }
    
    .price-change-enhanced {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .price-indicator {
        animation: none;
    }
    
    .submit-btn::before {
        display: none;
    }
    
    .pool-option,
    .submit-btn,
    .balance-action-btn {
        transition: none;
    }
}

/* Print styles */
@media print {
    .modal {
        display: none !important;
    }
}
/* ===================================
   CENTERED COIN CARD LAYOUT STYLES
   =================================== */

/* Replace the existing card-header styles with these centered versions */

/* Reduced size card header with logo moved higher */
.card-header-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Changed from center to flex-start */
    text-align: center;
    gap: clamp(0.5rem, 1.5vw, 0.75rem); /* Reduced from 1rem-1.5rem */
    position: relative;
    min-height: auto; /* Remove fixed height */
    top: -30px;
}

/* Coin Logo Section - Centered */
.coin-logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.coin-logo-wrapper-centered {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin-logo-centered {
width: clamp(80px, 15vw, 64px);
  height: clamp(80px, 15vw, 64px);
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  object-fit: cover;
}


.rank-badge-centered {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--brand-primary), var(--primary-700));
    color: white;
    border-radius: var(--radius-full);
    padding: 6px 12px;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 700;
    border: 3px solid var(--bg-primary);
    box-shadow: var(--shadow-md);
    min-width: 40px;
    text-align: center;
    z-index: 3;
    line-height: 1;
}

/* Coin Identity - Centered */
.coin-identity-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 0.75rem);
    text-align: center;
    max-width: 100%;
}

.coin-name-centered {
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    text-align: center;
    letter-spacing: -0.02em;
    max-width: 100%;
    word-break: break-word;
}

.coin-symbol-centered {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--text-brand);
    font-weight: 700;
    background: var(--bg-tertiary);
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.coin-symbol-centered:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    transform: scale(1.05);
}

/* Price Section - Centered */
.price-section-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1rem);
    text-align: center;
    width: 100%;
}

.current-price-centered {
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1;
    text-align: center;
    letter-spacing: -0.02em;
    font-family: var(--font-mono);
}


@keyframes pulse-centered {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.4); 
    }
}

.price-change-centered {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    max-width: fit-content;
    box-shadow: var(--shadow-md);
}

.price-change-centered.positive {
    background: linear-gradient(135deg, var(--green-100) 0%, var(--green-50) 100%);
    color: var(--green-700);
    border-color: var(--green-300);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.25);
}

.price-change-centered.negative {
    background: linear-gradient(135deg, var(--red-100) 0%, var(--red-50) 100%);
    color: var(--red-700);
    border-color: var(--red-300);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .price-change-centered.positive {
    background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
    color: var(--green-300);
    border-color: var(--green-700);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .price-change-centered.negative {
    background: linear-gradient(135deg, var(--red-900) 0%, var(--red-800) 100%);
    color: var(--red-300);
    border-color: var(--red-700);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.price-change-centered svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Quick Actions - Centered */
.quick-actions-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 2vw, 1rem);
    flex-wrap: wrap;
    margin-top: clamp(0.5rem, 2vw, 1rem);
}

.action-btn-centered {
    width: clamp(44px, 10vw, 52px);
    height: clamp(44px, 10vw, 52px);
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.action-btn-centered::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--brand-primary);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.action-btn-centered:hover::before {
    width: 120%;
    height: 120%;
}

.action-btn-centered:hover {
    color: white;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-btn-centered svg {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    
    .coin-logo-centered {
        width: clamp(70px, 18vw, 90px);
        height: clamp(70px, 18vw, 90px);
        border-width: 3px;
    }
    
    .rank-badge-centered {
        padding: 4px 8px;
        font-size: 0.75rem;
        min-width: 32px;
        top: -6px;
        right: -6px;
    }
    
    .coin-name-centered {
        font-size: clamp(1.25rem, 6vw, 1.75rem);
    }
    
    .coin-symbol-centered {
        font-size: clamp(0.875rem, 3vw, 1rem);
        padding: clamp(0.4rem, 2vw, 0.6rem) clamp(0.8rem, 3vw, 1.2rem);
    }
    
    .current-price-centered {
        font-size: clamp(1.5rem, 8vw, 2.25rem);
        gap: 0.4rem;
    }

    .price-change-centered {
        font-size: clamp(0.75rem, 3vw, 0.95rem);
        padding: clamp(0.4rem, 2vw, 0.6rem) clamp(0.8rem, 3vw, 1.2rem);
    }
    
    .quick-actions-centered {
        gap: clamp(0.5rem, 2vw, 0.75rem);
        margin-top: clamp(0.75rem, 2vw, 1rem);
    }
    
    .action-btn-centered {
        width: clamp(40px, 12vw, 46px);
        height: clamp(40px, 12vw, 46px);
    }
}

@media (max-width: 480px) {
    
    .coin-logo-centered {
        width: 64px;
        height: 64px;
        border-width: 2px;
    }
    
    .rank-badge-centered {
        padding: 3px 6px;
        font-size: 0.7rem;
        min-width: 28px;
        top: -4px;
        right: -4px;
        border-width: 2px;
    }
    
    .coin-name-centered {
        font-size: 1.2rem;
    }
    
    .coin-symbol-centered {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .current-price-centered {
        font-size: 1.4rem;
        gap: 0.3rem;
    }

    .price-change-centered {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .action-btn-centered {
        width: 38px;
        height: 38px;
    }
    
    .action-btn-centered svg {
        width: 14px;
        height: 14px;
    }
}



[data-theme="dark"] .rank-badge-centered {
    border-color: var(--bg-primary);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
}

[data-theme="dark"] .coin-symbol-centered {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .action-btn-centered {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .action-btn-centered:hover {
    border-color: var(--primary-500);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .coin-logo-centered,
    .coin-symbol-centered,
    .price-change-centered,
    .action-btn-centered {
        border-width: 3px;
    }
    
    .coin-name-centered,
    .current-price-centered {
        font-weight: 900;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .coin-logo-centered:hover,
    .coin-symbol-centered:hover,
    .action-btn-centered:hover {
        transform: none;
    }
    
    .action-btn-centered::before {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .quick-actions-centered {
        display: none !important;
    }

    .card-header-centered {
        background: white !important;
        border-bottom: 1px solid #000 !important;
    }
    
    .coin-name-centered,
    .current-price-centered {
        color: black !important;
    }
}

/* ===================================
   CARD HEIGHT FIXES - Add to global-styles.css
   =================================== */

/* Fix main grid to allow natural card heights */
.main-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    align-items: start; /* KEY FIX: Allow cards to have natural heights */
}

/* Fix enhanced coin card to have natural height */
.enhanced-coin-card {
    position: static;
    order: 1;
    height: auto; /* Allow natural height */
    min-height: auto; /* Remove min-height constraints */
    max-height: none; /* Remove max-height constraints */
}

/* Fix sidebar to allow natural heights */
.sidebar {
    display: flex;
    flex-direction: column;
    height: auto; /* Change from fit-content to auto */
    position: static;
    min-width: 0;
    align-self: start; /* Align to start instead of stretch */
}

/* Fix main content area to allow natural heights */
.main-content-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    min-width: 0;
    order: 2;
    height: auto; /* Allow natural height */
    align-self: start; /* Align to start */
}

/* Individual sections should have natural heights */
.chart-section,
.voting-section,
.markets-section {
    height: auto;
    min-height: auto;
    max-height: none;
}

/* Chart section specific height fix */
.chart-section {
    height: clamp(515px, 60vh, 600px); /* Only the chart should have defined height */
}

/* Voting section should expand naturally */
.voting-section {
    height: auto;
    min-height: 300px; /* Minimum height only */
}

/* Markets section should expand naturally */
.markets-section {
    height: auto;
    min-height: 200px; /* Minimum height only */
}

/* Performance metrics should not stretch */
.performance-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    height: auto; /* Natural height */
}

.metric-item {
    background: var(--bg-primary);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-primary);
    transition: all 0.2s ease;
    z-index: 1;
    height: auto; /* Natural height */
    min-height: 60px; /* Minimum for consistency */
}

/* Mobile responsive fixes */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        align-items: start;
    }
    
    .enhanced-coin-card {
        order: 1;
        margin-bottom: var(--space-xl);
        height: auto;
    }
    
    .main-content-area {
        order: 2;
        height: auto;
    }
    
    .voting-section {
        order: 3;
        margin-bottom: var(--space-xl);
        height: auto;
    }
    
    .markets-section {
        order: 4;
        margin-bottom: 0;
        height: auto;
    }
}

@media (max-width: 768px) {
    .performance-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }
    
    .metric-item {
        padding: var(--space-xs);
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .performance-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }
    
    .metric-item {
        min-height: 45px;
    }
}
/* ===================================
   COMPREHENSIVE MODAL SYSTEM STYLES WITH DARK MODE
   =================================== */

/* ===================================
   1. MODAL OVERLAY & BASE STYLES
   =================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal, 1050);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--space-md);
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

/* Dark Mode Modal Overlay */
[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===================================
   2. MODAL CONTENT CONTAINER
   =================================== */

.modal-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

/* Dark Mode Modal Content */
[data-theme="dark"] .modal-content {
    background: var(--bg-elevated);
    border-color: var(--border-primary);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
}

/* ===================================
   3. MODAL HEADER
   =================================== */

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    border-top-left-radius: var(--radius-2xl);
    border-top-right-radius: var(--radius-2xl);
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-primary);
    border-top-left-radius: var(--radius-2xl);
    border-top-right-radius: var(--radius-2xl);
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    line-height: 1.2;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.close-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--red-500);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.close-btn:hover::before {
    width: 100%;
    height: 100%;
}

.close-btn:hover {
    color: white;
    transform: scale(1.1);
}

.close-btn span {
    position: relative;
    z-index: 1;
}

/* Dark Mode Modal Header */
[data-theme="dark"] .modal-header {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-title {
    color: var(--text-primary);
}

[data-theme="dark"] .close-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .close-btn:hover {
    color: white;
}

/* ===================================
   4. BALANCE MODAL STYLES
   =================================== */

.balance-info {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.balance-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--green-50) 0%, var(--primary-50) 100%);
    opacity: 0.5;
    z-index: 0;
}

.balance-info > * {
    position: relative;
    z-index: 1;
}

.balance-amount {
    font-size: var(--text-4xl);
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: var(--space-sm);
    font-feature-settings: 'tnum';
    font-family: var(--font-mono);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.balance-label {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.balance-actions {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-bottom-left-radius: var(--radius-2xl);
    border-bottom-right-radius: var(--radius-2xl);
}

.balance-action-btn {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.balance-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.balance-action-btn:hover {
    background: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.balance-action-btn:hover::before {
    left: 100%;
}

.balance-action-btn.deposit {
    background: var(--green-600);
}

.balance-action-btn.deposit:hover {
    background: var(--green-700);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Dark Mode Balance Modal */
[data-theme="dark"] .balance-info {
    background: var(--bg-primary);
}

[data-theme="dark"] .balance-info::before {
    background: linear-gradient(135deg, var(--green-900) 0%, var(--primary-900) 100%);
    opacity: 0.3;
}

[data-theme="dark"] .balance-amount {
    color: var(--primary-400);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .balance-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .balance-actions {
    background: var(--bg-secondary);
}

[data-theme="dark"] .balance-action-btn {
    background: var(--primary-600);
    color: white;
}

[data-theme="dark"] .balance-action-btn:hover {
    background: var(--primary-500);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .balance-action-btn.deposit {
    background: var(--green-600);
}

[data-theme="dark"] .balance-action-btn.deposit:hover {
    background: var(--green-500);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

/* ===================================
   5. STATS MODAL STYLES
   =================================== */

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    padding: var(--space-xl);
    background: var(--bg-primary);
}

.stat-card {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-primary);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-primary);
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: var(--space-xs);
    font-feature-settings: 'tnum';
    font-family: var(--font-mono);
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dark Mode Stats Overview */
[data-theme="dark"] .stats-overview {
    background: var(--bg-primary);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .stat-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-400);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .stat-value {
    color: var(--primary-400);
}

[data-theme="dark"] .stat-label {
    color: var(--text-secondary);
}

/* ===================================
   6. HISTORY SECTION STYLES
   =================================== */

.history-section {
    padding: var(--space-xl);
    background: var(--bg-primary);
    border-bottom-left-radius: var(--radius-2xl);
    border-bottom-right-radius: var(--radius-2xl);
}

.history-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    text-align: center;
}

.history-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.history-tab {
    flex: 1;
    padding: var(--space-md);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.history-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.history-tab.active {
    color: var(--brand-primary);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.history-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: var(--brand-primary);
    border-radius: 2px;
}

.history-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.history-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.history-empty-message {
    text-align: center;
    color: var(--text-tertiary);
    padding: var(--space-2xl);
    font-style: italic;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.history-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-primary);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.history-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--text-lg);
}

.history-date {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 500;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
}

.history-stat {
    text-align: center;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.history-stat-value {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-feature-settings: 'tnum';
}

.history-stat-label {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Dark Mode History Section */
[data-theme="dark"] .history-section {
    background: var(--bg-primary);
}

[data-theme="dark"] .history-section-title {
    color: var(--text-primary);
}

[data-theme="dark"] .history-tabs {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-primary);
}

[data-theme="dark"] .history-tab {
    color: var(--text-secondary);
}

[data-theme="dark"] .history-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

[data-theme="dark"] .history-tab.active {
    color: var(--primary-400);
    background: var(--bg-primary);
}

[data-theme="dark"] .history-tab.active::after {
    background: var(--primary-400);
}

[data-theme="dark"] .history-empty-message {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-tertiary);
}

[data-theme="dark"] .history-item {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .history-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-400);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .history-title {
    color: var(--text-primary);
}

[data-theme="dark"] .history-date {
    color: var(--text-tertiary);
}

[data-theme="dark"] .history-stat {
    background: var(--bg-primary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .history-stat-value {
    color: var(--text-primary);
}

[data-theme="dark"] .history-stat-label {
    color: var(--text-secondary);
}

/* ===================================
   7. RANKING MODAL STYLES
   =================================== */

.ranking-leaderboard {
    margin-top: var(--space-xl);
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid var(--border-primary);
}

.leaderboard-title {
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    font-size: var(--text-lg);
    font-weight: 700;
}

.leaderboard-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.5;
}

/* Dark Mode Ranking Modal */
[data-theme="dark"] .ranking-leaderboard {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--primary-900) 100%);
    border-color: var(--border-primary);
}

[data-theme="dark"] .leaderboard-title {
    color: var(--text-primary);
}

[data-theme="dark"] .leaderboard-description {
    color: var(--text-secondary);
}

/* ===================================
   8. HOW IT WORKS MODAL STYLES
   =================================== */

.how-it-works-content {
    font-size: var(--text-sm);
    line-height: 1.6;
    padding: var(--space-xl);
    color: var(--text-primary);
}

.concept-section {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--green-50) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--primary-200);
    position: relative;
    overflow: hidden;
}

.concept-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-500);
}

.concept-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary-700);
}

.system-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.system-phases {
    background: var(--gray-50);
    border-radius: 0.75rem;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-primary);
}

.phase-item {
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    border-left: 4px solid var(--primary-500);
    padding-left: var(--space-md);
    background: var(--bg-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.phase-item:last-child {
    margin-bottom: 0;
}

.phase-number {
    color: var(--primary-600);
}

.pools-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.pool-types {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.pool-type {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border-left: 4px solid;
}

.pool-type.daily {
    background: var(--green-50);
    border-left-color: var(--green-500);
}

.pool-type.weekly {
    background: var(--primary-50);
    border-left-color: var(--primary-500);
}

.pool-type.monthly {
    background: var(--orange-50);
    border-left-color: var(--orange-500);
}

.pool-type small {
    color: var(--text-tertiary);
    display: block;
    margin-top: 0.5rem;
    font-style: italic;
}

.tiers-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.tiers-description {
    margin-bottom: var(--space-lg);
}

.timing-tiers {
    background: var(--gray-50);
    border-radius: 0.75rem;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-primary);
}

.tier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
}

.tier:last-child {
    margin-bottom: 0;
}

.tier.early {
    background: var(--green-100);
    color: var(--green-700);
}

.tier.standard {
    background: var(--primary-100);
    color: var(--primary-700);
}

.tier.late {
    background: var(--orange-100);
    color: var(--orange-700);
}

.tier span {
    font-weight: 700;
}

.payout-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.payout-section {
    background: var(--green-50);
    border-radius: 0.75rem;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--green-200);
}

.payout-formula-title {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.payout-formula {
    background: white;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    display: block;
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
    border: 1px solid var(--border-primary);
    overflow-x: auto;
}

.payout-example {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Dark Mode How It Works */
[data-theme="dark"] .how-it-works-content {
    color: var(--text-primary);
}

[data-theme="dark"] .concept-section {
    background: linear-gradient(135deg, var(--primary-900) 0%, var(--green-900) 100%);
    border-color: var(--primary-700);
}

[data-theme="dark"] .concept-section::before {
    background: var(--primary-400);
}

[data-theme="dark"] .concept-title {
    color: var(--primary-300);
}

[data-theme="dark"] .system-title,
[data-theme="dark"] .pools-title,
[data-theme="dark"] .tiers-title,
[data-theme="dark"] .payout-title {
    color: var(--text-primary);
}

[data-theme="dark"] .system-phases,
[data-theme="dark"] .timing-tiers {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .phase-item {
    background: var(--bg-primary);
    border-left-color: var(--primary-400);
}

[data-theme="dark"] .phase-number {
    color: var(--primary-400);
}

[data-theme="dark"] .pool-type.daily {
    background: var(--green-900);
    border-left-color: var(--green-400);
    color: var(--green-100);
}

[data-theme="dark"] .pool-type.weekly {
    background: var(--primary-900);
    border-left-color: var(--primary-400);
    color: var(--primary-100);
}

[data-theme="dark"] .pool-type.monthly {
    background: var(--orange-900);
    border-left-color: var(--orange-400);
    color: var(--orange-100);
}

[data-theme="dark"] .pool-type small {
    color: var(--text-tertiary);
}

[data-theme="dark"] .tier.early {
    background: var(--green-900);
    color: var(--green-300);
}

[data-theme="dark"] .tier.standard {
    background: var(--primary-900);
    color: var(--primary-300);
}

[data-theme="dark"] .tier.late {
    background: var(--orange-900);
    color: var(--orange-300);
}

[data-theme="dark"] .payout-section {
    background: var(--green-900);
    border-color: var(--green-700);
    color: var(--green-100);
}

[data-theme="dark"] .payout-formula {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .payout-example {
    color: var(--text-secondary);
}

/* ===================================
   9. TOAST NOTIFICATIONS
   =================================== */

.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--brand-primary);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: calc(var(--z-modal) + 10);
    font-weight: 600;
    max-width: 400px;
    word-wrap: break-word;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: var(--green-600);
}

.toast.error {
    background: var(--red-600);
}

.toast.info {
    background: var(--primary-600);
}

.toast.warning {
    background: var(--orange-600);
}

/* Dark Mode Toast */
[data-theme="dark"] .toast {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .toast.success {
    background: var(--green-600);
}

[data-theme="dark"] .toast.error {
    background: var(--red-600);
}

[data-theme="dark"] .toast.info {
    background: var(--primary-600);
}

[data-theme="dark"] .toast.warning {
    background: var(--orange-600);
}

/* ===================================
   10. RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .modal {
        padding: var(--space-sm);
        align-items: flex-start;
        padding-top: var(--space-lg);
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: var(--radius-xl);
        margin: 0;
        width: 100%;
    }
    
    .modal-header {
        padding: var(--space-lg);
        border-top-left-radius: var(--radius-xl);
        border-top-right-radius: var(--radius-xl);
    }
    
    .modal-title {
        font-size: var(--text-lg);
    }
    
    .balance-info {
        padding: var(--space-xl);
    }
    
    .balance-amount {
        font-size: var(--text-3xl);
    }
    
    .balance-actions {
        flex-direction: column;
        padding: var(--space-lg);
        gap: var(--space-sm);
    }
    
    .balance-action-btn {
        width: 100%;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        padding: var(--space-lg);
        gap: var(--space-sm);
    }
    
    .history-section {
        padding: var(--space-lg);
    }
    
    .history-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .toast {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
        transform: translateY(100%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .how-it-works-content {
        padding: var(--space-lg);
    }
    
    .concept-section {
        padding: var(--space-lg);
        margin-bottom: var(--space-lg);
    }
    
    .system-phases,
    .timing-tiers,
    .payout-section {
        padding: var(--space-md);
    }
    
    .phase-item {
        padding: var(--space-xs);
        padding-left: var(--space-sm);
    }
    
    .pool-type {
        padding: var(--space-md);
    }
    
    .tier {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xs);
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 0.5rem;
        padding-top: var(--space-md);
    }
    
    .modal-content {
        margin: 0;
        border-radius: var(--radius-lg);
    }
    
    .modal-header {
        padding: var(--space-md);
        border-top-left-radius: var(--radius-lg);
        border-top-right-radius: var(--radius-lg);
    }
    
    .modal-title {
        font-size: var(--text-base);
    }
    
    .balance-info {
        padding: var(--space-lg);
    }
    
    .balance-amount {
        font-size: var(--text-2xl);
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
        padding: var(--space-md);
    }
    
    .history-section {
        padding: var(--space-md);
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .history-tabs {
        flex-direction: column;
    }
    
    .history-tab {
        text-align: left;
        border-bottom: 1px solid var(--border-primary);
    }
    
    .history-tab:last-child {
        border-bottom: none;
    }
    
    .history-tab.active::after {
        left: 0;
        transform: none;
        width: 4px;
        height: 100%;
        top: 0;
        bottom: auto;
    }
    
    .how-it-works-content {
        padding: var(--space-md);
    }
    
    .concept-section {
        padding: var(--space-md);
    }
    
    .concept-title {
        font-size: 1rem;
    }
    
    .system-title,
    .pools-title,
    .tiers-title,
    .payout-title {
        font-size: 1rem;
    }
}

/* ===================================
   11. ACCESSIBILITY IMPROVEMENTS
   =================================== */

.modal[aria-hidden="true"] {
    display: none;
}

.modal-content:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.balance-action-btn:focus,
.history-tab:focus,
.close-btn:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modal-content,
    .balance-info,
    .stats-overview,
    .history-section {
        border-width: 2px;
    }
    
    .stat-card,
    .history-item,
    .balance-action-btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .modal,
    .modal-content,
    .toast,
    .balance-action-btn,
    .stat-card,
    .history-item {
        transition: none;
    }
    
    .balance-action-btn::before {
        display: none;
    }
    
    .history-content {
        animation: none;
    }
}

/* Print styles */
@media print {
    .modal {
        display: none !important;
    }
}

/* ===================================
   12. FOCUS MANAGEMENT
   =================================== */

.modal.show .modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Focus trap within modal */
.modal.show .modal-content *:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* ===================================
   13. LOADING STATES
   =================================== */

.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
}

.modal-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-sm);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-loading-text {
    font-weight: 600;
    margin-top: var(--space-sm);
}

/* Dark mode loading states */
[data-theme="dark"] .modal-loading {
    color: var(--text-secondary);
}

[data-theme="dark"] .modal-loading .loading-spinner {
    border-color: var(--border-primary);
    border-top-color: var(--primary-400);
}

/* ===================================
   14. MODAL BACKDROP EFFECTS
   =================================== */

.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.show::before {
    opacity: 1;
}

[data-theme="dark"] .modal::before {
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
}

/* ===================================
   15. MODAL STACKING
   =================================== */

.modal.modal-level-2 {
    z-index: calc(var(--z-modal) + 10);
}

.modal.modal-level-3 {
    z-index: calc(var(--z-modal) + 20);
}

/* Ensure proper stacking context */
.modal-content {
    isolation: isolate;
}