/* ============================================================
   MeteoLog – CSS
   Aesthetic: Scientific weather instrument / dark observatory
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-primary:    #060d1a;
  --bg-secondary:  #0b1527;
  --bg-card:       #101e35;
  --bg-card-hover: #152540;
  --bg-input:      #0d1829;
  --border:        #1c3054;
  --border-light:  #243d66;

  --accent:        #00e5b0;
  --accent-dim:    rgba(0, 229, 176, 0.15);
  --accent-glow:   rgba(0, 229, 176, 0.35);
  --amber:         #f59e0b;
  --amber-dim:     rgba(245, 158, 11, 0.15);
  --blue:          #3b82f6;
  --blue-dim:      rgba(59, 130, 246, 0.15);
  --red:           #ef4444;
  --red-dim:       rgba(239, 68, 68, 0.15);

  --text-primary:   #ddeeff;
  --text-secondary: #a8c4dc;
  --text-muted:     #6a8aaa;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-body:    'DM Sans', sans-serif;

  /* Layout */
  --header-h:  52px;
  --nav-h:     72px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
}

/* ── Világos téma ───────────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary:    #f0f4f8;
  --bg-secondary:  #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f5f8fc;
  --bg-input:      #eef2f7;
  --border:        #d0dcea;
  --border-light:  #b8cfe0;

  --accent:        #00a87a;
  --accent-dim:    rgba(0, 168, 122, 0.12);
  --accent-glow:   rgba(0, 168, 122, 0.3);
  --amber:         #d97706;
  --amber-dim:     rgba(217, 119, 6, 0.12);
  --blue:          #2563eb;
  --blue-dim:      rgba(37, 99, 235, 0.12);
  --red:           #dc2626;
  --red-dim:       rgba(220, 38, 38, 0.12);

  --text-primary:   #1a2b3c;
  --text-secondary: #4a6480;
  --text-muted:     #8aaabb;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  max-width: 100vw;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: pan-y;
}

/* ── Splash ─────────────────────────────────────────────────── */
#splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
#splash.fade-out { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-icon { font-size: 56px; margin-bottom: 12px; animation: float 2s ease-in-out infinite; }
.splash-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 28px;
}
.splash-loader { display: flex; gap: 8px; justify-content: center; }
.splash-loader span {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.splash-loader span:nth-child(2) { animation-delay: 0.2s; }
.splash-loader span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse-dot { 0%,80%,100%{transform:scale(0.6);opacity:0.3} 40%{transform:scale(1);opacity:1} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

/* ── Utilities ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--bg-primary);
  width: 100%; height: 100%; height: 100dvh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 28px;
}
.auth-logo-icon { font-size: 36px; }
.auth-logo-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 28px; color: var(--accent); letter-spacing: -0.5px;
}
.auth-error {
  background: var(--red-dim); border: 1px solid var(--red);
  color: var(--red); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
}
.auth-tabs {
  display: flex; gap: 4px;
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 16px;
  border: 1px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 10px; border: none; background: none;
  color: var(--text-secondary); font-family: var(--font-body);
  font-size: 14px; font-weight: 500; border-radius: 6px;
  cursor: pointer; transition: all 0.2s;
}
.auth-tab.active { background: var(--accent); color: #000; font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form .input { padding: 12px 14px; }
.auth-form .btn-primary { margin-top: 4px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0; color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
/* Social gombok – egymás mellett */
.social-btns-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 10px;
}
.btn-social-sm {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 8px;
  border-radius: var(--radius); border: 1px solid var(--border-light);
  background: var(--bg-card); color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; width: 100%;
}
.btn-social-sm:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.btn-social-sm:active { transform: scale(0.97); }
.btn-guest-sm {
  color: var(--text-muted); font-size: 13px;
  border-color: var(--border); padding: 11px;
}

/* ── App Shell ──────────────────────────────────────────────── */
#app {
  display: flex; flex-direction: column;
  height: 100%; height: 100dvh;
  position: fixed; inset: 0;
  overflow: hidden;
  max-width: 100vw;
}

