/* ═══════════════════════════════════════════════════════════════════════════
   Polymarket Dashboard — Dark Blue Glassmorphism Theme
   Apple liquid glass aesthetic: frosted glass panels, transparency, blur
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg-deep: #060d1a;
    --bg-primary: #0a1628;
    --bg-secondary: #0f1f38;
    --glass-bg: rgba(20, 40, 70, 0.45);
    --glass-border: rgba(80, 140, 200, 0.15);
    --glass-hover: rgba(30, 60, 100, 0.55);
    --glass-blur: 20px;

    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --accent-soft: rgba(59, 130, 246, 0.12);

    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.3);

    --text-primary: #e8f0ff;
    --text-secondary: #8ba3c4;
    --text-muted: #5a7090;

    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    background: var(--bg-deep);
    color: var(--text-primary);
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: transparent;
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Statistical font for numbers/data */
.text-mono, .stat-value, .data-table .cell-mono, .position-pnl, .qr-address, .log-viewer {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace !important;
}

/* Ambient gradient background (on html, behind the video) */
html {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(30, 60, 120, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(20, 50, 100, 0.1) 0%, transparent 50%),
        var(--bg-deep);
}

/* ── Glass Panel (core component) ──────────────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Login Page ────────────────────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    padding: 48px 36px;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.login-logo {
    color: var(--accent);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.login-logo img.login-logo-img {
    width: 288px;
    height: auto;
    max-height: 288px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(10, 20, 40, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-form input::placeholder {
    color: var(--text-muted);
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--accent);
}

.btn-primary:hover {
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 20px var(--danger-glow);
}

.btn-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 20px var(--success-glow);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

/* ── Main Layout ───────────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 24px 16px;
    background: rgba(8, 16, 30, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 24px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
}

.sidebar-logo img.sidebar-logo-img {
    width: 200px;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.sidebar-logo svg {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.sidebar-logo span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.2);
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.proxy-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.ok { background: var(--success); box-shadow: 0 0 6px var(--success-glow); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 6px var(--danger-glow); }

/* ── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 32px 40px;
    max-width: 1400px;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-title {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ── Stat Cards (line style — no boxes) ─────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 20px 0;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-top: 2px solid rgba(100, 160, 220, 0.25) !important;
    border-bottom: 1px solid rgba(100, 160, 220, 0.12) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: var(--transition);
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 30%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    transition: width 0.5s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: none !important;
}

.stat-card:hover::before {
    width: 100%;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.1;
    min-height: 35px;
}

.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--danger); }

.stat-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ── Tables ────────────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(80, 140, 200, 0.06);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(59, 130, 246, 0.04);
}

.data-table .cell-mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-won { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-lost { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-stop_loss { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-open { background: rgba(59, 130, 246, 0.15); color: var(--accent); }

/* ── Position Cards ────────────────────────────────────────────────────────── */
.position-card {
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.position-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.position-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(10, 20, 40, 0.5);
}

.position-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.position-info {
    flex: 1;
    min-width: 0;
}

.position-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.position-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.position-pnl {
    text-align: right;
    font-weight: 600;
    font-size: 15px;
}

.position-pnl.positive { color: var(--success); }
.position-pnl.negative { color: var(--danger); }

.position-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Log Viewer ────────────────────────────────────────────────────────────── */
.log-viewer {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.6;
    padding: 16px 20px;
    background: rgba(4, 8, 16, 0.6);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-viewer .log-line {
    padding: 1px 0;
}

.log-line.error { color: var(--danger); }
.log-line.warning { color: var(--warning); }
.log-line.success { color: var(--success); }
.log-line.info { color: var(--text-secondary); }

.log-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.log-file-item:hover {
    background: var(--glass-hover);
    border-color: var(--accent);
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.form-field {
    flex: 1;
    min-width: 200px;
}

.form-field label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(10, 20, 40, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── QR Code ───────────────────────────────────────────────────────────────── */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-container img {
    border-radius: var(--radius-sm);
    background: white;
    padding: 12px;
}

.qr-address {
    font-family: 'SF Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-all;
    margin-top: 12px;
    padding: 10px;
    background: rgba(10, 20, 40, 0.5);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.qr-address:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ── Tabs / Sections ───────────────────────────────────────────────────────── */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Chart Container ───────────────────────────────────────────────────────── */
.chart-container {
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    height: 360px;
}

.chart-canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 12px;
}

.pagination .page-info {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 0 12px;
}

/* ── Toast Notifications ───────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast.success { background: rgba(16, 185, 129, 0.2); border: 1px solid var(--success); color: var(--success); }
.toast.error { background: rgba(239, 68, 68, 0.2); border: 1px solid var(--danger); color: var(--danger); }
.toast.info { background: var(--glass-bg); border: 1px solid var(--accent); color: var(--accent); }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.modal {
    padding: 28px 32px;
    max-width: 480px;
    width: 90%;
    animation: fadeInUp 0.3s ease;
}

.modal h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ── Notice / Alert ────────────────────────────────────────────────────────── */
.notice {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}

.notice.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.notice.info {
    background: var(--accent-soft);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
}

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(80, 140, 200, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(80, 140, 200, 0.4); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar { width: 60px; }
    .sidebar-logo span, .nav-item span, .proxy-status span { display: none; }
    .main-content { padding: 20px; }
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.text-positive { color: var(--success); }
.text-negative { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-mono { font-family: 'SF Mono', monospace; font-size: 12px; }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.loading { opacity: 0.5; pointer-events: none; }
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATED BACKGROUND — Orbs, Grid, Particles, Video
   ═══════════════════════════════════════════════════════════════════════════ */

.bg-animated, .bg-video {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-video {
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    filter: saturate(1.3) brightness(0.6);
}

/* If video fails to load (no bg.mp4), hide it cleanly */
.bg-video source[src=""] { display: none; }

/* ── Flowing gradient orbs ─────────────────────────────────────────────────── */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4), transparent 70%);
    top: -10%; left: -10%;
    animation-duration: 25s;
}

.orb-2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent 70%);
    bottom: -15%; right: -10%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25), transparent 70%);
    top: 40%; left: 50%;
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, -40px) scale(1.1); }
    50% { transform: translate(-40px, 60px) scale(0.95); }
    75% { transform: translate(30px, 30px) scale(1.05); }
}

