/* ==========================================================================
   TASARIM YENİLEME KATMANI  ·  refresh.css
   style.css'in ÜZERİNE biner. index.html'den tek <link> satırı silinerek
   eski görünüme dönülebilir; style.css'e hiç dokunulmadı.

   Kapsam:
   1. Renk / gölge / tipografi rafinesi
   2. Masaüstü: tek sütunlu telefon görünümü yerine gerçek grid düzeni
   3. Mobil: dokunma hedefleri, 2x2 metrik ızgarası, yatay kaydırma şeritleri,
      güvenli alan (çentik) desteği, alt menü düzeltmesi
   4. Erişilebilirlik: odak halkaları, hareket azaltma, kontrast
   ========================================================================== */

/* ---------- 1. TOKEN RAFİNESİ ---------- */
:root {
  /* Yüzey katmanları - tek düz renk yerine derinlik */
  --surface-1: rgba(255, 255, 255, 0.88);
  --surface-2: rgba(248, 250, 252, 0.95);
  --hairline: rgba(15, 23, 42, 0.07);
  --ring: rgba(59, 130, 246, 0.45);

  /* Daha yumuşak, katmanlı gölgeler */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.05), 0 16px 48px rgba(15, 23, 42, 0.1);

  --accent-grad: linear-gradient(135deg, #3b82f6, #6366f1);

  /* Düzen ölçüleri */
  --nav-h: 64px;
  --gutter: 16px;
}

[data-theme="dark"] {
  --surface-1: rgba(30, 41, 59, 0.82);
  --surface-2: rgba(15, 23, 42, 0.6);
  --hairline: rgba(148, 163, 184, 0.14);

  /* Koyu temada kontrast artırıldı: eski --text-muted okunmuyordu */
  --text-secondary: #a8b6ca;
  --text-muted: #8496ad;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* Koyu temada zemine hafif derinlik (düz #0f172a yerine) */
[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 12% -5%, rgba(59, 130, 246, 0.1), transparent 60%),
    radial-gradient(900px 500px at 88% 0%, rgba(139, 92, 246, 0.08), transparent 55%),
    var(--bg-primary);
  background-attachment: fixed;
}

body {
  /* Alt menü + çentik payı; eski sabit 80px bazı cihazlarda içeriği kesiyordu */
  padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}

/* ---------- 2. KART VE BAŞLIKLAR ---------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-md);
  border-radius: 20px;
  padding: 20px;
}

/* Üst kenarda ince ışık çizgisi - camsı yüzey hissi */
.card {
  position: relative;
  overflow: clip;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.6;
  pointer-events: none;
}

[data-theme="dark"] .card::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

/* Hover efekti sadece gerçek imleçli cihazlarda - dokunmatikte takılma yapıyordu */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
  }
}

@media (hover: none) {

  .card:hover,
  .metric-item:hover,
  .hourly-detail-item:hover,
  .finance-card:hover {
    transform: none;
  }
}

.card-title {
  letter-spacing: -0.01em;
  font-weight: 800;
}

/* ---------- 3. MASAÜSTÜ DÜZENİ ----------
   Eskiden 1920px ekranda bile içerik 700px'lik telefon sütununda duruyordu.
   Artık kartlar gerçek bir ızgaraya yayılıyor. */
@media (min-width: 1024px) {
  .main-container {
    max-width: 1240px;
    padding: 24px 28px;
  }

  /* Çok kartlı sekmelerde iki/üç sütunlu akış */
  #tab-home.tab-content.active,
  #tab-finance.tab-content.active,
  #tab-system.tab-content.active,
  #tab-about.tab-content.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
    align-items: start;
  }

  /* Izgara modunda dikey boşluğu gap yönetir */
  #tab-home.active > .card,
  #tab-finance.active > .card,
  #tab-system.active > .card,
  #tab-about.active > .card {
    margin-bottom: 0 !important;
  }

  /* Tam genişlik isteyen bloklar */
  .live-clock-row,
  .greeting-row,
  #tab-home > .weather-card,
  #tab-system > .card:first-of-type,
  #tab-about > .card:first-of-type {
    grid-column: 1 / -1;
  }

  /* Tek sütunlu sekmeler aşırı gerilmesin */
  #tab-news.active,
  #tab-sports.active,
  #tab-agenda.active {
    max-width: 960px;
    margin-inline: auto;
  }

  /* Hava kartı tam genişlikte dikey durunca ortası bomboş kalıyordu.
     Masaüstünde yatay düzen: solda sıcaklık, sağda metrikler. */
  #tab-home > .weather-card .weather-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
  }

  #tab-home > .weather-card .weather-emoji {
    font-size: 5rem;
    margin: 0;
  }

  #tab-home > .weather-card .temp-display {
    font-size: 5rem;
    margin: 0;
  }

  #tab-home > .weather-card .city-name-display {
    width: 100%;
    margin-top: 4px;
  }

  /* 4 metrik tek sırada - 3+1 artığı kalmasın */
  #tab-home > .weather-card .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 880px;
    margin-inline: auto;
  }

  /* Saatlik detay masaüstünde daha geniş nefes alsın */
  .hourly-detail-grid {
    max-height: 340px;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }

  /* Alt menü masaüstünde yüzen hap şeklinde */
  .bottom-nav {
    max-width: max-content;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow-lg);
    padding: 6px 10px;
    gap: 2px;
    background: var(--surface-1);
  }

  .nav-btn {
    border-radius: 999px;
    padding: 8px 14px;
  }

  .nav-btn.active {
    background: var(--accent-light);
  }

  body {
    padding-bottom: 110px;
  }
}

