/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #07090f;
  color: #e2e8f0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: #4f7cff; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header ────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(7,9,15,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .95rem;
  color: #e2e8f0;
  font-weight: 500;
}
.logo-drone { font-size: 1.2rem; }
.logo strong {
  background: linear-gradient(90deg, #4f7cff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.badge {
  margin-left: auto;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(79,124,255,.12);
  border: 1px solid rgba(79,124,255,.3);
  color: #4f7cff;
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px 0 72px;
  text-align: center;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% -5%, rgba(79,124,255,.16) 0%, transparent 65%),
    radial-gradient(ellipse 45% 35% at 85% 30%, rgba(168,85,247,.09) 0%, transparent 55%);
}
.hero-inner { position: relative; }

.hero-label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #4f7cff;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.04em;
  color: #f1f5f9;
  margin-bottom: 18px;
}
.text-gradient {
  background: linear-gradient(135deg, #4f7cff 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: .95rem;
  color: #64748b;
  max-width: 460px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

/* ─── Search Box ────────────────────────────────────────────────────────── */
.search-box {
  max-width: 620px;
  margin: 0 auto;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  padding: 22px 22px 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(79,124,255,.05) inset;
}

.field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.field-row--2 .field { flex: 1; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  padding: 0 14px;
  height: 48px;
  gap: 10px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.field:focus-within {
  border-color: rgba(79,124,255,.6);
  background: rgba(79,124,255,.06);
  box-shadow: 0 0 0 3px rgba(79,124,255,.1);
}
.field-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #475569;
  pointer-events: none;
}
.field-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-size: .9rem;
  font-family: inherit;
  min-width: 0;
}
.field-input::placeholder { color: #475569; }
.field-input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.45); cursor: pointer; }

.field-address { flex: 1; }

.field-radius { gap: 8px; }
.radius-lbl { font-size: .78rem; color: #475569; white-space: nowrap; flex-shrink: 0; }
.slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  min-width: 60px;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #4f7cff;
  box-shadow: 0 0 8px rgba(79,124,255,.5);
  cursor: pointer;
}
.radius-val {
  font-size: .82rem;
  font-weight: 700;
  color: #4f7cff;
  white-space: nowrap;
  min-width: 34px;
  text-align: right;
}

/* Autocomplete */
.autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: -1px;
  right: -1px;
  background: #0c1220;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  z-index: 100;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.autocomplete.hidden { display: none; }
.ac-item {
  padding: 11px 16px;
  font-size: .83rem;
  color: #94a3b8;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.05);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .1s, color .1s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: rgba(79,124,255,.14); color: #e2e8f0; }

/* Submit button */
.btn-search {
  width: 100%;
  height: 52px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f7cff 0%, #7c3aed 100%);
  color: #fff;
  font-size: .93rem;
  font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: 0 4px 20px rgba(79,124,255,.35);
  transition: opacity .18s, transform .15s, box-shadow .18s;
}
.btn-search:hover  { opacity: .92; transform: translateY(-1px); box-shadow: 0 8px 28px rgba(79,124,255,.45); }
.btn-search:active { transform: translateY(0); opacity: 1; }
.btn-search:disabled { opacity: .45; pointer-events: none; }

/* ─── Loading ────────────────────────────────────────────────────────────── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 100px 24px;
}
.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.07);
  border-top-color: #4f7cff;
  border-right-color: #a855f7;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-steps { text-align: center; }
.step { font-size: .85rem; color: #334155; line-height: 2; transition: color .3s; }
.step.active { color: #e2e8f0; }
.step.done   { color: #22c55e; }

/* ─── Error ─────────────────────────────────────────────────────────────── */
.error-wrap { display: flex; justify-content: center; padding: 80px 24px; }
.error-box {
  text-align: center;
  padding: 40px;
  max-width: 380px;
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 18px;
}
.error-emoji { font-size: 2.2rem; margin-bottom: 14px; }
#errorMessage { font-size: .9rem; color: #94a3b8; margin-bottom: 22px; line-height: 1.6; }
.btn-retry {
  padding: 10px 22px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: .85rem;
  font-family: inherit;
  transition: background .15s;
}
.btn-retry:hover { background: rgba(255,255,255,.12); }

/* ─── Results ────────────────────────────────────────────────────────────── */
.results { padding-bottom: 100px; }
.results-inner { display: flex; flex-direction: column; gap: 14px; }

/* ─── Verdict Card ───────────────────────────────────────────────────────── */
.verdict-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-radius: 18px;
  border: 1px solid;
  animation: fadeUp .4s ease both;
}
.verdict-card.green  { background: rgba(34,197,94,.09);  border-color: rgba(34,197,94,.22); }
.verdict-card.yellow { background: rgba(245,158,11,.09); border-color: rgba(245,158,11,.22); }
.verdict-card.orange { background: rgba(249,115,22,.09); border-color: rgba(249,115,22,.22); }
.verdict-card.red    { background: rgba(239,68,68,.09);  border-color: rgba(239,68,68,.22); }

