/* ============================================
   Bridge ELO — Sci-Fi HUD Design System
   ============================================
   Pattern: light-mode defaults, .dark overrides
   ============================================ */

/* HTMX loading indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }

/* Smooth transitions */
* {
    transition-property: background-color, border-color;
    transition-duration: 150ms;
}

/* ── HUD Panel ── */
.hud-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    position: relative;
    overflow: hidden;
}
.dark .hud-panel {
    background: #0a1628;
    border-color: #0f3460;
}

/* Corner brackets */
.hud-corners::before, .hud-corners::after {
    content: ''; position: absolute; width: 8px; height: 8px; pointer-events: none; opacity: 0.2;
}
.hud-corners::before { top: -1px; left: -1px; border-top: 2px solid #3b82f6; border-left: 2px solid #3b82f6; }
.hud-corners::after { bottom: -1px; right: -1px; border-bottom: 2px solid #3b82f6; border-right: 2px solid #3b82f6; }
.hud-corners .c-tr { position: absolute; top: -1px; right: -1px; width: 8px; height: 8px; border-top: 2px solid #3b82f6; border-right: 2px solid #3b82f6; opacity: 0.2; pointer-events: none; }
.hud-corners .c-bl { position: absolute; bottom: -1px; left: -1px; width: 8px; height: 8px; border-bottom: 2px solid #3b82f6; border-left: 2px solid #3b82f6; opacity: 0.2; pointer-events: none; }
.dark .hud-corners::before, .dark .hud-corners::after { border-color: #00fff2; opacity: 0.4; }
.dark .hud-corners .c-tr, .dark .hud-corners .c-bl { border-color: #00fff2; opacity: 0.4; }

/* Panel header */
.panel-hdr {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
}
.dark .panel-hdr { border-color: #0f3460; }
.panel-title {
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 0.95rem;
    color: #0369a1; letter-spacing: 0.04em; text-transform: uppercase;
}
.dark .panel-title { color: #00fff2; }
.panel-sub { font-size: 0.7rem; font-family: 'Share Tech Mono', monospace; color: #7e96ad; }

/* Panel glow on hover */
.hud-glow { transition: border-color 0.3s, box-shadow 0.3s; }
.dark .hud-glow:hover { border-color: rgba(0,255,242,0.25); }

/* Cyan heading */
.hud-heading { color: #0369a1; font-family: 'Rajdhani', sans-serif; font-weight: 700; letter-spacing: 0.03em; }
.dark .hud-heading { color: #00fff2; }

/* Accent line */
.hud-line { height: 1px; background: linear-gradient(90deg, transparent, #3b82f6, transparent); opacity: 0.15; }
.dark .hud-line { background: linear-gradient(90deg, transparent, #00fff2, transparent); opacity: 0.25; }

/* Subtle top accent */
.hud-accent-top { position: relative; }
.hud-accent-top::before {
    content: ''; position: absolute; top: 0; left: 1rem; right: 1rem; height: 1px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent); opacity: 0.15;
}
.dark .hud-accent-top::before {
    background: linear-gradient(90deg, transparent, #00fff2, transparent); opacity: 0.3;
}

/* ── Labels / Values ── */
.hud-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; }
.dark .hud-label { color: #7e96ad; }
.hud-value { font-family: 'Share Tech Mono', monospace; font-size: 1.4rem; color: #0f172a; }
.dark .hud-value { color: #d8e5f0; }
.hud-value.cyan { color: #0891b2; }
.dark .hud-value.cyan { color: #00fff2; }

/* ── ELO tier colors — NO text-shadow ── */
.elo-legendary { color: #db2777; }
.elo-master    { color: #ea580c; }
.elo-diamond   { color: #d97706; }
.elo-platinum  { color: #0891b2; }
.elo-gold      { color: #059669; }
.elo-silver    { color: #64748b; }
.dark .elo-legendary { color: #f472b6; }
.dark .elo-master    { color: #fb923c; }
.dark .elo-diamond   { color: #fbbf24; }
.dark .elo-platinum  { color: #00fff2; }
.dark .elo-gold      { color: #34d399; }
.dark .elo-silver    { color: #7e96ad; }

/* Delta */
.delta-pos  { color: #059669; }
.delta-neg  { color: #dc2626; }
.delta-zero { color: #64748b; }
.dark .delta-pos  { color: #34d399; }
.dark .delta-neg  { color: #f87171; }
.dark .delta-zero { color: #7e96ad; }

/* ── Rank badges ── */
.rk-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.5rem; height: 1.5rem; border-radius: 0.25rem;
    font-family: 'Share Tech Mono', monospace; font-weight: 700; font-size: 0.7rem;
}
.rk-gold   { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.rk-silver { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #374151; }
.rk-bronze { background: linear-gradient(135deg, #d97706, #b45309); color: #fef3c7; }

/* ── Tier pills ── */
.tier-pill {
    font-size: 0.55rem; font-weight: 700; padding: 0.1rem 0.35rem;
    border-radius: 9999px; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap;
    display: inline-block;
}
.tier-legendary { background: linear-gradient(135deg, #ec4899, #be185d); color: #fff; }
.tier-master    { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.tier-diamond   { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; }
.tier-platinum  { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; }
.tier-gold      { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.tier-silver    { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }

/* ── HUD pills ── */
.hud-pill {
    display: inline-flex; align-items: center; padding: 0.2rem 0.5rem;
    border-radius: 9999px; font-size: 0.7rem; font-weight: 500;
    background: #f1f5f9; border: 1px solid #e2e8f0; color: #64748b;
}
.hud-pill-cyan { border-color: #bae6fd; color: #0284c7; background: #f0f9ff; }
.dark .hud-pill { background: #0e1f3a; border-color: #0f3460; color: #7e96ad; }
.dark .hud-pill-cyan { border-color: rgba(0,255,242,0.25); color: #00fff2; background: rgba(0,255,242,0.06); }

/* ── Table ── */
.hud-table { width: 100%; border-collapse: collapse; }
.hud-table th {
    text-align: left; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #64748b; padding: 0.5rem 0.75rem; font-weight: 500; border-bottom: 1px solid #e2e8f0;
}
.dark .hud-table th { color: #7e96ad; border-color: #0f3460; }
.hud-table th.r { text-align: right; }
.sort-hdr { cursor: pointer; color: inherit; text-decoration: none; white-space: nowrap; }
.sort-hdr:hover { color: #0ea5e9; }
.dark .sort-hdr:hover { color: #58a6ff; }
.sort-hdr.active { color: #0ea5e9; }
.dark .sort-hdr.active { color: #58a6ff; }
.hud-table td {
    padding: 0.55rem 0.75rem; border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem; vertical-align: middle;
}
.dark .hud-table td { border-color: rgba(15,52,96,0.35); }
.hud-table tr:hover td { background: rgba(59,130,246,0.03); }
.dark .hud-table tr:hover td { background: rgba(0,255,242,0.03); }
.hud-table a { color: #1e293b; text-decoration: none; transition: color 0.15s; }
.hud-table a:hover { color: #0284c7; }
.dark .hud-table a { color: #d8e5f0; }
.dark .hud-table a:hover { color: #00fff2; }

/* Legacy compat */
.table-row-hover:hover { background: rgba(59,130,246,0.03); }
.dark .table-row-hover:hover { background: rgba(0,255,242,0.03); }

/* ── Progress bar ── */
.hud-progress { height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.dark .hud-progress { background: #0f1f30; }
.hud-progress .fill {
    height: 100%; border-radius: 3px; background: #0ea5e9; transition: width 0.6s ease;
}
.dark .hud-progress .fill { background: #00fff2; }

/* Score highlight */
.score-high { color: #d97706; font-weight: 600; }
.dark .score-high { color: #fbbf24; }

/* ── Badge cards ── */
.badge-card { transition: transform 0.2s, border-color 0.3s; }
.badge-card:hover { transform: translateY(-2px); }
.dark .badge-card:hover { border-color: rgba(0,255,242,0.25); }

/* Card background tints */
.badge-bg-gold { background: rgba(234,179,8,0.08); }
.dark .badge-bg-gold { background: rgba(234,179,8,0.06); }
.badge-bg-silver { background: rgba(148,163,184,0.10); }
.dark .badge-bg-silver { background: rgba(148,163,184,0.06); }
.badge-bg-bronze { background: rgba(217,119,6,0.07); }
.dark .badge-bg-bronze { background: rgba(180,83,9,0.06); }

/* MAX card treatment */
.badge-bg-max { border-color: rgba(234,179,8,0.4); box-shadow: 0 0 12px rgba(234,179,8,0.08); }
.dark .badge-bg-max { border-color: rgba(234,179,8,0.3); box-shadow: 0 0 14px rgba(234,179,8,0.06); }

/* Star ratings */
.badge-stars { font-size: 0.65rem; letter-spacing: 0.5px; }
.badge-stars-empty { color: #d1d5db; }
.dark .badge-stars-empty { color: rgba(255,255,255,0.15); }

.badge-stars-gold { color: #eab308; }
.dark .badge-stars-gold { color: #facc15; }
.badge-stars-silver { color: #94a3b8; }
.dark .badge-stars-silver { color: #cbd5e1; }
.badge-stars-bronze { color: #d97706; }
.dark .badge-stars-bronze { color: #f59e0b; }

/* MAX pill */
.badge-max-pill {
    display: inline-block; padding: 2px 10px; border-radius: 9999px;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 1px;
    background: linear-gradient(135deg, #eab308, #f59e0b); color: #fff;
    text-transform: uppercase;
}
.dark .badge-max-pill {
    background: linear-gradient(135deg, #facc15, #fbbf24); color: #1a1a2e;
}

/* Progress bar tier colors */
.badge-bg-gold .hud-progress .fill { background: #eab308; }
.dark .badge-bg-gold .hud-progress .fill { background: #facc15; }
.badge-bg-silver .hud-progress .fill { background: #94a3b8; }
.dark .badge-bg-silver .hud-progress .fill { background: #cbd5e1; }
.badge-bg-bronze .hud-progress .fill { background: #d97706; }
.dark .badge-bg-bronze .hud-progress .fill { background: #f59e0b; }

/* ── Mover items (sidebar) ── */
.mover-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.85rem; border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem; transition: background 0.15s;
}
.dark .mover-item { border-color: rgba(15,52,96,0.35); }
.mover-item:last-child { border-bottom: none; }
.mover-item:hover { background: rgba(59,130,246,0.03); }
.dark .mover-item:hover { background: rgba(0,255,242,0.03); }
.mover-name a { color: #1e293b; text-decoration: none; transition: color 0.15s; }
.mover-name a:hover { color: #0284c7; }
.dark .mover-name a { color: #d8e5f0; }
.dark .mover-name a:hover { color: #00fff2; }
.mover-sub { font-size: 0.65rem; color: #7e96ad; margin-top: 0.1rem; }
.mover-delta { font-family: 'Share Tech Mono', monospace; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }

/* ── Match items (sidebar) ── */
.match-item {
    padding: 0.5rem 0.85rem; border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem; transition: background 0.15s;
}
.dark .match-item { border-color: rgba(15,52,96,0.35); }
.match-item:last-child { border-bottom: none; }
.match-item:hover { background: rgba(59,130,246,0.03); }
.dark .match-item:hover { background: rgba(0,255,242,0.03); }
.match-item a { color: #1e293b; text-decoration: none; transition: color 0.15s; }
.match-item a:hover { color: #0284c7; }
.dark .match-item a { color: #d8e5f0; }
.dark .match-item a:hover { color: #00fff2; }
.match-meta {
    font-size: 0.65rem; color: #7e96ad; margin-top: 0.15rem;
    display: flex; gap: 0.75rem; font-family: 'Share Tech Mono', monospace;
}

/* Section sub-label */
.section-label {
    padding: 0.5rem 0.85rem 0.25rem; font-size: 0.6rem;
    text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Scrollbar ── */
.dark ::-webkit-scrollbar { width: 6px; height: 6px; }
.dark ::-webkit-scrollbar-track { background: #050d18; }
.dark ::-webkit-scrollbar-thumb { background: #1a3050; border-radius: 3px; }
