/* ============================================================
   Kovdection Dashboard — style.css
   Premium crypto signal dashboard with glass morphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: rgba(17, 17, 17, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-glass-hover: rgba(255, 255, 255, 0.12);
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --cyan: #00f5ff;
  --cyan-dim: rgba(0, 245, 255, 0.15);
  --cyan-glow: rgba(0, 245, 255, 0.3);
  --lime: #a3e635;
  --lime-dim: rgba(163, 230, 53, 0.12);
  --lime-glow: rgba(163, 230, 53, 0.25);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --red-glow: rgba(248, 113, 113, 0.25);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.12);
  --sidebar-width: 240px;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0, 245, 255, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(163, 230, 53, 0.02) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 0%, var(--bg-primary) 100%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: rgba(5, 5, 5, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-glass);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--cyan), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand .subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

.sidebar-nav { padding: 16px 12px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  cursor: pointer;
}

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

.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(0, 245, 255, 0.15);
}

.nav-item i { width: 20px; text-align: center; font-size: 1rem; }

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

.sidebar-footer .status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime-glow);
  margin-right: 8px;
}

.sidebar-footer span { font-size: 0.75rem; color: var(--text-muted); }

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 24px 32px 48px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

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

.header-left h2 { font-size: 1.5rem; font-weight: 600; }

.header-left .updated {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 8px 16px;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s;
}

.search-box:focus-within { border-color: rgba(0, 245, 255, 0.3); }
.search-box i { color: var(--text-muted); font-size: 0.875rem; }

.search-box input {
  background: transparent;
  border: none; outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  width: 200px;
}

.search-box input::placeholder { color: var(--text-muted); }

.coin-count-badge {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  backdrop-filter: blur(12px);
}

.coin-count-badge strong { color: var(--cyan); }

/* ---- ALIGNMENT CARDS ---- */
.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.alignment-cards {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.alignment-card {
  flex: 0 0 180px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(16px);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.alignment-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 14px 14px 0 0;
}

.alignment-card.long::before { background: linear-gradient(90deg, var(--lime), transparent); }
.alignment-card.short::before { background: linear-gradient(90deg, var(--red), transparent); }

.alignment-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.alignment-card .card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.alignment-card .coin-icon { width: 28px; height: 28px; border-radius: 50%; }
.alignment-card .coin-name { font-weight: 600; font-size: 0.95rem; }

.alignment-card .direction-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.alignment-card .change {
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 6px;
}

/* ---- FILTER & SORT ---- */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-pills { display: flex; gap: 8px; }

.filter-pill {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.filter-pill:hover { border-color: var(--border-glass-hover); color: var(--text-primary); }

.filter-pill.active {
  background: var(--cyan-dim);
  border-color: rgba(0, 245, 255, 0.25);
  color: var(--cyan);
}

.sort-select {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
  outline: none;
}

.sort-select option { background: #1a1a1a; color: var(--text-primary); }

/* ---- TABLE ---- */
.table-container {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  overflow: hidden;
  margin-bottom: 16px;
}

.signal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.signal-table thead th {
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(8px);
}

.signal-table thead th.group-header {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.65rem;
  padding-bottom: 4px;
  border-bottom: none;
}

.signal-table thead th.sub-header {
  border-top: none;
  padding-top: 4px;
  font-size: 0.65rem;
}

.signal-table thead .tooltip-icon {
  display: inline-block;
  width: 14px; height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 0.55rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  margin-left: 4px;
  cursor: help;
  vertical-align: middle;
  position: relative;
}

.tooltip-icon .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(23, 23, 23, 0.95);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-glass);
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  transition: opacity 0.15s;
}

.tooltip-icon:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.signal-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
  transition: all 0.2s ease;
}

.signal-table tbody tr:hover {
  background: rgba(163, 230, 53, 0.03);
  box-shadow: inset 0 0 0 1px rgba(163, 230, 53, 0.06);
  transform: scale(1.002);
}

.signal-table tbody td {
  padding: 11px 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.rank-cell {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  width: 36px;
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.asset-cell img { width: 24px; height: 24px; border-radius: 50%; }
.asset-cell .symbol { font-weight: 600; font-size: 0.9rem; }

.price-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--text-primary);
}

.change-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 0.8rem;
}

/* Direction pills */
.dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.dir-pill.long { background: var(--lime-dim); color: var(--lime); }
.dir-pill.short { background: var(--red-dim); color: var(--red); }
.dir-pill.neutral { color: var(--text-muted); font-size: 0.9rem; }

/* Macro badges */
.macro-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.macro-badge.bull { background: var(--lime-dim); color: var(--lime); }
.macro-badge.bear { background: var(--red-dim); color: var(--red); }
.macro-badge.range { background: var(--yellow-dim); color: var(--yellow); }

/* Strength */
.strength-cell { display: flex; align-items: center; gap: 6px; }

.strength-bar {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.strength-bar-fill.high { background: var(--lime); }
.strength-bar-fill.mid { background: var(--yellow); }
.strength-bar-fill.low { background: var(--red); }

.strength-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-secondary);
  min-width: 24px;
}

/* Pattern */
.pattern-dot { font-size: 0.9rem; text-shadow: 0 0 6px currentColor; }
.pattern-dot.bullish { color: var(--lime); }
.pattern-dot.bearish { color: var(--red); }
.pattern-dot.none { color: var(--text-muted); text-shadow: none; }

/* Performance */
.perf-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
}

.perf-cell.positive { color: var(--lime); }
.perf-cell.negative { color: var(--red); }
.perf-cell.zero { color: var(--text-muted); }

/* ---- PAGINATION ---- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
}

.page-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover { border-color: var(--border-glass-hover); color: var(--text-primary); }

.page-btn.active {
  background: var(--cyan-dim);
  border-color: rgba(0, 245, 255, 0.25);
  color: var(--cyan);
}

.page-btn:disabled { opacity: 0.3; cursor: default; }

/* ---- TOP PERFORMERS ---- */
.performers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 14px;
  margin-bottom: 28px;
}

.performer-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(12px);
  transition: all 0.2s;
}

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

.performer-card .card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.performer-card .coin-icon { width: 28px; height: 28px; border-radius: 50%; }
.performer-card .coin-name { font-weight: 600; font-size: 0.95rem; }

.performer-card .perf-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
}

.performer-card .perf-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ---- DISCLAIMER ---- */
.disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 20px 0 32px;
  border-top: 1px solid var(--border-glass);
  margin-top: 20px;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px; }
}

@media (max-width: 768px) {
  .header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .search-box input { width: 140px; }
  .controls-bar { flex-direction: column; align-items: flex-start; }
}

/* === Background image overlay === */
body {
  background-image: url('/static/bg-crypto.jpg') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 5, 5, 0.98);
  z-index: -1;
}

/* === Color-coded cycle phases === */
.cycle-rising, .cycle-bullish { color: var(--lime) !important; }
.cycle-falling, .cycle-bearish { color: var(--red) !important; }
.cycle-peak { color: #fbbf24 !important; }
.cycle-trough { color: #00f5ff !important; }
.cycle-unknown { color: var(--text-muted) !important; }

/* === Color-coded macro === */
.macro-bull { color: var(--lime) !important; }
.macro-bear { color: var(--red) !important; }
.macro-range { color: #fbbf24 !important; }

/* Solid table background - no bleed */
.main-content { position: relative; z-index: 1; }
table { background: #0d0d0d !important; }
.table-card, .glass { background: rgba(13, 13, 13, 0.98) !important; backdrop-filter: blur(40px) !important; }
.pagination-bar { background: #0a0a0a !important; position: relative; z-index: 2; }