/* ── Header ─────────────────────────────────────────────────── */
#app-header {
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 8px;
  padding-left: 12px;
  padding-right: 12px;
  flex-shrink: 0;
  position: relative; z-index: 100;
  overflow: hidden;
}
.header-left { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header-logo { font-size: 20px; line-height: 1; }
.header-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--accent); letter-spacing: -0.3px; white-space: nowrap; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-shrink: 0; }

.location-chip {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 10px;
  cursor: pointer; transition: all 0.2s;
  min-width: 0; overflow: hidden;
  justify-self: center;
}
.location-chip:hover { border-color: var(--accent); }
.loc-icon { font-size: 12px; flex-shrink: 0; }
#active-location-name {
  font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 90px;
}
.loc-arrow { font-size: 10px; color: var(--text-secondary); flex-shrink: 0; }

.btn-icon {
  width: 38px; height: 38px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 50%; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }

/* ── Location Dropdown ──────────────────────────────────────── */
.dropdown {
  position: absolute; top: var(--header-h); left: 0; right: 0; z-index: 200;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  max-height: 240px; overflow-y: auto;
  animation: slide-down 0.2s ease;
}
@keyframes slide-down { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.dropdown-item:hover { background: var(--bg-card-hover); }
.dropdown-item.active { color: var(--accent); }
.dropdown-item.active::after { content: '✓'; margin-left: auto; font-size: 12px; }
.dropdown-add {
  width: 100%; padding: 14px 20px; border: none; background: none;
  color: var(--accent); text-align: left; font-size: 14px; font-family: var(--font-body);
  cursor: pointer; transition: background 0.15s;
}
.dropdown-add:hover { background: var(--accent-dim); }

/* ── Main ───────────────────────────────────────────────────── */
#app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
#app-main * { max-width: 100%; box-sizing: border-box; }

/* ── Bottom Nav ─────────────────────────────────────────────── */
#app-nav {
  height: var(--nav-h);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-around;
  padding-top: 8px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  border: none; background: none;
  color: var(--text-muted);
  font-family: var(--font-body); font-size: 11px;
  cursor: pointer; padding: 4px 0;
  transition: color 0.2s;
}
.nav-btn.active { color: var(--accent); }
.nav-btn:hover { color: var(--text-primary); }
.nav-btn.active svg { stroke: var(--accent); }
.nav-btn-center.active svg, .nav-btn-center svg { stroke: #000 !important; }
.nav-btn-center { margin-top: -20px; }
.nav-fab {
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  box-shadow: 0 0 20px var(--accent-glow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 10;
  overflow: visible;
}
.nav-fab svg {
  display: block;
  flex-shrink: 0;
  stroke: #000;
  pointer-events: none;
}
.nav-fab:hover, .nav-btn-center:hover .nav-fab { transform: scale(1.08); box-shadow: 0 0 28px var(--accent-glow); }
.nav-btn-center span { color: var(--text-muted); }
.nav-btn-center.active span { color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 20px;
  border-radius: var(--radius); border: none; font-family: var(--font-body);
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; width: 100%;
}
.btn-primary { background: var(--accent); color: #000; font-weight: 600; }
.btn-primary:hover { background: #00ffca; box-shadow: 0 0 20px var(--accent-glow); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-light); color: var(--text-primary); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }

/* ── Inputs ──────────────────────────────────────────────────── */
.input {
  width: 100%; padding: 13px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
  font-family: var(--font-body); font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input::placeholder { color: var(--text-muted); }
textarea.input { min-height: 80px; resize: vertical; }

.input-group { display: flex; gap: 8px; align-items: center; }
.input-label { font-size: 13px; color: var(--text-primary); opacity: 0.8; margin-bottom: 6px; letter-spacing: 0.3px; }
.form-field { margin-bottom: 18px; }

/* ── Number Stepper ──────────────────────────────────────────── */
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stepper-btn {
  width: 44px; min-width: 44px; height: 48px;
  background: var(--bg-card); border: none;
  color: var(--text-secondary); font-size: 20px;
  cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center;
}
.stepper-btn:hover { background: var(--bg-card-hover); color: var(--accent); }
.stepper-btn:active { background: var(--accent-dim); }
.stepper-value {
  flex: 1; text-align: center;
  background: var(--bg-input);
  font-family: var(--font-mono); font-size: 18px; font-weight: 600;
  color: var(--text-primary);
  padding: 0 8px;
  height: 48px; display: flex; align-items: center; justify-content: center;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.stepper-unit { font-size: 12px; color: var(--text-muted); margin-left: 4px; font-weight: 400; font-family: var(--font-body); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-title { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

/* ── View padding ────────────────────────────────────────────── */
.view { padding: 16px; overflow-x: hidden; }
.view-title { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin-bottom: 20px; }
.view > * { max-width: 100%; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--bg-secondary); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 8px 4px; border: none; background: none; color: var(--text-secondary); font-family: var(--font-body); font-size: 13px; font-weight: 500; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.tab-btn.active { background: var(--bg-card); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD VIEW
═══════════════════════════════════════════════════════════ */
.dash-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  pointer-events: none;
}
.dash-hero-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.dash-weather-emoji { font-size: 56px; line-height: 1; }
.dash-temp-big {
  font-family: var(--font-mono);
  font-size: 56px; font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}
.dash-temp-big .unit { font-size: 24px; color: var(--text-secondary); }
.dash-weather-label { font-size: 15px; color: var(--text-primary); margin-bottom: 4px; font-weight: 500; }
.dash-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.dash-details {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.dash-detail-item { text-align: center; }
.dash-detail-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.dash-detail-value { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-primary); margin-top: 3px; }
.dash-no-data { text-align: center; padding: 32px 20px; color: var(--text-secondary); font-size: 14px; }
.dash-no-data-icon { font-size: 40px; margin-bottom: 12px; }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-row-3 .stat-card { padding: 12px; }
.stat-row-3 .stat-value { font-size: 18px; }
.stat-row-3 .stat-label { font-size: 9px; letter-spacing: 0.3px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--accent); margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; opacity: 0.9; }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: background 0.15s;
}
.recent-item:hover { background: var(--bg-card-hover); }
.recent-emoji { font-size: 24px; }
.recent-info { flex: 1; min-width: 0; }
.recent-temp { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.recent-date { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.recent-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg-input); color: var(--text-primary); opacity: 0.85; border: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════
   LOG / ENTRY VIEW
═══════════════════════════════════════════════════════════ */
.weather-type-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wt-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border: 2px solid var(--border);
  background: var(--bg-input); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s;
  font-size: 11px; color: var(--text-secondary);
}
.wt-btn .wt-emoji { font-size: 22px; }
.wt-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.wt-btn.active { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

.compass-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 200px; }
.compass-btn {
  padding: 10px 4px; border: 1px solid var(--border);
  background: var(--bg-input); border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-secondary); font-size: 12px;
  font-family: var(--font-mono); text-align: center;
  transition: all 0.15s;
}
.compass-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.compass-btn.active { border-color: var(--amber); background: var(--amber-dim); color: var(--amber); }
.compass-btn.center { background: var(--bg-card); color: var(--text-muted); font-size: 18px; cursor: default; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle-label { font-size: 15px; }
.toggle {
  position: relative; width: 48px; height: 26px;
  background: var(--border); border-radius: 13px;
  cursor: pointer; transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: white; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(22px); }

/* ═══════════════════════════════════════════════════════════
   HISTORY VIEW
═══════════════════════════════════════════════════════════ */
.calendar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cal-nav { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 4px 10px; }
.cal-nav:hover { color: var(--accent); }
.cal-month { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: 11px; color: var(--text-secondary); padding: 8px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; border-top: 1px solid var(--border); position: relative;
  transition: background 0.15s; gap: 2px;
}
.cal-day:hover { background: var(--bg-card-hover); }
.cal-day.today .cal-day-num { color: var(--accent); font-weight: 700; }
.cal-day.selected { background: var(--accent-dim); }
.cal-day.other-month .cal-day-num { color: var(--text-muted); }
.cal-day-num { font-size: 13px; }
.cal-day-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal-day-emoji { font-size: 14px; }

.history-day-entries { display: flex; flex-direction: column; gap: 10px; }
.history-entry {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
}
.he-emoji { font-size: 28px; }
.he-data { }
.he-temp { font-family: var(--font-mono); font-size: 20px; font-weight: 600; }
.he-meta { font-size: 12px; color: var(--text-primary); opacity: 0.75; margin-top: 4px; }
.he-time { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); text-align: right; }
.he-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px; }
.he-delete:hover { color: var(--red); }

/* ═══════════════════════════════════════════════════════════
   CHARTS VIEW
═══════════════════════════════════════════════════════════ */
.chart-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.chart-wrap { position: relative; height: 220px; }
.period-selector { display: flex; gap: 6px; margin-bottom: 16px; }
.period-btn { padding: 6px 16px; border: 1px solid var(--border); background: var(--bg-card); border-radius: 20px; color: var(--text-secondary); font-size: 13px; cursor: pointer; transition: all 0.2s; }
.period-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.stats-item-val { font-family: var(--font-mono); font-size: 24px; font-weight: 600; color: var(--accent); }
.stats-item-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   LOCATIONS VIEW
═══════════════════════════════════════════════════════════ */
.location-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.loc-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 12px;
  transition: background 0.15s;
}
.loc-item.active-loc { border-color: var(--accent); }
.loc-item-icon { font-size: 28px; }
.loc-item-info { flex: 1; }
.loc-item-name { font-weight: 600; font-size: 16px; }
.loc-item-desc { font-size: 13px; color: var(--text-primary); opacity: 0.75; margin-top: 3px; }
.loc-item-count { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.loc-item-actions { display: flex; gap: 8px; }
.loc-action { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; font-size: 16px; transition: color 0.2s; }
.loc-action:hover { color: var(--text-primary); }
.loc-action.del:hover { color: var(--red); }

/* Location form sheet */
.sheet { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px; }
.sheet-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 18px; }

/* ═══════════════════════════════════════════════════════════
   EMPTY STATES & MISC
═══════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-secondary); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-family: var(--font-display); font-size: 18px; color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.8px; }

.wind-section { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }

.beaufort-label { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

/* Slider */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--border); border-radius: 3px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px;
  background: var(--accent); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
}
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px;
  background: var(--accent); border: none; border-radius: 50%; cursor: pointer;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Toast */
.toast-container { position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: calc(100% - 32px); max-width: 400px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 14px; text-align: center;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
  pointer-events: all;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes toast-in { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes toast-out { from{opacity:1} to{opacity:0} }

/* Confirm dialog */
.confirm-modal { position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center; padding: 24px; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.confirm-box { position: relative; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 28px 24px; width: 100%; max-width: 340px; text-align: center; }
.confirm-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.confirm-msg { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }
.confirm-btns { display: flex; gap: 10px; }


/* ── Export szekció ──────────────────────────────────────────── */
.export-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
}

/* ── Publikus nézet header – azonos az #app-header-rel ──────── */
.pub-header {
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 8px;
  padding-left: 12px;
  padding-right: 12px;
  padding-bottom: 8px;
  padding-top: env(safe-area-inset-top, 0px);
  position: sticky;
  top: 0;
  z-index: 10;
  overflow: hidden;
}
