/* ═══════════════════════════════════════════════════════════
   CABEDELO SPOT WEATHER — Premium Dark UI
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-base:        #070b14;
  --bg-surface:     #0d1424;
  --bg-card:        #111827;
  --bg-card-hover:  #151f35;
  --bg-glass:       rgba(17, 24, 39, 0.7);

  --border-subtle:  rgba(255,255,255,0.06);
  --border-mid:     rgba(255,255,255,0.12);

  --text-primary:   #f0f6ff;
  --text-secondary: #8b9dc3;
  --text-muted:     #4a5578;

  --accent-blue:    #3b82f6;
  --accent-cyan:    #06b6d4;
  --accent-teal:    #14b8a6;
  --accent-orange:  #f97316;
  --accent-purple:  #a855f7;
  --accent-green:   #22c55e;
  --accent-red:     #ef4444;

  --wind-color:     #06b6d4;
  --temp-color:     #f97316;
  --humidity-color: #3b82f6;
  --rain-color:     #a855f7;
  --baro-color:     #14b8a6;

  --card-radius:    20px;
  --section-gap:    80px;
  --transition:     0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(59,130,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(6,182,212,0.08) 0%, transparent 50%);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── HEADER ──────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 12px rgba(6,182,212,0.6));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #f0f6ff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 20px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.last-update {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── HERO SECTION ──────────────────────────────────── */
.hero-section {
  padding: 60px 0 var(--section-gap);
}

.condition-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.condition-icon {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 16px rgba(6,182,212,0.4));
}

.condition-text {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.condition-date {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-muted);
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
}

/* ─── METRICS GRID ──────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  padding: 24px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  opacity: 0;
  transition: opacity var(--transition);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-mid);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.metric-card:hover::before { opacity: 1; }

/* Per-card accent glows */
.wind-card::before     { background: radial-gradient(ellipse at top left, rgba(6,182,212,0.08), transparent 70%); }
.temp-card::before     { background: radial-gradient(ellipse at top left, rgba(249,115,22,0.08), transparent 70%); }
.humidity-card::before { background: radial-gradient(ellipse at top left, rgba(59,130,246,0.08), transparent 70%); }
.rain-card::before     { background: radial-gradient(ellipse at top left, rgba(168,85,247,0.08), transparent 70%); }
.baro-card::before     { background: radial-gradient(ellipse at top left, rgba(20,184,166,0.08), transparent 70%); }

.wind-card     { border-top: 2px solid var(--wind-color); }
.temp-card     { border-top: 2px solid var(--temp-color); }
.humidity-card { border-top: 2px solid var(--humidity-color); }
.rain-card     { border-top: 2px solid var(--rain-color); }
.baro-card     { border-top: 2px solid var(--baro-color); }

.metric-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.metric-icon { font-size: 18px; }

.metric-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.metric-primary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}

.wind-card     .metric-value { color: var(--wind-color); }
.temp-card     .metric-value { color: var(--temp-color); }
.humidity-card .metric-value { color: var(--humidity-color); }
.rain-card     .metric-value { color: var(--rain-color); }
.baro-card     .metric-value { color: var(--baro-color); }

.metric-unit {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  padding-bottom: 4px;
}

/* ─── WIND COMPASS ──────────────────────────────────── */
.metric-secondary {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wind-compass {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.compass-rose {
  position: relative;
  width: 56px;
  height: 56px;
  border: 2px solid var(--border-mid);
  border-radius: 50%;
  background: var(--bg-surface);
}

.compass-rose span {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
}

.compass-n { top: 2px;  left: 50%; transform: translateX(-50%); }
.compass-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.compass-e { right: 2px; top: 50%; transform: translateY(-50%); }
.compass-w { left: 2px; top: 50%; transform: translateY(-50%); }

.compass-needle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.needle-head {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 20px solid var(--wind-color);
  filter: drop-shadow(0 0 4px var(--wind-color));
  margin-bottom: -2px;
}

.needle-tail {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 14px solid rgba(6,182,212,0.35);
}

.wind-dir-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--wind-color);
  letter-spacing: 0.05em;
}

.gust-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gust-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.gust-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ─── TEMPERATURE DETAIL ──────────────────────────── */
.temp-detail {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.temp-range {
  display: flex;
  gap: 12px;
}

.temp-hi { color: var(--accent-orange); font-weight: 600; font-size: 14px; }
.temp-lo { color: var(--accent-blue); font-weight: 600; font-size: 14px; }

.feels-like {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── HUMIDITY BAR ──────────────────────────────────── */
.humidity-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.humidity-bar {
  height: 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  overflow: hidden;
}

.humidity-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 3px;
  transition: width 1s ease;
  box-shadow: 0 0 8px var(--accent-blue);
}

.humidity-pct {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── RAIN & BARO ──────────────────────────────────── */
.rain-seasonal {
  font-size: 12px;
  color: var(--text-secondary);
}

.baro-trend {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ─── CHARTS SECTION ──────────────────────────────── */
.charts-section {
  padding: 0 0 var(--section-gap);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 32px;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.chart-full {
  grid-column: 1 / -1;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  padding: 24px;
  transition: transform var(--transition), border-color var(--transition);
}

.chart-card:hover {
  border-color: var(--border-mid);
  transform: translateY(-2px);
}

.chart-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.chart-icon { font-size: 18px; }

.chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-unit {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.chart-wrapper {
  position: relative;
  height: 220px;
}

/* ─── FOOTER ──────────────────────────────────────── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
  text-align: center;
}

.site-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.site-footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

.footer-copy { font-size: 11px !important; }

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid  { grid-template-columns: 1fr; }
  .chart-full   { grid-column: 1; }
  .condition-banner { flex-wrap: wrap; }
  .condition-date { margin-left: 0; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-value { font-size: 34px; }
}
