/* ═══════════════════════════════════════════════════════
   TROPO DX DASHBOARD — Style Sheet
   Dark cinematic theme · Radio DX · Pedra Bonita/MG
═══════════════════════════════════════════════════════ */

:root {
  --bg:        #070b14;
  --bg2:       #0d1422;
  --bg3:       #111928;
  --surface:   #151f30;
  --border:    #1e2d45;
  --accent:    #00d4ff;
  --accent2:   #0066ff;
  --gold:      #f0b429;
  --green:     #22c55e;
  --red:       #ef4444;
  --orange:    #f97316;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --radius:    14px;
  --trans:     0.35s cubic-bezier(.4,0,.2,1);

  /* Signal quality colors */
  --nil:       #374151;
  --marginal:  #6b7280;
  --fair:      #3b82f6;
  --moderate:  #8b5cf6;
  --strong:    #f59e0b;
  --very-strong: #f97316;
  --intense:   #ef4444;
  --extreme:   #ec4899;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── HERO ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0,212,255,.12) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(0,102,255,.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  animation: heroPulse 8s ease-in-out infinite alternate;
}

@keyframes heroPulse {
  from { opacity: .8; }
  to   { opacity: 1; }
}

/* Animated grid lines */
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
  from { background-position: 0 0; }
  to   { background-position: 60px 60px; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(0,212,255,.1);
  border: 1px solid rgba(0,212,255,.25);
  border-radius: 100px;
  padding: .4rem 1.2rem;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}
.dot.pulse { animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  letter-spacing: .05em;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stat {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  min-width: 130px;
  transition: transform var(--trans), border-color var(--trans);
}
.hero-stat:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.hero-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.hero-stat-lbl {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .3rem;
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.chevron {
  width: 14px; height: 14px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  opacity: .4;
  animation: chevronAnim 1.8s ease-in-out infinite;
}
.chevron:nth-child(2) { animation-delay: .2s; opacity: .2; }
@keyframes chevronAnim {
  0%   { opacity: .15; transform: rotate(45deg) translateY(-3px); }
  50%  { opacity: .7;  transform: rotate(45deg) translateY(0); }
  100% { opacity: .15; transform: rotate(45deg) translateY(-3px); }
}

/* ── SECTIONS ─────────────────────────────────────── */
.section {
  padding: 6rem 1rem;
}
.section:nth-child(even) { background: var(--bg2); }
.section:nth-child(odd)  { background: var(--bg); }

.container { max-width: 1200px; margin: 0 auto; }

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: .5rem;
  background: linear-gradient(90deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-sub { color: var(--muted); margin-bottom: 2.5rem; font-size: .9rem; }

/* ── TIMELINE ─────────────────────────────────────── */
.timeline-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
}
.timeline-rail::-webkit-scrollbar { height: 4px; }
.timeline-rail::-webkit-scrollbar-track { background: var(--bg3); border-radius: 4px; }
.timeline-rail::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.tl-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  cursor: pointer;
  transition: transform var(--trans), border-color var(--trans), box-shadow var(--trans);
  position: relative;
  overflow: hidden;
}
.tl-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--muted));
  border-radius: var(--radius) var(--radius) 0 0;
}
.tl-card:hover, .tl-card.active {
  border-color: var(--card-accent, var(--accent));
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,212,255,.15);
}
.tl-card.active {
  box-shadow: 0 0 0 1px var(--card-accent, var(--accent)),
              0 12px 40px rgba(0,212,255,.2);
}

.tl-hora {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.tl-cor {
  display: inline-block;
  margin-top: .4rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .2rem .6rem;
  border-radius: 100px;
  background: var(--card-accent-bg, rgba(100,116,139,.15));
  color: var(--card-accent, var(--muted));
}
.tl-indice {
  margin-top: .8rem;
  font-size: .75rem;
  color: var(--muted);
}
.tl-indice strong { color: var(--text); font-size: 1rem; }

.indice-bar {
  height: 4px;
  border-radius: 4px;
  background: var(--bg3);
  margin-top: .4rem;
  overflow: hidden;
}
.indice-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width .6s ease;
}

/* ── DETAIL PANEL ─────────────────────────────────── */
.detail-section { background: var(--bg2); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  animation: fadeSlide .4s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.detail-card h3 {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: .88rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .lbl { color: var(--muted); }
.info-row .val { font-weight: 600; text-align: right; }

.city-list { list-style: none; }
.city-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .4rem 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: .85rem;
}
.city-item:last-child { border-bottom: none; }
.city-dot {
  width: 8px; height: 8px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}
.city-name { flex: 1; }
.city-dist { color: var(--muted); font-size: .78rem; }
.city-dir  { color: var(--accent); font-size: .78rem; font-weight: 600; }

/* ── RADAR CANVAS ─────────────────────────────────── */
.map-section { background: var(--bg); }

.radar-wrap {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

#radarCanvas {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(0,212,255,.08), inset 0 0 60px rgba(0,0,0,.3);
  max-width: 100%;
  height: auto;
}

.radar-legend {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  min-width: 200px;
}
.radar-legend h4 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .8rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .5rem;
  font-size: .82rem;
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── CHART ────────────────────────────────────────── */
.chart-section { background: var(--bg2); }
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
}