@media (min-width: 1500px) {

  #tab-home.tab-content.active,
  #tab-finance.tab-content.active {
    grid-template-columns: repeat(3, 1fr);
  }

  .main-container {
    max-width: 1440px;
  }
}

/* Tablet ara kademe */
@media (min-width: 768px) and (max-width: 1023px) {
  .main-container {
    max-width: 860px;
  }

  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- 4. MOBİL DÜZELTMELERİ ---------- */

/* 4a. Metrik ızgarası: 4 öğe 3'lü ızgarada 3+1 kalıyordu -> 2x2 */
@media (max-width: 767px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .metric-item {
    padding: 16px 10px;
    border-radius: 16px;
  }

  .metric-value {
    font-size: 1.15rem;
  }
}

/* 4b. Saatlik tahmin: iç içe dikey kaydırma yerine yatay şerit */
@media (max-width: 767px) {
  .hourly-detail-grid {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    gap: 10px;
    scrollbar-width: none;
  }

  .hourly-detail-grid::-webkit-scrollbar {
    display: none;
  }

  .hourly-detail-item {
    flex: 0 0 auto;
    min-width: 86px;
    scroll-snap-align: start;
  }

  /* Şeridin devam ettiğini belli eden kenar gölgesi */
  .hourly-detail-grid {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
  }
}

/* 4c. Alt menü: 8 sekme 375px'te sıkışıyor, etiketler alt satıra taşıyordu */
.bottom-nav {
  height: var(--nav-h);
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: content-box;
  background: var(--surface-1);
  border-top: 1px solid var(--hairline);
}

.nav-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  font-size: 0.6rem;
  letter-spacing: -0.01em;
}

.nav-btn span {
  /* Etiketler tek satırda kalsın; aktif öğe artık yükseklik zıplatmıyor */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.1;
}

.nav-btn i {
  font-size: 1.3rem;
  line-height: 1;
}

/* Aktif sekmede ikonun üstünde küçük gösterge */
.nav-btn.active {
  position: relative;
}

.nav-btn.active::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent-grad);
}

@media (min-width: 1024px) {
  .nav-btn.active::after {
    display: none;
  }
}

/* Telefonlarda etiketleri gizle, ikon kalsın.
   Eşik 360px'ti; sekme sayısı 9'a çıkınca 375-430px arası cihazlarda da
   düğme başına ~41px kalıyor ve etiketler okunmaz hâle geliyordu. Aktif
   sekme .nav-btn.active::after çizgisiyle zaten belli oluyor. */
@media (max-width: 430px) {
  .nav-btn span {
    display: none;
  }

  .nav-btn i {
    font-size: 1.45rem;
  }

  :root {
    --nav-h: 56px;
  }
}

/* 4d. Dokunma hedefleri en az 44px (WCAG) */
.city-btn,
.news-tab,
.weather-view-tab,
.err-btn,
.conv-input,
.settings-input,
.conv-select {
  min-height: 44px;
}

.city-link {
  padding-block: 12px;
}

/* 4e. Üst bar ve şehir menüsü */
.top-bar {
  background: var(--surface-1);
  border-bottom: 1px solid var(--hairline);
  padding-top: env(safe-area-inset-top);
}

.city-dropdown {
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  overflow: hidden;
}

.city-list {
  overscroll-behavior: contain;
}

/* ---------- 5. BİLEŞEN RAFİNESİ ---------- */

/* Sıcaklık gösterimi: tek satırda kalsın, taşmasın */
.temp-display {
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}