.verdict-left { display: flex; align-items: center; gap: 18px; }
.verdict-emoji { font-size: 2.6rem; line-height: 1; flex-shrink: 0; }
.verdict-msg {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #f1f5f9;
  line-height: 1.2;
}
.verdict-sub { font-size: .83rem; color: #64748b; margin-top: 5px; }

.verdict-right { text-align: center; flex-shrink: 0; }
.score-donut {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 5px;
}
.score-donut svg {
  width: 78px;
  height: 78px;
  transform: rotate(-90deg);
}
.donut-bg   { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 8; }
.donut-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1), stroke .3s;
}
.score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.score-num   { font-size: 1.25rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.score-denom { font-size: .6rem; color: #475569; align-self: flex-end; padding-bottom: 2px; }
.score-caption { font-size: .65rem; color: #334155; text-transform: uppercase; letter-spacing: .08em; }

/* ─── Stats Row ─────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeUp .4s ease both;
  transition: background .2s;
}
.stat:hover { background: rgba(255,255,255,.055); }
.stat-emoji { font-size: 1.35rem; flex-shrink: 0; margin-top: 1px; }
.stat-label  { font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #334155; margin-bottom: 4px; }
.stat-value  { font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; color: #f1f5f9; line-height: 1.2; }
.stat-sub    { font-size: .72rem; color: #475569; margin-top: 3px; }

/* ─── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  padding: 22px 24px;
  animation: fadeUp .4s ease both;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title { font-size: .88rem; font-weight: 600; color: #e2e8f0; }
.card-hint  { font-size: .72rem; color: #334155; }

/* Legend */
.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .72rem;
  color: #475569;
}
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 1px;
  flex-shrink: 0;
}
.legend-line {
  display: inline-block;
  width: 18px; height: 2px;
  border-radius: 1px;
  margin-right: 3px;
  vertical-align: middle;
}
.legend-line.dashed {
  height: 0;
  border-top: 2px dashed;
  background: none !important;
}
.legend-bar {
  display: inline-block;
  width: 12px; height: 10px;
  border-radius: 3px;
  margin-right: 3px;
  vertical-align: middle;
}

/* ─── Timeline ──────────────────────────────────────────────────────────── */
.timeline {
  height: 44px;
  border-radius: 8px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 7px;
}
.tl-seg {
  flex: 1;
  cursor: default;
  position: relative;
  transition: filter .15s;
}
.tl-seg:hover { filter: brightness(1.25); }
.tl-seg:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0c1220;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .7rem;
  white-space: nowrap;
  color: #e2e8f0;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.timeline-axis {
  display: flex;
  justify-content: space-between;
  font-size: .64rem;
  color: #334155;
  padding: 0 2px;
}

