/* Decodificador METAR / TAF aviación */
:root,
[data-theme="dark"] {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-page: #0b0f17;
  --bg-surface: #131b2e;
  --bg-surface-2: #192338;
  --bg-input: #0f1626;
  --border-color: #26334d;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --vfr: #10b981;
  --mvfr: #3b82f6;
  --ifr: #ef4444;
  --lifr: #d946ef;
  --warn: #f59e0b;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-page: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.1);
  --vfr: #059669;
  --mvfr: #2563eb;
  --ifr: #dc2626;
  --lifr: #a21caf;
  --warn: #d97706;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

[data-theme="dark"] .app-header { background: #131b2e !important; border-bottom: 1px solid #1e293b !important; }
[data-theme="dark"] .brand-title { color: #f8fafc !important; }
[data-theme="light"] .app-header { background: #ffffff !important; border-bottom: 1px solid #cbd5e1 !important; }
[data-theme="light"] .brand-title { color: #0f172a !important; }

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

body {
  font-family: var(--font-main);
  background: var(--bg-page);
  color: var(--text-main);
  margin: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .brand-title, .section-title, .hero-title { font-family: var(--font-heading); }
.mono, code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.tool-layout { max-width: 1200px; width: 100%; margin: 1.5rem auto 3rem; padding: 0 1rem; flex: 1 0 auto; }
.tool-with-sidebar { display: flex; gap: 2rem; align-items: flex-start; width: 100%; }
.tool-main-content { flex: 1 1 0%; min-width: 0; width: 100%; }

.card-main {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.35rem;
}

.badge-pill {
  display: inline-flex;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}
.hero-title { margin: 0 0 0.45rem; font-size: clamp(1.22rem, 2.5vw, 1.65rem); line-height: 1.25; }
.hero-desc { margin: 0; color: var(--text-muted); font-size: 0.94rem; line-height: 1.55; }

.icao-fetch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-color);
}
.icao-input-wrap { display: flex; flex-direction: column; gap: 0.3rem; width: 145px; }
.presets-inline { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.btn-primary {
  min-height: 42px;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.preset-chip {
  min-height: 42px;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-2);
  color: var(--text-main);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
}
.preset-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.live-status {
  margin-top: 0.65rem;
  padding: 0.55rem 0.8rem;
  border-radius: 9px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  font-size: 0.83rem;
}

.metar-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.35rem;
  align-items: start;
}

.head-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.section-title { margin: 0 0 0.25rem; font-size: 1.05rem; }
.section-sub { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.cat-badge {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}
.cat-vfr { background: var(--vfr); }
.cat-mvfr { background: var(--mvfr); }
.cat-ifr { background: var(--ifr); }
.cat-lifr { background: var(--lifr); }

.form-group { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.form-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.form-input, .form-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.9rem;
}
.form-input { min-height: 42px; }
.form-textarea { resize: vertical; line-height: 1.45; }
.form-input.mono, .form-textarea.mono { font-family: var(--font-mono); }

.decoded-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.65rem;
}
.dec-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 0.7rem 0.85rem;
}
.dec-k { display: block; font-size: 0.73rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.2rem; }
.dec-v { display: block; font-size: 0.92rem; font-weight: 700; line-height: 1.35; }

.taf-list { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.6rem; }
.taf-row {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  line-height: 1.45;
}
.taf-row strong { font-family: var(--font-mono); color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.kpi-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; margin-top: 0.75rem; }
.mini-kpi {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.mini-label { font-size: 0.72rem; color: var(--text-muted); }
.mini-val { font-size: 0.96rem; font-weight: 700; }

.svg-rose-wrap {
  margin-top: 0.75rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  justify-content: center;
}
.svg-rose-wrap svg { max-width: 240px; width: 100%; height: auto; }

.sub-block { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--border-color); }
.specs-list { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.6rem; }
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-surface-2);
  border-radius: 8px;
  font-size: 0.82rem;
}
.spec-row span:first-child { color: var(--text-muted); }
.spec-row strong { font-family: var(--font-mono); font-size: 0.82rem; text-align: right; }

.faq-list { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.75rem; }
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-surface-2);
  padding: 0.75rem 1rem;
}
.faq-question { font-weight: 700; font-size: 0.94rem; cursor: pointer; }
.faq-answer { margin: 0.6rem 0 0; font-size: 0.89rem; color: var(--text-muted); line-height: 1.55; }

@media (max-width: 960px) {
  .metar-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .decoded-grid, .grid-2, .kpi-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .icao-input-wrap, .btn-primary, .preset-chip { width: 100%; }
}
