/* ============================================================
   Elpriser — design system
   ============================================================ */

:root {
  --bg-0: #0a1420;
  --bg-1: #101d2e;
  --bg-2: #16263c;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #eaf1f8;
  --text-muted: #93a5b8;
  --accent: #ffd60a;
  --accent-soft: rgba(255, 214, 10, 0.14);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.16);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.16);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

body {
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(255, 214, 10, 0.10), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(52, 211, 153, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 45%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { padding-bottom: 60px; }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 44px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 214, 10, 0.28);
}

.hero-title {
  margin: 18px 0 8px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 26px;
}

.hero-price { margin: 6px 0 12px; }

.hero-price-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.hero-stat {
  flex: 1 1 0;
  min-width: 170px;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

.hero-stat-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hero-stat-area {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero-stat-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--text);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero-stat-price.high { color: var(--red); }
.hero-stat-price.low { color: var(--green); }
.hero-stat-price.accent { color: var(--accent); }

.hero-stat-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-stat-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 2px;
  text-align: center;
}

.hero-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Section headings ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 18px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Area cards ---------- */
.area-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  height: 100%;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.area-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 214, 10, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.area-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.area-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent), #f5a623);
  color: #1a1400;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px -8px rgba(255, 214, 10, 0.7);
}

.area-region {
  text-align: right;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.area-price {
  margin-bottom: 18px;
}

.area-price-value {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--amber);
}

.area-price-value.low { color: var(--green); }
.area-price-value.high { color: var(--red); }

.area-price-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 6px;
}

.area-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
}

.stat { text-align: center; flex: 1; }

.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
}

.stat-value.low { color: var(--green); }
.stat-value.high { color: var(--red); }
.stat-value.muted { color: var(--text); }

/* ---------- Chart card ---------- */
.chart-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item { display: inline-flex; align-items: center; gap: 7px; }

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-dot.low { background: var(--green); }
.legend-dot.amber { background: var(--amber); }
.legend-dot.high { background: var(--red); }

.price-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 240px;
  padding-top: 8px;
}

.bar-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 6px;
}

.bar-wrap {
  position: relative;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
}

.bar {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--amber), rgba(251, 191, 36, 0.45));
  min-height: 6px;
  transition: filter 0.2s ease;
}

.bar-column:hover .bar { filter: brightness(1.2); }

.bar.low { background: linear-gradient(180deg, var(--green), rgba(52, 211, 153, 0.45)); }
.bar.high { background: linear-gradient(180deg, var(--red), rgba(248, 113, 113, 0.45)); }

.bar-hour {
  color: var(--text-muted);
  font-size: 0.62rem;
  transform: rotate(-45deg);
  transform-origin: top left;
  white-space: nowrap;
  height: 14px;
  margin-top: 2px;
}

.bar-price {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

.bar-price.low { color: var(--green); }
.bar-price.high { color: var(--red); }

/* ---------- Table ---------- */
.table-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  overflow: hidden;
}

.price-table {
  margin: 0;
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--card-border);
}

.price-table thead th {
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--card-border);
  padding: 14px 18px;
  white-space: nowrap;
}

.price-table tbody td {
  border-color: var(--card-border);
  padding: 13px 18px;
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
}

.price-table tbody tr { transition: background 0.15s ease; }
.price-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

.area-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.area-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 30px;
  padding: 0 9px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), #f5a623);
  color: #1a1400;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -8px rgba(255, 214, 10, 0.7);
}

.area-name {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 84px;
  justify-content: center;
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.low { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.high { background: var(--red-soft); color: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .hero { padding: 44px 0 30px; }
  .price-bars { gap: 3px; height: 200px; }
  .bar-hour { display: none; }
  .bar-price {
    font-size: 0.55rem;
    transform: translateX(-50%) rotate(-90deg);
  }
  .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .price-table thead th { padding: 10px 6px; font-size: 0.66rem; }
  .price-table tbody td { padding: 9px 6px; font-size: 0.78rem; }
  .pill { padding: 3px 6px; font-size: 0.7rem; min-width: 48px; }
  .area-name { display: none; }
  .area-tag { min-width: 40px; height: 26px; font-size: 0.78rem; }
}
