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

:root {
    /* Trading Signal Status Colors - Unified Theme */
    --signal-strong-buy-bg: linear-gradient(135deg, #047857, #065f46);
    --signal-strong-buy-text: #10b981;
    --signal-strong-buy-border: #059669;
    --signal-buy-bg: linear-gradient(135deg, #059669, #047857);
    --signal-buy-text: #34d399;
    --signal-buy-border: #10b981;
    --signal-neutral-bg: linear-gradient(135deg, #d97706, #b45309);
    --signal-neutral-text: #fbbf24;
    --signal-neutral-border: #f59e0b;
    --signal-sell-bg: linear-gradient(135deg, #dc2626, #b91c1c);
    --signal-sell-text: #fb923c;
    --signal-sell-border: #ef4444;
    --signal-strong-sell-bg: linear-gradient(135deg, #991b1b, #7f1d1d);
    --signal-strong-sell-text: #ef4444;
    --signal-strong-sell-border: #dc2626;
    /* Lighter versions for table cells */
    --signal-strong-buy-cell: rgba(5, 150, 105, 0.15);
    --signal-buy-cell: rgba(16, 185, 129, 0.12);
    --signal-neutral-cell: rgba(245, 158, 11, 0.12);
    --signal-sell-cell: rgba(239, 68, 68, 0.12);
    --signal-strong-sell-cell: rgba(220, 38, 38, 0.15);
}

body { 
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif; 
    background: linear-gradient(135deg,#0F172A 0%,#1E293B 100%); 
    color:#F1F5F9; 
    min-height:100vh; 
    padding:20px;
    /* GPU acceleration for smoother scrolling */
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 95%;
    max-width: 2400px;
    margin: 0 auto;
    /* Containment for better paint performance */
    contain: layout style;
}

.header {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.header-intro {
    flex: 1 1 240px;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #F1F5F9;
    font-weight: 700;
}

.header p {
    font-size: 0.95rem;
    color: #94A3B8;
}

.utc-clock {
    font-size: 1.25rem;
    font-weight: 700;
    color: #3b82f6;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    min-width: 210px;
    text-align: center;
}

.nav-links {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.1);
    color: #F1F5F9;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-links a:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-links a.active {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    font-weight: 600;
    border: 1px solid transparent;
}

.refresh-btn {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.last-update {
    font-size: 0.85rem;
    margin-top: 10px;
    color: #94A3B8;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.last-update > div {
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Price flash animations - direction-based colors with GPU acceleration */
.price-flash {
    will-change: background-color;
    transform: translateZ(0);
}

.price-flash.price-flash-up {
    animation: flashUp 0.5s ease-out;
}

.price-flash.price-flash-down {
    animation: flashDown 0.5s ease-out;
}

@keyframes flashUp {
    0% { background-color: rgba(16, 185, 129, 0.4); }
    100% { background-color: transparent; }
}

@keyframes flashDown {
    0% { background-color: rgba(239, 68, 68, 0.4); }
    100% { background-color: transparent; }
}

/* Persistent price text colors */
.price.price-up {
    color: #10B981;
    font-weight: 600;
}

.price.price-down {
    color: #EF4444;
    font-weight: 600;
}

/* Market Health Widget */
.market-health-widget {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.1);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.mh-card, .mtx-card {
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.mh-card:hover, .mtx-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

.mh-card h3, .mtx-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 600;
    color: #94A3B8;
}

.mh-score, .mtx-score {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
    line-height: 1;
    color: #F1F5F9;
}

.mh-status, .mtx-decision {
    font-size: 1rem;
    font-weight: bold;
    margin: 5px 0;
    color: #F1F5F9;
}

.mh-trend, .mtx-interpretation {
    font-size: 0.85rem;
    margin: 5px 0;
    opacity: 0.9;
    color: #94A3B8;
}

/* MTX Circular Gauge */
.mtx-gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

.mtx-gauge-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

.mtx-gauge {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 15px;
    transition: all 0.5s ease;
}

.mtx-gauge::before {
    content: '';
    position: absolute;
    width: 75%;
    height: 75%;
    background: #1E293B;
    border-radius: 50%;
    z-index: 1;
}

.mtx-gauge-value {
    position: relative;
    z-index: 2;
    font-size: 3rem;
    font-weight: 700;
    color: #F1F5F9;
}

.mtx-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #F5F5F9;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.mtx-sublabel {
    font-size: 0.9rem;
    color: #94A3B8;
    margin-bottom: 8px;
    text-align: center;
    max-width: 200px;
}

.mtx-trend {
    font-size: 0.95rem;
    color: #F1F5F9;
    font-weight: 600;
}

/* Market Health Gauge - Color Zones */
.mtx-gauge-zone {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: inset(0 0 0 100%);
}

.mtx-gauge-zone[data-zone="excellent"] {
    background: conic-gradient(from 0deg, #10b981 0% 20%, #34d399 20% 100%);
}

.mtx-gauge-zone[data-zone="good"] {
    background: conic-gradient(from 0deg, #3b82f6 0% 20%, #2563eb 20% 100%);
}

.mtx-gauge-zone[data-zone="warning"] {
    background: conic-gradient(from 0deg, #f59e0b 0% 20%, #d97706 20% 100%);
}

.mtx-gauge-zone[data-zone="critical"] {
    background: conic-gradient(from 0deg, #ef4444 0% 20%, #dc2626 20% 100%);
}

/* BTC Trend grid */
.btc-trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* BTC-Trend Circular Gauge Card */
.btc-trend-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.btc-trend-card:hover { transform: translateY(-2px); box-shadow: 0 12px 48px rgba(59, 130, 246, 0.35); }

.btc-gauge-wrapper { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.btc-gauge { width: 160px; height: 160px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; background: conic-gradient(from 0deg, #ef4444 0% 20%, #fb923c 20% 40%, #fbbf24 40% 60%, #34d399 60% 80%, #10b981 80% 100%); transition: all 0.3s ease; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }

.btc-gauge::before { content:''; position:absolute; width:74%; height:74%; background: linear-gradient(135deg,#1E293B 0%,#334155 100%); border-radius:50%; z-index:1; box-shadow: inset 0 4px 16px rgba(0,0,0,0.45); }

.btc-gauge-value { position:relative; z-index:2; font-size: 2rem; font-weight: 800; color: #F1F5F9; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }

.btc-trend-label { font-size: 0.85rem; font-weight: 700; color: #cbd5e1; text-transform: uppercase; letter-spacing: .6px; text-align: center; }

.btc-trend-status { font-size: 0.8rem; font-weight: 700; padding: 6px 14px; border-radius: 14px; background: rgba(59,130,246,.15); color:#60A5FA; border:1px solid rgba(59,130,246,.3); text-transform: uppercase; letter-spacing: .3px; }

.btc-trend-info { font-size: 0.72rem; color:#8fa3b8; text-align:center; margin-top: 2px; }

/* Dynamic zone background emphasis (class on wrapper) - low red -> high green */
.btc-zone-bottom .btc-gauge { background: conic-gradient(from 0deg, #ef4444 0% 10%, #94a3b8 10% 100%) !important; }
.btc-zone-lower  .btc-gauge { background: conic-gradient(from 0deg, #fb923c 0% 40%, #94a3b8 40% 100%) !important; }
.btc-zone-mid    .btc-gauge { background: conic-gradient(from 0deg, #fbbf24 0% 60%, #94a3b8 60% 100%) !important; }
.btc-zone-upper  .btc-gauge { background: conic-gradient(from 0deg, #34d399 0% 80%, #94a3b8 80% 100%) !important; }
.btc-zone-top    .btc-gauge { background: conic-gradient(from 0deg, #10b981 0% 100%) !important; }

/* Content container */
#content {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.1);
    overflow: hidden;
}

.crypto-table {
    width: 100%;
    border-collapse: collapse;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    contain: layout;
}

thead {
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

th {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    position: relative;
    transition: all 0.3s ease;
    color: #F1F5F9;
}

/* Sortable header styles */
th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background-color: rgba(59, 130, 246, 0.15);
}

th.sortable:active {
    background-color: rgba(59, 130, 246, 0.25);
}

/* Sort indicator */
.sort-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em;
    opacity: 0.9;
    color: #3B82F6;
}

/* Sort arrow animation */
th.sortable .sort-indicator {
    animation: sortPulse 0.3s ease-out;
}

@keyframes sortPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    font-size: 0.85rem;
    color: #F1F5F9;
    text-align: center;
}

tbody tr {
    transition: all 0.2s ease;
    contain: layout style;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.rank {
    font-weight: bold;
    color: #3B82F6;
}

.symbol {
    font-weight: bold;
    font-size: 1.1rem;
    color: #F1F5F9;
}

.symbol-link {
    color: #3B82F6;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.symbol-link:hover {
    color: #60A5FA;
    text-decoration: underline;
    transform: translateX(2px);
}

.symbol-link:visited {
    color: #3B82F6;
}

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

.chart-link {
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    opacity: 0.7;
}

.chart-link:hover {
    opacity: 1;
    transform: scale(1.2);
    filter: brightness(1.3);
}

.positive {
    color: #10B981;
    font-weight: bold;
}

.negative {
    color: #EF4444;
    font-weight: bold;
}

.price {
    font-family: 'Courier New', monospace;
    color: #F1F5F9;
}

.high-price, .low-price {
    color: #94A3B8;
    font-size: 0.8rem;
}

.volume {
    color: #94A3B8;
}

.cta-cell {
    text-align: center;
    font-family: 'Courier New', monospace;
    color: #E2E8F0;
}

.max-trade-cell {
    text-align: center;
    font-family: 'Courier New', monospace;
    color: #E2E8F0;
}

.max-trade-cell.max-trade-empty,
.max-trade-cell.max-trade-neutral {
    color: #94A3B8;
}

.spike-percent-cell {
    text-align: center;
    font-family: 'Courier New', monospace;
    color: #E2E8F0;
}

.spike-percent-cell.positive {
    color: #10b981;
}

.spike-percent-cell.negative {
    color: #ef4444;
}

.cvd-cell {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.cvd-cell.cvd-na {
    color: #94A3B8;
    font-weight: 500;
}

.cvd-cell .cvd-empty {
    opacity: 0.6;
}

.cvd-cell .cvd5-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
}

.cvd-cell .cvd5-line1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cvd-cell .cvd5-line2 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding-left: 2px;
}

.cvd-cell .cvd5-signal {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cvd-cell .cvd5-signal.very-strong-buy {
    color: #059669;
    background: rgba(5, 150, 105, 0.2);
    font-weight: 800;
    border: 1px solid rgba(5, 150, 105, 0.4);
}

.cvd-cell .cvd5-signal.strong-buy {
    color: #10B981;
    background: rgba(16, 185, 129, 0.18);
    font-weight: 700;
}

.cvd-cell .cvd5-signal.buy {
    color: #10B981;
    background: rgba(16, 185, 129, 0.12);
}

.cvd-cell .cvd5-signal.strong-sell {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.18);
    font-weight: 700;
}

.cvd-cell .cvd5-signal.sell {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.12);
}

.cvd-cell .cvd5-signal.neutral {
    color: #94A3B8;
    background: rgba(148, 163, 184, 0.08);
}

.cvd-cell .cvd5-signal.no-buy {
    color: #F87171;
    background: rgba(248, 113, 113, 0.08);
    border: 1px dashed rgba(248, 113, 113, 0.5);
    font-weight: 700;
    letter-spacing: 0.4px;
}

.cvd-cell .cvd5-signal.weak-recovery {
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.12);
    font-style: italic;
}

.cvd-cell .cvd5-signal.building {
    color: #3B82F6;
    background: rgba(59, 130, 246, 0.1);
    font-size: 0.78rem;
}

.cvd-cell .cvd5-signal.reversal-outflow {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.18);
    border: 1px solid rgba(220, 38, 38, 0.4);
    font-weight: 700;
    animation: pulse-warning 2s infinite;
}

.cvd-cell .cvd5-signal.weakening {
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.15);
    font-weight: 600;
}

.cvd-cell .cvd5-signal.shock-up {
    color: #0EA5E9;
    background: rgba(14, 165, 233, 0.2);
    border: 1px solid rgba(14, 165, 233, 0.45);
    font-weight: 800;
    animation: shockPulseUp 1.6s ease-in-out infinite;
}

.cvd-cell .cvd5-signal.shock-down {
    color: #F97316;
    background: rgba(249, 115, 22, 0.18);
    border: 1px solid rgba(249, 115, 22, 0.45);
    font-weight: 800;
    animation: shockPulseDown 1.6s ease-in-out infinite;
}

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

.cvd-cell .cvd5-value {
    font-family: 'Courier New', monospace;
    font-size: 0.92rem;
    font-weight: 600;
}

.cvd-cell .cvd5-arrow {
    font-size: 1rem;
    line-height: 1;
}

.cvd-cell .cvd5-arrow.inflow {
    color: #34D399;
}

.cvd-cell .cvd5-arrow.outflow {
    color: #F87171;
}

.cvd-cell .cvd5-arrow.flat {
    color: #CBD5F5;
}

.cvd-cell .cvd5-bar {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: 0.8rem;
    color: #E2E8F0;
}

.cvd-cell .cvd5-accel-label {
    font-size: 0.76rem;
    color: #A78BFA;
    font-weight: 600;
}

.cvd-cell .cvd5-delta-val {
    font-size: 0.74rem;
    font-weight: 600;
}

.cvd-cell .cvd5-delta-val.positive {
    color: #10B981;
}

.cvd-cell .cvd5-delta-val.negative {
    color: #EF4444;
}

.cvd-cell .cvd5-separator {
    color: #64748B;
    font-size: 0.7rem;
    margin: 0 2px;
}

.cvd-cell .cvd5-ratio {
    font-size: 0.72rem;
    color: #64748B;
    font-style: italic;
}

.cvd-cell .cvd5-high-ratio {
    font-size: 0.74rem;
    color: #F59E0B;
    font-weight: 600;
}

.cvd-cell.cvd5-very-strong-signal {
    background: rgba(5, 150, 105, 0.12);
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.3);
}

.cvd-cell.cvd5-strong-signal {
    background: rgba(16, 185, 129, 0.1);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.25);
}

.cvd-cell.cvd5-moderate-signal {
    background: rgba(59, 130, 246, 0.06);
}

.cvd-cell.cvd5-reversal-warning {
    background: rgba(220, 38, 38, 0.1);
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.3);
}

.cvd-cell.cvd5-weakening-warning {
    background: rgba(245, 158, 11, 0.08);
}

.cvd-cell.cvd5-blocked-signal {
    background: rgba(148, 163, 184, 0.08);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.cvd-cell.cvd5-shock-up {
    background: rgba(14, 165, 233, 0.08);
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35);
}

.cvd-cell.cvd5-shock-down {
    background: rgba(249, 115, 22, 0.08);
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.35);
}

.cvd-cell.cvd5-surge-up {
    background: rgba(34, 197, 94, 0.08);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35);
}

@keyframes shockPulseUp {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.6); }
    50% { box-shadow: 0 0 10px 0 rgba(14, 165, 233, 0); }
}

@keyframes shockPulseDown {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.6); }
    50% { box-shadow: 0 0 10px 0 rgba(249, 115, 22, 0); }
}

.cvd-cell .cvd-delta {
    font-size: 0.75rem;
    margin-top: 2px;
    font-weight: 600;
}

.cvd-cell .cvd-spike {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.4);
    color: #E2E8F0;
}

.cvd-cell .cvd-spike.inflow {
    border-color: rgba(34, 197, 94, 0.6);
    color: #4ADE80;
}

.cvd-cell .cvd-spike.outflow {
    border-color: rgba(248, 113, 113, 0.6);
    color: #F87171;
}

.cvd-cell.cvd-spike-inflow {
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.cvd-cell.cvd-spike-outflow {
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.signal-cell {
    text-align: center;
    vertical-align: middle;
}

.target-trend-cell .indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 120px;
}

.indicator {
    color: #94A3B8;
    font-style: italic;
    font-size: 0.8rem;
    padding: 6px 8px !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.indicator .ts-small {
    font-size: 0.7rem;
    color: #64748B;
    margin-top: 2px;
    font-style: normal;
}

/* Trading Signal Status Styles (class-based only) */
.indicator.signal-strong-buy {
    background: var(--signal-strong-buy-cell);
    color: var(--signal-strong-buy-text);
    font-weight: 700;
    font-style: normal;
    border-left: 3px solid var(--signal-strong-buy-border);
}

.indicator.signal-buy {
    background: var(--signal-buy-cell);
    color: var(--signal-buy-text);
    font-weight: 600;
    font-style: normal;
    border-left: 3px solid var(--signal-buy-border);
}

.indicator.signal-neutral {
    background: var(--signal-neutral-cell);
    color: var(--signal-neutral-text);
    font-weight: 600;
    font-style: normal;
    border-left: 3px solid var(--signal-neutral-border);
}

.indicator.signal-sell {
    background: var(--signal-sell-cell);
    color: var(--signal-sell-text);
    font-weight: 600;
    font-style: normal;
    border-left: 3px solid var(--signal-sell-border);
}

.indicator.signal-strong-sell {
    background: var(--signal-strong-sell-cell);
    color: var(--signal-strong-sell-text);
    font-weight: 700;
    font-style: normal;
    border-left: 3px solid var(--signal-strong-sell-border);
}

.indicator.signal-strong-buy:hover,
.indicator.signal-buy:hover,
.indicator.signal-neutral:hover,
.indicator.signal-sell:hover,
.indicator.signal-strong-sell:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Modal styles with GPU acceleration */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transform: translateZ(0);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.modal-header {
    color: #F1F5F9;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

.modal-body {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #94A3B8;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: rgba(15, 23, 42, 0.5);
    color: #F1F5F9;
}

.form-group input:focus {
    outline: none;
    border-color: #3B82F6;
    background: rgba(15, 23, 42, 0.7);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:disabled {
    background: rgba(71, 85, 105, 0.3);
    cursor: not-allowed;
    color: #94A3B8;
    font-weight: 600;
}

.form-group input[value="Market"]:disabled {
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.5px;
    border-color: rgba(59, 130, 246, 0.4);
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.modal-btn-cancel {
    background: rgba(71, 85, 105, 0.5);
    color: #F1F5F9;
    border: 1px solid rgba(71, 85, 105, 0.8);
}

.modal-btn-cancel:hover {
    background: rgba(71, 85, 105, 0.7);
}

.modal-btn:disabled {
    background: #475569;
    cursor: not-allowed;
}

/* Toast notification styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none;
    min-width: 300px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.toast.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid #10B981;
}

.toast.error {
    border-left: 4px solid #EF4444;
}

.toast-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #F1F5F9;
}

.toast.success .toast-title {
    color: #10B981;
}

.toast.error .toast-title {
    color: #EF4444;
}

.toast-message {
    color: #94A3B8;
    font-size: 0.9rem;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cellPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Recent timestamp highlighting */
.ts-small.recent {
    color: #ff4d4f !important;
    font-weight: 700;
    position: relative;
}

@keyframes recentFlash {
    0%, 100% { background-color: rgba(255, 0, 0, 0.05); }
    50% { background-color: rgba(255, 0, 0, 0.25); }
}

.ts-small.recent {
    animation: recentFlash 2s ease-in-out infinite;
    border-left: 2px solid #ff4d4f;
    padding-left: 4px;
}

/* BTC Signal Column Styles */
.btc-signal-cell {
    padding: 4px 8px !important;
}

.btc-signal-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 100px;
}

.btc-signal-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btc-signal-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.btc-signal-value {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
}

.btc-signal-loading,
.btc-signal-error {
    font-size: 0.75rem;
    color: #94A3B8;
    font-style: italic;
    padding: 8px;
}

.btc-signal-error {
    color: #EF4444;
}

/* RF Score Column Styles */
.rf-score-cell {
    padding: 4px 8px !important;
    text-align: center;
}

.rf-score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 90px;
}

.rf-score-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rf-score-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.rf-score-value {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

.rf-score-loading {
    font-size: 0.75rem;
    color: #94A3B8;
    font-style: italic;
    padding: 8px;
}

/* Rank Column Styles */
.rank-cell {
    padding: 4px 8px !important;
    text-align: center;
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.85rem;
    min-width: 50px;
}

/* Status Column Styles */
.status-cell {
    padding: 4px 8px !important;
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
    min-width: 82px;
}

.status-open {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.status-closed {
    background: rgba(71, 85, 105, 0.35);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.5);
}

.status-unknown {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.45);
}

.status-error {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.45);
}

.status-loading {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5f5;
    border-color: rgba(148, 163, 184, 0.45);
}

/* Buy Button Style */
.btn-buy {
    padding: 6px 16px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-buy:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}

.btn-buy:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .market-health-widget {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-links a {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .refresh-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .market-health-widget {
        padding: 15px;
        gap: 12px;
    }

    .mh-card, .mtx-card {
        padding: 15px;
    }

    .mh-score, .mtx-score {
        font-size: 2rem;
    }

    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 8px 5px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal-header {
        font-size: 1.2rem;
    }

    .form-group input {
        padding: 10px;
    }

    .toast {
        min-width: 250px;
        right: 10px;
        top: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .last-update {
        flex-direction: column;
        gap: 8px;
    }

    .mh-details {
        flex-direction: column;
    }

    .mh-detail-item {
        min-width: 100%;
    }

    th, td {
        padding: 6px 3px;
        font-size: 0.7rem;
    }

    .btn-buy {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}
