@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #090c12;
  --bg2: #0e1420;
  --bg3: #141b2a;
  --bg4: #1a2235;
  --border: #1e2d45;
  --border2: #263650;
  --text: #e8edf5;
  --text2: #8a9ab8;
  --text3: #5a6b88;
  --accent-cyan: #00e5ff;
  --accent-blue: #2979ff;
  --accent-purple: #7c4dff;
  --buy: #00e676;
  --sell: #ff1744;
  --hold: #ffab00;
  --glow-cyan: 0 0 20px rgba(0,229,255,0.15);
  --glow-blue: 0 0 20px rgba(41,121,255,0.15);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
}
.orb-1 { width: 500px; height: 500px; background: #00e5ff; top: -200px; left: -150px; animation: drift 18s ease-in-out infinite alternate; }
.orb-2 { width: 400px; height: 400px; background: #7c4dff; bottom: -150px; right: -100px; animation: drift 22s ease-in-out infinite alternate-reverse; }
.orb-3 { width: 300px; height: 300px; background: #00e676; top: 50%; left: 50%; transform: translate(-50%,-50%); animation: drift 15s ease-in-out infinite; }

@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to { transform: translate(30px, 20px) scale(1.05); }
}

/* Header */
.header {
  position: relative;
  z-index: 10;
  padding: 32px 48px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,229,255,0.04) 0%, transparent 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.header-left h1 {
  font-family: 'Space Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
}
.header-left h1 span { color: var(--accent-cyan); }
.header-left .subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-top: 6px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.05em;
}
.header-right { text-align: right; display: flex; align-items: center; gap: 12px; }

/* Date selector */
.date-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-selector button {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--accent-cyan);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.date-selector button:hover { background: var(--bg4); border-color: var(--accent-cyan); }
.date-selector input[type="date"] {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--accent-cyan);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}

.date-badge {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--accent-cyan);
  display: inline-block;
}

