/* BedavaFinans Theme Styles */

/* Dark theme (default) */
.dark {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161e;
    --bg-card-hover: #1c1c28;
    --border: #2a2a3a;
    --text-primary: #e4e4ef;
    --text-secondary: #9a9ab4;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --shadow: rgba(0,0,0,0.3);
    --overlay-white: rgba(255,255,255,0.05);
    --scrollbar-thumb: #333;
    --scrollbar-thumb-hover: #555;
    --gauge-inner: var(--bg-card);
    --needle-color: #ffffff;
}

/* Light theme */
.light {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fb;
    --border: #e2e4e9;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --accent-green: #059669;
    --accent-red: #dc2626;
    --accent-orange: #ea580c;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --shadow: rgba(0,0,0,0.08);
    --overlay-white: rgba(0,0,0,0.03);
    --scrollbar-thumb: #c4c4c4;
    --scrollbar-thumb-hover: #a0a0a0;
    --gauge-inner: #ffffff;
    --needle-color: #1a1a2e;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    margin: 0;
    padding: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}
.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
    box-shadow: 0 2px 8px var(--shadow);
}

/* CLS prevention - reserve space for dynamic content */
.overview-grid .card { min-height: 88px; }
#whale-ticker { min-height: 36px; contain: layout; }
#movers-list { min-height: 140px; }
#anomalies-list { min-height: 100px; }
#derivatives-list { min-height: 200px; }
#news-sentiment { min-height: 200px; }
#social-buzz-list { min-height: 200px; }
#trending-social-list { min-height: 200px; }
#chart-container { min-height: 350px; }

/* Signal Badges */
.signal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.signal-badge.strong-buy { background: rgba(16, 185, 129, 0.15); color: #10b981; box-shadow: 0 0 12px rgba(16,185,129,0.2); }
.signal-badge.buy { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.signal-badge.neutral { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }
.signal-badge.sell { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.signal-badge.strong-sell { background: rgba(239, 68, 68, 0.15); color: #ef4444; box-shadow: 0 0 12px rgba(239,68,68,0.2); }

/* Percentage colors */
.text-up { color: var(--accent-green); }
.text-down { color: var(--accent-red); }
.text-neutral { color: var(--text-secondary); }

/* Whale Ticker */
.whale-ticker {
    overflow: hidden;
    white-space: nowrap;
    background: linear-gradient(135deg, rgba(59,130,246,0.06), rgba(139,92,246,0.06));
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    padding: 10px 0;
    position: relative;
}
.whale-ticker::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, var(--bg-primary), transparent);
    z-index: 2;
    pointer-events: none;
}
.whale-ticker::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, var(--bg-primary), transparent);
    z-index: 2;
    pointer-events: none;
}
.whale-ticker-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid var(--border);
    margin-right: 8px;
    position: relative;
    z-index: 3;
    background: transparent;
}
.whale-ticker-inner {
    display: inline-block;
    animation: ticker 60s linear infinite;
}
.whale-ticker:hover .whale-ticker-inner {
    animation-play-state: paused;
}
.whale-tx {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    transition: background 0.2s;
}
.whale-tx:hover {
    background: rgba(59,130,246,0.1);
}
.whale-tx-amount {
    font-weight: 700;
    color: var(--text-primary);
}
.whale-tx-usd {
    color: var(--text-secondary);
    font-size: 11px;
}
.whale-tx-time {
    color: var(--text-secondary);
    font-size: 10px;
    opacity: 0.7;
}
.whale-tx-size {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}
.whale-tx-size.mega { background: rgba(239,68,68,0.15); color: #ef4444; }
.whale-tx-size.large { background: rgba(249,115,22,0.15); color: #f97316; }
.whale-tx-size.medium { background: rgba(234,179,8,0.15); color: #eab308; }
@keyframes ticker {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 5;
}
.data-table th:hover { color: var(--text-primary); }
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr.selected { background: rgba(59, 130, 246, 0.1); }

/* Fear & Greed Gauge */
.gauge-container {
    position: relative;
    width: 120px;
    height: 60px;
    margin: 0 auto;
}
.gauge-bg {
    width: 120px;
    height: 60px;
    border-radius: 60px 60px 0 0;
    background: conic-gradient(
        from 180deg at 50% 100%,
        #ef4444 0deg,
        #f97316 45deg,
        #eab308 90deg,
        #22c55e 135deg,
        #10b981 180deg
    );
    position: relative;
    overflow: hidden;
}
.gauge-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 45px;
    background: var(--gauge-inner);
    border-radius: 45px 45px 0 0;
}
.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 40px;
    background: var(--needle-color);
    transform-origin: bottom center;
    transition: transform 0.8s ease;
    z-index: 2;
}
.gauge-value {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: 700;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Flash animation on price update */
.flash-green { animation: flashGreen 0.6s ease; }
.flash-red { animation: flashRed 0.6s ease; }
@keyframes flashGreen {
    0%, 100% { background: transparent; }
    50% { background: rgba(16, 185, 129, 0.15); }
}
@keyframes flashRed {
    0%, 100% { background: transparent; }
    50% { background: rgba(239, 68, 68, 0.15); }
}

/* Tab buttons */
.tab-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.tab-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}
.tab-btn:hover:not(.active) {
    background: var(--overlay-white);
    color: var(--text-primary);
}

/* Watchlist star hover */
.data-table svg[onclick*="toggleWatchlist"]:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 3px rgba(234, 179, 8, 0.4));
}