/* ── TABLE ────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.dx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.dx-table thead { background: var(--bg3); }
.dx-table th {
  padding: .9rem 1rem;
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dx-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  white-space: nowrap;
}
.dx-table tbody tr:last-child td { border-bottom: none; }
.dx-table tbody tr {
  transition: background var(--trans);
  cursor: pointer;
}
.dx-table tbody tr:hover { background: rgba(0,212,255,.04); }
.dx-table tbody tr.active-row { background: rgba(0,212,255,.08); }

.chance-pill {
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── NARRATIVES ──────────────────────────────────── */
.narrative-section { background: var(--bg2); }
.narratives { display: flex; flex-direction: column; gap: 1rem; }

.narrative-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  align-items: start;
  transition: border-color var(--trans), transform var(--trans);
}
.narrative-card:hover {
  border-left-color: var(--gold);
  transform: translateX(4px);
}
.narrative-hora {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.narrative-text {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.7;
}
.narrative-parts { display: flex; flex-direction: column; gap: .3rem; }
.narrative-part {
  color: var(--muted);
  font-size: .8rem;
}
.narrative-part strong { color: var(--text); }

/* ── FOOTER ──────────────────────────────────────── */
.footer {
  background: var(--bg3);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: .82rem;
}
.footer-small { margin-top: .4rem; font-size: .75rem; opacity: .6; }
.footer code {
  background: rgba(0,212,255,.1);
  color: var(--accent);
  border-radius: 4px;
  padding: .1rem .4rem;
  font-size: .75rem;
}

/* ── SIGNAL COLOR CLASSES ─────────────────────────── */
.c-nil         { color: var(--nil); }
.c-marginal    { color: var(--marginal); }
.c-fair        { color: var(--fair); }
.c-moderate    { color: var(--moderate); }
.c-strong      { color: var(--strong); }
.c-very-strong { color: var(--very-strong); }
.c-intense     { color: var(--intense); }
.c-extreme     { color: var(--extreme); }

.bg-nil         { background: rgba(55,65,81,.25); }
.bg-marginal    { background: rgba(107,114,128,.2); }
.bg-fair        { background: rgba(59,130,246,.2); }
.bg-moderate    { background: rgba(139,92,246,.2); }
.bg-strong      { background: rgba(245,158,11,.2); }
.bg-very-strong { background: rgba(249,115,22,.2); }
.bg-intense     { background: rgba(239,68,68,.2); }
.bg-extreme     { background: rgba(236,72,153,.2); }

/* ── CHANCE PILLS ─────────────────────────────────── */
.pill-nula         { background: rgba(55,65,81,.3);    color: var(--nil); }
.pill-muito-baixa  { background: rgba(107,114,128,.2); color: var(--marginal); }
.pill-baixa        { background: rgba(59,130,246,.2);  color: var(--fair); }
.pill-razoavel     { background: rgba(139,92,246,.2);  color: var(--moderate); }
.pill-boa          { background: rgba(245,158,11,.2);  color: var(--strong); }
.pill-alta         { background: rgba(249,115,22,.2);  color: var(--very-strong); }
.pill-muito-alta   { background: rgba(239,68,68,.2);   color: var(--intense); }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 600px) {
  .hero h1 { font-size: 3rem; }
  .hero-stats { gap: 1rem; }
  .hero-stat { min-width: 100px; padding: .8rem 1rem; }
  .hero-stat-val { font-size: 1.5rem; }
  .narrative-card { grid-template-columns: 1fr; }
  .narrative-hora { font-size: 1rem; }
  .radar-wrap { justify-content: center; }
}

/* ── ANIMATIONS ──────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════════
   JANELA DE PROPAGAÇÃO
   ═══════════════════════════════════════════════════════ */
.janela-analise {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.ja-dia { margin-bottom: 1.5rem; }

.ja-dia-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.ja-dia-data {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .04em;
}

.ja-pico-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
}

.ja-janela-badge {
  font-size: .72rem;
  color: #60a5fa;
  background: rgba(96,165,250,.12);
  padding: .2rem .55rem;
  border-radius: 999px;
}

/* Mini barras horárias */
.ja-barras {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 52px;
  margin-bottom: .9rem;
}

.ja-barra-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
  cursor: default;
}

.ja-barra-fill {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: opacity .2s;
}

.ja-barra-hora {
  font-size: .6rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Frases de análise */
.ja-frases {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.ja-frase {
  display: flex;
  gap: .5rem;
  font-size: .82rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.ja-frase-icon {
  color: var(--muted);
  flex-shrink: 0;
  width: .8rem;
  text-align: center;
  margin-top: .05rem;
}

.ja-sep {
  border: none;
  border-top: 1px solid rgba(255,255,255,.06);
  margin: 1.2rem 0;
}

/* ── ICON SYSTEM (SVG, substitui emojis) ─────────────── */
.icon {
  display: inline-block;
  vertical-align: -3px;
  flex-shrink: 0;
}
.icon svg {
  width: 1em;
  height: 1em;
  display: block;
}
.icon-inline {
  width: 14px;
  height: 14px;
  margin-right: .35em;
  vertical-align: -2px;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