/* Navigation tabs */
.nav-tabs {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 2px;
  padding: 0 48px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab-btn {
  padding: 14px 24px;
  background: none;
  border: none;
  color: var(--text3);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s;
}
.tab-btn.active { color: var(--text); }
.tab-btn[data-stock="OVERVIEW"].active { color: var(--accent-cyan); }
.tab-btn[data-stock="OVERVIEW"].active::after { background: var(--accent-cyan); }

/* Main content */
.main {
  position: relative;
  z-index: 10;
  padding: 32px 48px;
  max-width: 1600px;
  margin: 0 auto;
}

.panel { display: none; }
.panel.active { display: block; animation: fadeInUp 0.4s ease; }

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

/* Cards */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover { border-color: var(--border2); }
.card-glow-cyan:hover { box-shadow: var(--glow-cyan); }
.card-glow-green:hover { box-shadow: 0 0 20px rgba(0,230,118,0.1); }
.card-glow-lime:hover { box-shadow: 0 0 20px rgba(118,255,3,0.1); }
.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-label {
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Space Mono', monospace;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* Stock overview cards */
.stock-overview-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.stock-overview-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}
.stock-ticker {
  font-family: 'Space Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 2px;
}
.stock-company { font-size: 13px; color: var(--text2); margin-bottom: 10px; }
.stock-price-big {
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Decision badge */
.decision-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 100px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.decision-badge.sell { background: rgba(255,23,68,0.12); color: var(--sell); border: 1px solid rgba(255,23,68,0.3); }
.decision-badge.hold { background: rgba(255,171,0,0.12); color: var(--hold); border: 1px solid rgba(255,171,0,0.3); }
.decision-badge.buy { background: rgba(0,230,118,0.12); color: var(--buy); border: 1px solid rgba(0,230,118,0.3); }
.decision-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Metrics */
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.metric {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.metric-label {
  font-size: 11px;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.metric-value {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  font-weight: 700;
}
.metric-value.bullish { color: var(--buy); }
.metric-value.bearish { color: var(--sell); }
.metric-value.neutral { color: var(--hold); }
.metric-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 20px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.section-line { flex: 1; height: 1px; background: var(--border); }

/* Indicator bars */
.indicator-bar { margin-bottom: 14px; }
.indicator-bar-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; }
.indicator-bar-name { color: var(--text2); }
.indicator-bar-val { color: var(--text); font-family: 'Space Mono', monospace; font-weight: 700; }
.bar-track { height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }

/* Comparison bars */
.compare-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.compare-ticker { width: 42px; font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700; }
.compare-bar-track { flex: 1; height: 8px; background: var(--bg4); border-radius: 4px; overflow: hidden; }
.compare-bar-fill { height: 100%; border-radius: 4px; transition: width 1.4s cubic-bezier(0.4,0,0.2,1); }
.compare-val { width: 60px; text-align: right; font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700; }

/* Levels table */
.levels-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.levels-table tr { border-bottom: 1px solid var(--border); }
.levels-table td { padding: 10px 8px; }
.levels-table td:first-child { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; width: 50px; }
.levels-table td:last-child { font-family: 'Space Mono', monospace; font-weight: 700; text-align: right; }
.level-resistance td:first-child { color: var(--sell); border-left: 3px solid var(--sell); }
.level-support td:first-child { color: var(--buy); border-left: 3px solid var(--buy); }
.level-current td:first-child { color: var(--hold); border-left: 3px solid var(--hold); }

/* Debate */
.debate-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.debate-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.debate-role {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.bull-role { color: var(--buy); }
.bear-role { color: var(--sell); }
.debate-text { font-size: 13px; color: var(--text2); line-height: 1.7; max-height: 200px; overflow-y: auto; }

/* Verdict */
.verdict-box {
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
  border: 1px solid;
}
.verdict-box.sell { background: rgba(255,23,68,0.05); border-color: rgba(255,23,68,0.2); }
.verdict-box.hold { background: rgba(255,171,0,0.05); border-color: rgba(255,171,0,0.2); }
.verdict-box.buy { background: rgba(0,230,118,0.05); border-color: rgba(0,230,118,0.2); }
.verdict-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}
.verdict-text { font-size: 13px; color: var(--text2); line-height: 1.7; max-height: 350px; overflow-y: auto; }

/* News items */
.news-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.news-tag {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 6px;
}
.tag-bullish { background: rgba(0,230,118,0.12); color: var(--buy); }
.tag-bearish { background: rgba(255,23,68,0.12); color: var(--sell); }
.tag-neutral { background: rgba(255,171,0,0.12); color: var(--hold); }
.news-headline { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.news-detail { font-size: 12px; color: var(--text3); line-height: 1.5; }

/* Signal list */
.signal-list { list-style: none; }
.signal-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text2); line-height: 1.5; }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.signal-bull { background: var(--buy); }
.signal-bear { background: var(--sell); }
.signal-neutral { background: var(--hold); }

/* Ticker strip */
.ticker-strip {
  position: relative;
  z-index: 10;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  height: 36px;
}
.ticker-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  gap: 24px;
  animation: scroll-left 40s linear infinite;
  width: max-content;
}
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item { display: inline-flex; align-items: center; gap: 8px; font-family: 'Space Mono', monospace; font-size: 12px; }
.ticker-sym { color: var(--text3); }
.ticker-price { color: var(--text); font-weight: 700; }
.ticker-change.up { color: var(--buy); }
.ticker-change.down { color: var(--sell); }

/* Stat highlight */
.stat-highlight {
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
}
.stat-highlight .stat-val { font-family: 'Space Mono', monospace; font-size: 26px; font-weight: 700; }
.stat-highlight .stat-label {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.5s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border2);
  border-top: 3px solid var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text3); letter-spacing: 0.1em; }

/* Glitch for SELL */
@keyframes glitch {
  0%, 100% { text-shadow: none; }
  20% { text-shadow: 2px 0 var(--sell), -2px 0 var(--accent-cyan); }
  40% { text-shadow: -2px 0 var(--sell), 2px 0 var(--accent-cyan); }
}
.decision-badge.sell { animation: glitch 4s ease-in-out infinite; }

/* Responsive */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .header { padding: 20px; flex-direction: column; gap: 16px; }
  .nav-tabs { padding: 0 20px; }
  .main { padding: 20px; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .debate-panel { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: 1fr; }
}
