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

:root {
  --bg: #0e1117;
  --surface: #161b25;
  --border: #2a3040;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text: #e2e8f0;
  --muted: #64748b;
  --good: #22c55e;
  --bad: #ef4444;
  --mid: #f59e0b;
  --sun: #fbbf24;
  --radius: 10px;
  --font: 'Inter', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo-sun {
  width: 36px;
  height: 24px;
  stroke: var(--sun);
  flex-shrink: 0;
}

/* ── Search ── */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-wrap input {
  width: 100%;
  padding: 0.55rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-wrap input:focus {
  border-color: var(--accent);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 100;
}

.search-dropdown a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.search-dropdown a:last-child { border-bottom: none; }
.search-dropdown a:hover { background: var(--border); }

/* ── Main layout ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.station-header {
  margin-bottom: 1.5rem;
}

.station-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.station-header .coords {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ── Score cards ── */
.score-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.score-card .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.score-card .source-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.score-card .score-value {
  font-size: 2rem;
  font-weight: 700;
}

.score-card.best .score-value  { color: var(--good); }
.score-card.worst .score-value { color: var(--bad); }

.score-card .stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Forecast table ── */
.forecast-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  white-space: nowrap;
}

thead th {
  background: var(--surface);
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

tbody tr:nth-child(even) { background: #12161f; }

tbody td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td { border-bottom: none; }

.source-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--border);
}

.source-badge.vedur { background: #1e3a5f; color: #93c5fd; }
.source-badge.yr    { background: #14532d; color: #86efac; }
.source-badge.blika { background: #3b1f5e; color: #c4b5fd; }

/* ── External links ── */
.ext-links {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s, border-color 0.15s;
}

.ext-link:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── No-data state ── */
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

.wind-arrow {
  display: inline-block;
  font-size: 1.1rem;
  line-height: 1;
}

.tab-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 2rem 0 0.75rem;
}

@media (max-width: 640px) {
  .score-cards { grid-template-columns: 1fr; }
  header { flex-wrap: wrap; }
  .search-wrap { max-width: 100%; width: 100%; }
}