/* Row icon buttons (info, alert) - lightweight text-based icons */
.row-icon-btn {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.4;
    transition: opacity 0.2s;
    flex-shrink: 0;
    color: var(--text-secondary);
    user-select: none;
}
.row-icon-btn:hover { opacity: 1; }
.row-icon-btn.row-icon-active { opacity: 0.9; color: var(--accent-blue); }

/* Show more button */
.show-more-btn {
    background: var(--overlay-white);
    border: 1px solid var(--border);
    color: var(--accent-blue);
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.show-more-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

/* Score bar */
.score-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--bg-secondary);
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Mini sparkline placeholder */
.mini-chart {
    width: 60px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

/* Search input */
.search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    color: var(--text-primary);
    font-size: 13px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease;
}
.search-input:focus {
    border-color: var(--accent-blue);
}
.search-input::placeholder {
    color: var(--text-secondary);
}

/* Theme toggle button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}
.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Smooth theme transition */
body, .card, header, footer, .data-table th, .data-table td,
.search-input, .tab-btn, .whale-ticker, .gauge-bg::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light theme signal badge adjustments */
.light .signal-badge.neutral { color: #6b7280; }
.light .data-table tbody tr.selected { background: rgba(37, 99, 235, 0.08); }
.light .whale-ticker {
    background: rgba(37, 99, 235, 0.04);
    border-color: rgba(37, 99, 235, 0.12);
}
.light .tab-btn.active {
    background: rgba(37, 99, 235, 0.1);
}

/* Light theme SVG ring adjustment */
.light #market-score-ring circle:first-child { stroke: rgba(0,0,0,0.06) !important; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    position: relative;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px !important;
    animation: slideUp 0.2s ease;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 320px;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ═══ Responsive / Mobile ═══ */

/* Mobile header */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.mobile-menu-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

@media (max-width: 640px) {
    /* Header */
    .mobile-menu-btn { display: flex; }
    .header-controls {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
        padding: 12px 16px;
        gap: 12px;
        box-shadow: 0 4px 12px var(--shadow);
        z-index: 50;
    }
    .header-controls.open {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Smaller padding */
    main { padding: 8px !important; gap: 8px !important; }
    .card { padding: 12px; border-radius: 8px; }

    /* Market overview cards */
    .overview-grid { gap: 6px !important; }
    .overview-grid .card { padding: 10px; }

    /* Gauge */
    .gauge-container { width: 100px; height: 50px; }
    .gauge-bg { width: 100px; height: 50px; border-radius: 50px 50px 0 0; }
    .gauge-bg::after { width: 74px; height: 37px; border-radius: 37px 37px 0 0; }
    .gauge-needle { height: 32px; }
    .gauge-value { font-size: 16px; bottom: -20px; }

    /* Tables: force minimum width for horizontal scroll */
    .data-table { min-width: 600px; }
    .data-table th, .data-table td { padding: 8px 6px; font-size: 12px; }

    /* Chart */
    #chart-container { height: 280px !important; }

    /* Search input full width */
    .search-wrapper { width: 100% !important; }

    /* Market score ring in header */
    #market-score-ring svg { width: 56px; height: 56px; }
    #market-score-ring { transform: scale(0.8); }

    /* Side panels */
    .side-panels { gap: 8px !important; }

    /* Footer */
    footer { font-size: 10px !important; padding: 8px !important; }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    main { padding: 12px !important; }
    #chart-container { height: 340px !important; }
}

/* ═══ Dream Machine ═══ */
.dream-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.dream-input-group { display: flex; flex-direction: column; }
.dream-select, .dream-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
}
.dream-select:focus, .dream-input:focus { border-color: var(--accent-blue); }
.dream-select option { background: var(--bg-card); color: var(--text-primary); }
.dream-input::placeholder { color: var(--text-secondary); font-weight: 400; }

.dream-mode-btn {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--accent-blue);
    background: rgba(59,130,246,0.15);
    color: var(--accent-blue);
    vertical-align: middle;
    transition: all 0.2s ease;
}
.dream-mode-btn:hover { background: rgba(59,130,246,0.3); }