/* ─── Airspace Alerts ────────────────────────────────────────────────────── */
.airspace-list { display: flex; flex-direction: column; gap: 10px; }
.airspace-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid;
  animation: fadeUp .35s ease both;
}
.airspace-item.red    { background: rgba(239,68,68,.07);  border-color: rgba(239,68,68,.22); }
.airspace-item.yellow { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.22); }
.airspace-item.green  { background: rgba(34,197,94,.06);  border-color: rgba(34,197,94,.2); }
.airspace-item.blue   { background: rgba(79,124,255,.05); border-color: rgba(79,124,255,.18); }
.airspace-icon  { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.airspace-title { font-size: .84rem; font-weight: 600; color: #e2e8f0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.airspace-sub   { font-size: .75rem; color: #64748b; margin-top: 2px; }
.airspace-sources {
  font-size: .72rem; color: #4f7cff; padding: 4px 0 6px;
  border-bottom: 1px solid rgba(255,255,255,.06); margin-bottom: 4px;
}
.src-badge {
  display: inline-block; font-size: .65rem; font-weight: 600;
  padding: 1px 6px; border-radius: 3px;
  background: rgba(79,124,255,.15); color: #818cf8;
  border: 1px solid rgba(79,124,255,.25);
  line-height: 1.5; white-space: nowrap;
}
.weather-src-note {
  grid-column: 1 / -1; font-size: .72rem; color: #475569;
  padding-top: 6px; text-align: right;
}
.weather-src-note strong { color: #64748b; }

/* ─── Best Windows ───────────────────────────────────────────────────────── */
.windows {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.win-card {
  flex-shrink: 0;
  min-width: 148px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  cursor: default;
  transition: background .18s, border-color .18s, transform .18s;
}
.win-card:hover { background: rgba(255,255,255,.07); transform: translateY(-2px); }
.win-card.best  { border-color: rgba(79,124,255,.4); }
.win-weather  { font-size: 1.5rem; margin-bottom: 6px; }
.win-time     { font-size: 1.5rem; font-weight: 900; letter-spacing: -.04em; color: #f1f5f9; line-height: 1; }
.win-score    { font-size: .75rem; font-weight: 700; margin: 7px 0; }
.win-score.green  { color: #22c55e; }
.win-score.yellow { color: #f59e0b; }
.win-score.orange { color: #f97316; }
.win-score.red    { color: #ef4444; }
.win-detail   { font-size: .7rem; color: #475569; line-height: 1.7; }

/* ─── Chart ─────────────────────────────────────────────────────────────── */
.chart-wrap { position: relative; height: 260px; }

/* ─── Map ────────────────────────────────────────────────────────────────── */
#map {
  height: 380px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
}
.leaflet-container { background: #0c1220; }

.pulse-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #4f7cff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(79,124,255,.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(79,124,255,.7); }
  70%  { box-shadow: 0 0 0 12px rgba(79,124,255,0); }
  100% { box-shadow: 0 0 0 0   rgba(79,124,255,0); }
}
.ap-dot  { width:12px; height:12px; border-radius:50%;  background:#ef4444; border:2px solid #fff; }
.hp-dot  { width:10px; height:10px; border-radius:50%;  background:#f59e0b; border:2px solid #fff; }
.mil-dot { width:12px; height:12px; border-radius:3px;  background:#ef4444; border:2px solid #fff; }
.nat-dot { width:10px; height:10px; border-radius:50%;  background:#22c55e; border:2px solid #fff; }

/* ─── Table ──────────────────────────────────────────────────────────────── */
.btn-toggle, .btn-toggle:hover {
  padding: 5px 13px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: #64748b;
  font-size: .75rem;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.btn-toggle:hover { background: rgba(255,255,255,.1); color: #e2e8f0; }

.tbl-scroll { overflow-x: auto; margin-top: 4px; }
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  min-width: 580px;
}
.tbl th {
  padding: 9px 14px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #334155;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tbl td {
  padding: 9px 14px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,.03);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,.025); }
.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
}
.chip.green  { background: rgba(34,197,94,.14);  color: #22c55e; }
.chip.yellow { background: rgba(245,158,11,.14); color: #f59e0b; }
.chip.orange { background: rgba(249,115,22,.14); color: #f97316; }
.chip.red    { background: rgba(239,68,68,.14);  color: #ef4444; }

/* ─── Regulations ────────────────────────────────────────────────────────── */
.regs-card { padding: 0; overflow: hidden; }
.regs-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  color: #64748b;
  font-size: .85rem;
  font-weight: 500;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.regs-btn:hover { background: rgba(255,255,255,.025); color: #e2e8f0; }
.chevron { font-size: 1.2rem; transition: transform .22s; }
.regs-btn.open .chevron { transform: rotate(90deg); }

.regs-body { padding: 0 24px 24px; border-top: 1px solid rgba(255,255,255,.06); padding-top: 20px; }
.regs-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 18px; }
.reg-cat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.025);
  font-size: .78rem;
  color: #94a3b8;
  line-height: 1.5;
}
.cat-badge {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
}
.cat-a1 .cat-badge { background: rgba(34,197,94,.15);  color: #22c55e; }
.cat-a2 .cat-badge { background: rgba(245,158,11,.15); color: #f59e0b; }
.cat-a3 .cat-badge { background: rgba(239,68,68,.15);  color: #ef4444; }

.reg-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.reg-list li { font-size: .8rem; color: #64748b; line-height: 1.5; }
.reg-note { font-size: .72rem; color: #334155; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 28px 0;
  text-align: center;
  font-size: .73rem;
  color: #334155;
}
.site-footer a { color: #334155; }
.site-footer a:hover { color: #64748b; }

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hidden { display: none !important; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .hero { padding: 52px 0 48px; }
  .hero-title { font-size: 2rem; }
  .search-box { padding: 16px; border-radius: 16px; }
  .field-row--2 { flex-direction: column; }
  .verdict-card { flex-direction: column; align-items: flex-start; gap: 18px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .chart-wrap { height: 200px; }
  .container { padding: 0 16px; }
}