/* ── Subtle grid overlay ───────────────────────────────────────────────────── */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ── Floating particles ────────────────────────────────────────────────────── */
.bg-particles {
    position: absolute;
    inset: 0;
}

.bg-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(100, 160, 255, 0.5);
    border-radius: 50%;
    animation: particleDrift linear infinite;
    box-shadow: 0 0 6px rgba(100, 160, 255, 0.3);
}

@keyframes particleDrift {
    from { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    to { transform: translateY(-10vh) translateX(50px); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MORE TRANSPARENT GLASS — let background show through
   ═══════════════════════════════════════════════════════════════════════════ */

.glass-panel {
    background: rgba(15, 30, 55, 0.35);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(100, 160, 220, 0.12);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-card.glass-panel {
    background: rgba(15, 30, 55, 0.3);
}

.sidebar {
    background: rgba(6, 12, 24, 0.5);
    backdrop-filter: blur(20px) saturate(160%);
}

.chart-container.glass-panel {
    background: rgba(12, 24, 44, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ENTRANCE ANIMATIONS — staggered fade-in-up for tab content
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes chartGrow {
    from { opacity: 0; transform: scaleY(0.8) scaleX(0.95); transform-origin: bottom; }
    to { opacity: 1; transform: scaleY(1) scaleX(1); }
}

/* Stagger stat cards */
.tab-content.active .stat-card {
    animation: slideUpFade 0.5s ease forwards;
    opacity: 0;
}
.tab-content.active .stat-card:nth-child(1) { animation-delay: 0.05s; }
.tab-content.active .stat-card:nth-child(2) { animation-delay: 0.1s; }
.tab-content.active .stat-card:nth-child(3) { animation-delay: 0.15s; }
.tab-content.active .stat-card:nth-child(4) { animation-delay: 0.2s; }
.tab-content.active .stat-card:nth-child(5) { animation-delay: 0.25s; }
.tab-content.active .stat-card:nth-child(6) { animation-delay: 0.3s; }
.tab-content.active .stat-card:nth-child(7) { animation-delay: 0.35s; }
.tab-content.active .stat-card:nth-child(8) { animation-delay: 0.4s; }

/* Animate chart containers */
.tab-content.active .chart-container {
    animation: chartGrow 0.6s ease forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

/* Animate sections */
.tab-content.active .section {
    animation: slideUpFade 0.5s ease forwards;
    opacity: 0;
}
.tab-content.active .section:nth-child(2) { animation-delay: 0.2s; }
.tab-content.active .section:nth-child(3) { animation-delay: 0.35s; }
.tab-content.active .section:nth-child(4) { animation-delay: 0.5s; }

/* Animate position cards with stagger */
.tab-content.active .position-card {
    animation: slideUpFade 0.4s ease forwards;
    opacity: 0;
}

/* Animate tables */
.tab-content.active .data-table {
    animation: slideUpFade 0.5s ease forwards;
    opacity: 0;
    animation-delay: 0.15s;
}

/* Animate stat values with subtle pulse */
@keyframes valuePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.stat-value {
    animation: valuePulse 0.4s ease;
    animation-delay: 0.5s;
}

/* Page header animation */
.tab-content.active .page-header {
    animation: slideUpFade 0.4s ease forwards;
    opacity: 0;
}

/* Nav items stagger on load */
.nav-item {
    animation: slideUpFade 0.3s ease forwards;
    opacity: 0;
}
.nav-item:nth-child(2) { animation-delay: 0.05s; }
.nav-item:nth-child(3) { animation-delay: 0.1s; }
.nav-item:nth-child(4) { animation-delay: 0.15s; }
.nav-item:nth-child(5) { animation-delay: 0.2s; }
.nav-item:nth-child(6) { animation-delay: 0.25s; }
.nav-item:nth-child(7) { animation-delay: 0.3s; }
.nav-item:nth-child(8) { animation-delay: 0.35s; }

/* Login card entrance */
.login-card {
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TIMEFRAME SELECTOR + CHART TRAIL ANIMATION
   ═══════════════════════════════════════════════════════════════════════════ */

.tf-selector {
    background: rgba(10, 20, 40, 0.6);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 13px;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.tf-selector:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-soft);
}

.tf-selector:focus {
    outline: none;
    border-color: var(--accent);
}

.tf-selector option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Chart container */
.chart-container {
    overflow: hidden;
    position: relative;
}
