/* ============================================================
   DEX Arbitrage Dashboard - Custom Styles v3.0
   ============================================================ */

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0e17; }
::-webkit-scrollbar-thumb { background: #1e2a40; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2d3e5c; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #1e2a40; }

/* Fade-in animation */
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered fade-in for grids */
.stagger > * { animation: fadeIn 0.5s ease-out backwards; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.40s; }

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px; border-radius: 3px;
    background: #1e2a40; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #10b981; cursor: pointer; border: 2px solid #0f1623;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}
input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: #10b981; cursor: pointer; border: 2px solid #0f1623;
}

/* Card hover lift */
.card-hover { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Glow effects for emerald elements */
.glow-emerald { box-shadow: 0 0 20px rgba(16, 185, 129, 0.15); }
.glow-emerald-strong { box-shadow: 0 0 30px rgba(16, 185, 129, 0.3); }
.text-glow { text-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
.glow-red { box-shadow: 0 0 20px rgba(239, 68, 68, 0.2); }
.glow-amber { box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
.glow-sky { box-shadow: 0 0 20px rgba(56, 189, 248, 0.2); }

/* Toggle switch smooth animation */
.toggle-track { transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.toggle-knob { transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

/* Pulsing animation for live indicators */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { opacity: 0.6; transform: scale(1.15); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

@keyframes pulse-red {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.pulse-red { animation: pulse-red 1.5s ease-in-out infinite; }

@keyframes pulse-amber {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.pulse-amber { animation: pulse-amber 1.8s ease-in-out infinite; }

/* Shimmer loading effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.shimmer {
    background: linear-gradient(90deg, #0f1623 25%, #1e2a40 50%, #0f1623 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Sparkline styling */
.sparkline { display: inline-block; vertical-align: middle; }
.sparkline path.line { fill: none; stroke-width: 1.5; }
.sparkline path.area { opacity: 0.15; }

/* Gauge / conic-gradient */
.gauge-bg {
    background: conic-gradient(from 180deg, #1e2a40 0deg, #1e2a40 360deg);
    border-radius: 50%;
}
.gauge-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }

/* Badge animation */
@keyframes badge-pop {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.badge-pop { animation: badge-pop 0.3s ease-out; }

/* Progress bar animation */
@keyframes progress-fill {
    from { width: 0; }
}
.progress-anim { animation: progress-fill 0.8s ease-out; }

/* Toast notification styling */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    padding: 12px 20px; border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 100; font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    animation: toastIn 0.3s ease-out;
    backdrop-filter: blur(8px);
}
.toast-success { background: rgba(16, 185, 129, 0.95); color: #fff; }
.toast-error { background: rgba(239, 68, 68, 0.95); color: #fff; }
.toast-info { background: rgba(56, 189, 248, 0.95); color: #fff; }
.toast-warning { background: rgba(245, 158, 11, 0.95); color: #fff; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal backdrop blur */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(10, 14, 23, 0.7);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.modal-box {
    background: #0f1623; border: 1px solid #1e2a40;
    border-radius: 16px; max-width: 560px; width: 90%;
    max-height: 85vh; overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Tooltip styling */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #1e2a40; color: #e2e8f0;
    padding: 4px 10px; border-radius: 6px;
    font-size: 11px; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s; z-index: 50;
}
[data-tooltip]:hover::after { opacity: 1; }

/* Chart-specific styles */
.chart-grid line { stroke: #1e2a40; stroke-width: 0.5; }
.chart-axis text { fill: #64748b; font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.chart-line { fill: none; stroke-width: 2; }
.chart-area { opacity: 0.1; }
.chart-bar { transition: opacity 0.2s; }
.chart-bar:hover { opacity: 0.8; }
.chart-dot { transition: r 0.2s; cursor: pointer; }
.chart-dot:hover { r: 5; }

/* Animated counter */
.count-up { display: inline-block; }

/* Flow diagram connectors */
.flow-connector {
    position: relative;
    background: linear-gradient(90deg, #1e2a40 0%, #1e2a40 100%);
    height: 2px;
}
.flow-connector::after {
    content: ''; position: absolute;
    top: -2px; left: 0; width: 30%; height: 6px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
    animation: flow-pulse 2s linear infinite;
}
@keyframes flow-pulse {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* Hold-to-confirm button */
.hold-btn {
    position: relative; overflow: hidden;
    transition: background-color 0.3s;
}
.hold-btn .hold-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0%; background: rgba(255, 255, 255, 0.2);
    transition: width 0.05s linear;
}

/* Nav badge */
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; font-size: 10px; font-weight: 700;
    background: rgba(239, 68, 68, 0.9); color: #fff;
}

/* Filter button active */
.filter-active {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
}

/* Status badge colors */
.status-pending { color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
.status-confirming { color: #38bdf8; background: rgba(56, 189, 248, 0.1); }
.status-success { color: #34d399; background: rgba(52, 211, 153, 0.1); }
.status-failed { color: #f87171; background: rgba(248, 113, 113, 0.1); }

/* Severity colors */
.sev-critical { border-left: 3px solid #ef4444; }
.sev-warning { border-left: 3px solid #f59e0b; }
.sev-info { border-left: 3px solid #38bdf8; }

/* Conic gradient pie */
.pie-chart {
    border-radius: 50%;
    position: relative;
}
.pie-chart::after {
    content: ''; position: absolute; inset: 20%;
    background: #0f1623; border-radius: 50%;
}

/* Smooth color transitions */
.smooth { transition: all 0.2s ease; }

/* Dropdown select dark theme */
select option { background: #0f1623; color: #e2e8f0; }

/* Input focus glow */
input:focus, select:focus, textarea:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

/* Hexagonal radar */
.radar-hex {
    fill: rgba(16, 185, 129, 0.1);
    stroke: #10b981; stroke-width: 1.5;
}
.radar-axis { stroke: #1e2a40; stroke-width: 0.5; }
.radar-label { fill: #64748b; font-size: 9px; font-family: 'Inter', sans-serif; }

/* QR-style box */
.qr-box {
    background:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%, transparent 75%, #e2e8f0 75%),
        linear-gradient(45deg, #e2e8f0 25%, #0f1623 25%, #0f1623 75%, #e2e8f0 75%);
    background-size: 8px 8px;
    background-position: 0 0, 4px 4px;
    border: 4px solid #e2e8f0;
    border-radius: 8px;
}

/* Scrolling ticker */
@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.ticker-anim { animation: ticker 30s linear infinite; white-space: nowrap; }

/* Tab content */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease-out; }
.tab-btn.active { color: #34d399; border-bottom: 2px solid #10b981; }