.live-clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Sayısal değerlerde hizalama kayması olmasın */
.metric-value,
.prayer-time,
.finance-value,
.countdown-time,
.sys-bar-pct,
.s-stat,
.s-pts {
  font-variant-numeric: tabular-nums;
}

/* Finans kartları */
.finance-card {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 16px;
}

/* Namaz vakitleri */
.prayer-item {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 14px;
}

/* Haber kartı artık <a> etiketi - bağlantı görünümünü sıfırla */
a.news-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.news-card-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Deprem listesi okunabilirliği */
.eq-item {
  border-radius: 14px;
}

.eq-title {
  line-height: 1.35;
}

/* Sistem sekmesi barları */
.sys-bar-track {
  border-radius: 999px;
  overflow: hidden;
}

.sys-bar-fill {
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal: küçük ekranda kenara yapışmasın */
.modal-box {
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  width: min(100%, 420px);
  margin-inline: auto;
}

.modal-overlay {
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ---------- 6. ERİŞİLEBİLİRLİK ---------- */

/* Klavye ile gezinenler için görünür odak halkası (fare tıklamasında çıkmaz) */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Hareket hassasiyeti olan kullanıcılar için animasyonları kıs */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* İnce kaydırma çubukları */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 999px;
  opacity: 0.4;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* Seçim rengi */
::selection {
  background: var(--accent);
  color: #fff;
}

/* Yazdırma: alt menü ve modallar kağıda basılmasın */
@media print {

  .bottom-nav,
  .modal-overlay,
  .eq-alert,
  .top-bar {
    display: none !important;
  }

  body {
    padding: 0;
    background: #fff;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* ==========================================================================
   BÖLÜM 2 — GÖRSEL KİMLİK VE BİLGİ TASARIMI
   ========================================================================== */

/* ---------- 7. KİMLİK: RENK VE TİPOGRAFİ ---------- */
:root {
  /* Aksan artık tek düz mavi değil; iki duraklı bir kimlik */
  --accent: #4f74ff;
  --accent-dark: #3355e6;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(135deg, #4f74ff, #22d3ee);

  /* Anlamsal renkler: finans yönü ve uyarı seviyeleri */
  --up: #16a34a;
  --down: #dc2626;

  /* Tipografi ölçeği (1.25 oranlı) */
  --fs-xs: 0.72rem;
  --fs-sm: 0.83rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.6rem;
  --fs-2xl: 2rem;
}

[data-theme="dark"] {
  /* Nötr lacivert yerine hafif mor-mavi derinlik */
  --bg-primary: #0b1020;
  --bg-secondary: #141b30;
  --up: #22c55e;
  --down: #f87171;
}

/* Başlıklara aksan çizgisi — kartlar arasında ritim kurar */
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.card-title i:first-child {
  color: var(--accent);
}

/* Sayaç etiketi (deprem adedi gibi) — anlam taşımayan renk kullanmaz */
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .count-pill {
  background: rgba(79, 116, 255, 0.18);
  color: #93b4ff;
}

/* ---------- 8. DEPREM: BEŞ KADEMELİ BÜYÜKLÜK ÖLÇEĞİ ----------
   Eski ölçek 3 kademeydi (<4 / 4-5 / 5+). Türkiye'de günlük sarsıntıların
   neredeyse tamamı 4'ün altında kaldığı için liste tek renge düşüyordu. */
.eq-badge.sev1 { background: #22c55e; }   /* < 2.0  çok hafif */
.eq-badge.sev2 { background: #84cc16; }   /* 2.0+   hafif */
.eq-badge.sev3 { background: #f59e0b; }   /* 3.0+   orta */
.eq-badge.sev4 { background: #f97316; }   /* 4.0+   orta-güçlü */
.eq-badge.sev5 { background: #dc2626; }   /* 5.0+   güçlü */

/* 5.0+ dikkat çeksin */
.eq-badge.sev5 {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
}

.eq-main {
  min-width: 0;
  flex: 1;
}

.eq-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}

.eq-item {
  gap: 12px;
  border-radius: 12px;
  padding: 14px 10px;
}

.eq-item:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

/* Büyüklük dağılımı mini grafiği */
.mag-chart {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 8px;
  height: 92px;
  padding: 8px 4px 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.mag-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}

.mag-bar {
  width: 100%;
  max-width: 46px;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mag-bar.empty {
  background: var(--hairline) !important;
}

.mag-n {
  font-size: var(--fs-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.mag-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ---------- 9. LİG TABLOSU BÖLGELERİ ----------
   Sıralamanın anlamı bölgelerde: Avrupa'ya giden ve küme düşen sıralar. */
.sports-row {
  position: relative;
  padding-left: 10px;
}

.sports-row.zone-ucl::before,
.sports-row.zone-uel::before,
.sports-row.zone-rel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 999px;
}

.sports-row.zone-ucl::before { background: #3b82f6; }
.sports-row.zone-uel::before { background: #14b8a6; }
.sports-row.zone-rel::before { background: #ef4444; }

.sports-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.sports-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sports-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.sports-legend .dot.zone-ucl { background: #3b82f6; }
.sports-legend .dot.zone-uel { background: #14b8a6; }
.sports-legend .dot.zone-rel { background: #ef4444; }

/* ---------- 10. BOŞ DURUMLAR ----------
   "N/A ₺" yerine ne olduğunu söyleyen bir gösterim. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2rem;
  opacity: 0.45;
}

.empty-title {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: var(--fs-md);
}

.empty-desc {
  font-size: var(--fs-sm);
  max-width: 34ch;
  line-height: 1.5;
}

/* Değeri olmayan metrikler soluk ve italik — sahte veriyle karışmasın */
.value-empty {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 600;
  font-size: 0.9em;
}

/* ---------- 11. İSKELET YÜKLEME ----------
   Dönen çark yerine gelecek içeriğin şeklini gösteren gri bloklar:
   algılanan bekleme süresini kısaltır ve düzen zıplamasını önler. */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border-radius: 10px;
  color: transparent !important;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  animation: skeleton-sweep 1.4s infinite;
}

[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
}

@keyframes skeleton-sweep {
  100% { transform: translateX(100%); }
}

.skeleton-row {
  height: 58px;
  margin-bottom: 10px;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-line.short { width: 45%; }
.skeleton-line.medium { width: 70%; }

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* ---------- 12. FİNANS YÖNÜ ---------- */
.trend-up { color: var(--up); }
.trend-down { color: var(--down); }

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--fs-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 999px;
}

.trend-badge.trend-up { background: rgba(34, 197, 94, 0.14); }
.trend-badge.trend-down { background: rgba(248, 113, 113, 0.14); }

/* ---------- 13. HARİTA YÜKSEKLİKLERİ ----------
   Mobilde harita çok basıktı; deprem konumu seçilemiyordu.
   Tek yerden kademeli tanım (başka blokta #map yüksekliği tanımlamayın). */
#map { height: 300px; }
#flight-map { min-height: 300px; }

@media (min-width: 768px) {
  #map { height: 420px; }
  #flight-map { min-height: 420px; }
}

@media (min-width: 1024px) {
  #map { height: 520px; }
  #flight-map { min-height: 520px; }
}

/* ---------- 14. FİNANS MİNİ GRAFİKLERİ ---------- */
.fin-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  min-height: 28px;
}

.sparkline {
  width: 62px;
  height: 28px;
  flex-shrink: 0;
  opacity: 0.9;
}

/* Yeterli veri yoksa gizlenir (JS display:none yapar) */
.sparkline:empty {
  display: none;
}

@media (max-width: 380px) {
  .sparkline { width: 48px; }
}

/* ---------- 15. HAVA KALİTESİ ETİKETİ ----------
   Çıplak "55" hiçbir şey anlatmıyordu; Avrupa AQI ölçeğinden karşılığı. */
.aqi-label {
  display: block;
  margin-top: 3px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 6px;
  width: fit-content;
  margin-inline: auto;
  opacity: 0.95;
}

/* ---------- 16. SAATLİK ŞERİTTE "ŞİMDİ" ---------- */
.hourly-detail-item.is-now {
  background: var(--accent-light);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

[data-theme="dark"] .hourly-detail-item.is-now {
  background: rgba(79, 116, 255, 0.16);
}

.hourly-detail-item.is-now .h-time {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.03em;
}

/* ---------- 17. GÜNÜN SICAKLIK ARALIĞI ----------
   Anlık derece tek başına eksik: "26°" mi ısınıyor mu soğuyor mu? */
.temp-range {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
  font-size: var(--fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.temp-range:empty {
  display: none;
}

.tr-hi { color: #f97316; }
.tr-lo { color: #38bdf8; }

/* ---------- 18. ÜST BLOK SIKILAŞTIRMA ----------
   Saat + tarih + selamlama + geri sayım mobilde ekranın üçte birini
   yiyordu; asıl içerik (hava durumu) kıvrımın altında kalıyordu. */
@media (max-width: 767px) {
  .live-clock {
    font-size: 2.1rem;
    letter-spacing: 1px;
  }

  .live-clock-row {
    margin-bottom: 6px;
  }

  .greeting-row {
    margin-bottom: 12px;
    gap: 12px;
  }

  .greeting-text {
    font-size: 1.05rem;
  }

  .countdown-box {
    padding: 6px 12px;
  }

  .countdown-time {
    font-size: 0.95rem;
  }
}

/* Üst çubuk: içerik kayarken ince bir ayrım çizgisi kazansın */
.top-bar {
  box-shadow: 0 1px 0 var(--hairline);
}

/* Logo alt yazısı gereğinden baskındı */
.logo-section p {
  opacity: 0.65;
  letter-spacing: 0.22em;
}

/* Ana sayfadaki "Bot Linki Ayarla" ikincil bir eylem - birincil gibi durmasın */
#tab-home .btn-bot-settings,
#tab-home a[href*="t.me"].city-btn {
  opacity: 0.88;
  font-weight: 600;
}

/* ============================================================
   KÜRESEL PİYASALAR · UZAY · ÇEVRE
   Finans sekmesindeki ısı haritası ve Dünya sekmesinin bileşenleri.
   ============================================================ */

/* Kart başlığının altındaki açıklama/zaman damgası satırı */
.card-sub {
  margin: -6px 0 12px 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.card-sub:empty {
  display: none;
}

/* --- Ortak boş/hata durumu --- */
.heat-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- Piyasa ısı haritası --- */
.heat-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.heat-group-title {
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.heat-tiles {
  display: grid;
  /* Dar ekranda 2, geniş ekranda kendiliğinden 3-4 sütun */
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.heat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 11px;
  border-radius: var(--radius-md, 14px);
  border: 1px solid var(--hairline);
  /* Arka plan rengi yüzde değişimine göre JS'ten geliyor */
}

.heat-name {
  font-size: 0.68rem;
  font-weight: 700;
  /* --text-muted renkli zeminde kayboluyordu; ana metin rengi soluklaştırıldı */
  color: var(--text-primary);
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heat-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.heat-change {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

/* --- Dünya sekmesi: panel geçişi --- */
.world-view-panel {
  display: none;
}

.world-view-panel.active {
  display: block;
}

/* --- Uzay kartları --- */
.space-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.space-hero-icon {
  font-size: 2.1rem;
  line-height: 1;
}

.space-hero-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.space-hero-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.space-stats {
  display: grid;
  /* Telefonda 2x2: 84px'lik sütunlarda dördüncü kutu tek başına alt satıra
     düşüyor ve "27.533 km/s" hücre içinde kırılıyordu. */
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.space-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-md, 14px);
  background: var(--surface-2);
}

.space-stat span {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
}

.space-stat strong {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.space-note {
  margin: 12px 0 0 0;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Kp indeksi çubuğu (0-9) */
.kp-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.kp-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.meteor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.meteor-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.meteor-row strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* --- Küresel hava kalitesi sıralaması --- */
.aqi-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 70px 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-radius: 10px;
}

/* Kendi şehrin listede kaybolmasın */
.aqi-mine {
  background: var(--accent-light);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.aqi-pos {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
}

.aqi-city {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aqi-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.aqi-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.aqi-val {
  font-size: 0.8rem;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Yangın listesi ve harita işareti --- */
.fire-marker {
  font-size: 1.05rem;
  line-height: 1;
  /* Açık zeminde emoji kaybolmasın */
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.55));
}

.fire-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 2px;
}

.fire-row + .fire-row {
  border-top: 1px solid var(--hairline);
}

.fire-row-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.fire-row-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fire-row-body strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fire-row-body span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- Gündem: ne aranıyor / ne okunuyor --- */
.trend-cols {
  display: grid;
  /* Telefonda alt alta, tablet ve üstünde yan yana */
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.trend-col-title {
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.trend-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 4px;
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
}

.trend-row + .trend-row {
  border-top: 1px solid var(--hairline);
}

.trend-row:hover {
  background: var(--surface-2);
}

.trend-pos {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
}

.trend-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Alt menü: masaüstündeki yüzen hap.
   Taban kuraldaki `.nav-btn { flex: 1 1 0 }` stil dosyasında masaüstü medya
   bloğundan SONRA geldiği için onu eziyordu; max-content genişlikli hap
   içinde 9 düğme eşit ve dar paylaşılıp etiketler "Ana ...", "Habe..." diye
   kırpılıyordu. Bu blok dosyanın sonunda olduğu için son sözü o söylüyor. */
@media (min-width: 1024px) {
  .bottom-nav .nav-btn {
    flex: 0 0 auto;
  }
}