.dream-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(139,92,246,0.06);
    border: 1px solid rgba(139,92,246,0.15);
}
.dream-result-header img { border-radius: 50%; }
.dream-result-header .dream-headline { font-size: 14px; font-weight: 600; }
.dream-result-header .dream-subline { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.dream-ath-btn {
    border-color: var(--accent-orange) !important;
    color: var(--accent-orange) !important;
}
.dream-ath-btn:hover, .dream-ath-btn.active {
    background: rgba(249,115,22,0.15) !important;
    border-color: var(--accent-orange) !important;
    color: var(--accent-orange) !important;
}

.dream-quick-pcts {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.dream-pct-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.dream-pct-btn:hover, .dream-pct-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.dream-summary {
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.dream-summary-item {
    text-align: center;
}
.dream-summary-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.dream-summary-value {
    font-size: 18px;
    font-weight: 700;
}

.dream-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.dream-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 10px 10px;
    text-align: center;
    transition: all 0.2s ease;
    overflow: hidden;
}
.dream-item:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139,92,246,0.15);
}
.dream-item.affordable {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
}
.dream-item.unaffordable {
    background: var(--bg-card);
    opacity: 0.45;
}
.dream-item-emoji { font-size: 28px; margin-bottom: 6px; }
.dream-item-name { font-size: 11px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.dream-item-price { font-size: 10px; color: var(--text-secondary); }
.dream-item-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--accent-green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}
.dream-progress-bar {
    margin-top: 6px;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}
.dream-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

@media (max-width: 640px) {
    .dream-inputs { grid-template-columns: 1fr; }
    .dream-summary { grid-template-columns: repeat(2, 1fr); }
    .dream-items-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ Info Tooltips ═══ */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.info-tip:hover {
    opacity: 1;
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}
/* Hidden child spans - content read by JS */
.info-tip .tip-text {
    display: none !important;
}
/* Global tooltip (appended to body, escapes overflow) */
#global-tooltip {
    display: none;
    position: fixed;
    z-index: 10000;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: normal;
    width: max-content;
    max-width: 260px;
    box-shadow: 0 4px 16px var(--shadow);
    text-align: left;
    pointer-events: none;
}
#global-tooltip.visible {
    display: block;
}
#global-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}
#global-tooltip.arrow-bottom::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--border);
}

@media (max-width: 640px) {
    #global-tooltip {
        max-width: 200px;
        font-size: 11px;
        padding: 8px 10px;
    }
}

/* ═══ Chart Toolbar ═══ */
.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.chart-toolbar-left,
.chart-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-type-group,
.chart-interval-group,
.chart-indicator-group {
    display: flex;
    gap: 2px;
}
.chart-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}
.chart-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.chart-ctrl-btn:hover {
    background: var(--overlay-white);
    color: var(--text-primary);
}
.chart-ctrl-btn.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.25);
}
.chart-indicator-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.chart-indicator-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}
.chart-indicator-btn.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
}

/* Chart card fill container */
.chart-card {
    min-height: 450px;
}
.chart-card #chart-container {
    flex: 1;
    min-height: 0;
}

/* Chart Fullscreen */
.chart-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 200 !important;
    border-radius: 0 !important;
    border: none !important;
    max-width: none !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
}
.chart-fullscreen #chart-container {
    min-height: 0 !important;
}
body.chart-fs-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .chart-toolbar {
        padding: 6px 8px;
        gap: 4px;
    }
    .chart-toolbar-left h2 {
        display: none;
    }
    .chart-divider {
        display: none;
    }
    .chart-ctrl-btn {
        min-width: 26px;
        height: 26px;
        font-size: 10px;
    }
    .chart-indicator-btn {
        height: 22px;
        padding: 0 6px;
        font-size: 9px;
    }
    .chart-card {
        min-height: 350px;
    }
}

/* ═══ Solana Ecosystem ═══ */
.sol-filter-tab {
    font-size: 11px !important;
    padding: 4px 10px !important;
}
.sol-filter-tab.active {
    color: #9945FF !important;
    background: rgba(153, 69, 255, 0.1);
    border-radius: 6px;
}
.sol-table th { font-size: 11px; }
.sol-table td { font-size: 12px; padding: 8px 10px; }

/* ═══ Funding Rate Arbitrage ═══ */
.fr-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.fr-table td { font-size: 12px; padding: 8px 10px; }
.fr-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
.fr-table tbody tr:hover { background: var(--bg-card-hover); }

.fr-badge-exchange {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(243, 186, 47, 0.12);
    color: #f3ba2f;
    letter-spacing: 0.3px;
}

.fr-apr-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

.fr-apr-badge.fr-apr-hot {
    background: rgba(239, 68, 68, 0.12);
    animation: fr-pulse 2s infinite;
}

.fr-apr-badge.fr-apr-warm {
    background: rgba(249, 115, 22, 0.1);
}

@keyframes fr-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.fr-filter-tab {
    font-size: 11px !important;
    padding: 4px 10px !important;
}

.fr-filter-tab.active {
    color: var(--accent-blue) !important;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .data-table tbody tr { min-height: 44px; }
    .data-table td { padding: 12px 8px; }
    .tab-btn { padding: 8px 16px; min-height: 36px; }
    .theme-toggle { width: 36px; height: 36px; }
    .mobile-menu-btn { width: 36px; height: 36px; }
}
