/* ═══════════════════════════════════════════════════════════════
   style.css — Namaz Vakitleri
   Estetik: Derin lapis lazuli & altın — zarif, İslami minyatür ruhu
   ═══════════════════════════════════════════════════════════════ */

/* ── Değişkenler ─────────────────────────────────────────────── */
:root {
  --bg-deep:        #0b0f1a;
  --bg-card:        #111827;
  --bg-card-hover:  #161f30;
  --bg-table-head:  #0e1520;
  --bg-row-alt:     #0d1422;

  --gold:           #c9a84c;
  --gold-light:     #e8c870;
  --gold-dim:       #7a6030;

  --teal:           #2dd4bf;
  --teal-dim:       #134e4a;

  --ramadan-sahur-bg:   #1a2a1a;
  --ramadan-sahur-txt:  #6ee7b7;
  --ramadan-sahur-bdr:  #065f46;

  --ramadan-iftar-bg:   #2a1a0a;
  --ramadan-iftar-txt:  #fbbf24;
  --ramadan-iftar-bdr:  #92400e;

  --today-bg:       #1a1f35;
  --today-border:   #4f6ef7;

  --text-primary:   #e8e8e2;
  --text-secondary: #9ca3af;
  --text-dim:       #4b5563;

  --error-bg:       #2d1515;
  --error-txt:      #fca5a5;

  --border:         rgba(255,255,255,0.06);
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      20px;

  --font-display:   'Amiri', serif;
  --font-body:      'Outfit', sans-serif;

  --transition:     0.2s ease;
}

/* ── Reset & temel ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Arka plan dekorasyonu ───────────────────────────────────── */
.bg-pattern {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(201,168,76,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(45,212,191,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(201,168,76,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Sayfa sarmalayıcı ───────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ── Yükleme göstergesi ──────────────────────────────────────── */
.loading-dots {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  padding: 0.4rem 0 0.8rem;
}

.loading-dots .dot {
  opacity: 0;
  animation: blink-dot 1.2s step-start infinite;
}

.loading-dots .dot:nth-child(1) { animation-delay: 0s; }
.loading-dots .dot:nth-child(2) { animation-delay: 0.4s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.8s; }

@keyframes blink-dot {
  0%, 100% { opacity: 0; }
  50%       { opacity: 1; }
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

.header-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.6rem 0;
}

.ornament-line {
  display: block;
  height: 1px;
  width: 80px;
  background: linear-gradient(to right, transparent, var(--gold-dim), transparent);
}

.ornament-icon {
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0.8;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.02em;
  text-shadow: 0 0 40px rgba(201,168,76,0.3);
  line-height: 1.2;
}

.site-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  letter-spacing: 0.08em;
}

/* ── Şehir seçimi ────────────────────────────────────────────── */
.city-selector-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.8rem 0 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 0.35rem 0.9rem 0.35rem 1rem;
}

.city-selector-wrap label {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.city-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  padding: 0 0.4rem;
  /* ok ikonunu özelleştir */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c9a84c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 1.2rem;
}

.city-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ── Hata bandı ──────────────────────────────────────────────── */
.error-banner {
  background: var(--error-bg);
  color: var(--error-txt);
  border: 1px solid rgba(252,165,165,0.2);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  text-align: center;
}

/* ── Geri sayaç ──────────────────────────────────────────────── */
.countdown-section {
  display: flex;
  justify-content: center;
  margin: 0 0 2rem;
}

.countdown-card {
  background: linear-gradient(135deg, #1a1400 0%, #0f1a12 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 1.8rem 2.8rem;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.08),
    0 20px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(201,168,76,0.12);
  min-width: 320px;
}

.countdown-crescent {
  font-size: 1.8rem;
  color: var(--gold);
  opacity: 0.7;
  margin-bottom: 0.4rem;
  animation: pulse 2.5s ease-in-out infinite;
  will-change: opacity;
}

@keyframes pulse {
  0%,100% { opacity: 0.5; }
  50%      { opacity: 1;   }
}

.countdown-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.countdown-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}

.time-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
  tabular-nums: auto;
  font-variant-numeric: tabular-nums;
}

.time-unit {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.time-sep {
  font-size: 2rem;
  color: var(--gold-dim);
  line-height: 1;
  margin-bottom: 0.6rem;
}

.countdown-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* ── Ay navigasyonu ──────────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--gold);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-dim);
  transform: scale(1.1);
}

.nav-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold-light);
  min-width: 200px;
  text-align: center;
  letter-spacing: 0.04em;
}

/* ── Tablo ───────────────────────────────────────────────────── */
.calendar-container {
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 40px rgba(0,0,0,0.4);
}

.prayer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

/* Thead */
.prayer-table thead tr {
  background: var(--bg-table-head);
  border-bottom: 1px solid var(--gold-dim);
}

.prayer-table th {
  padding: 0.75rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

/* Tbody satırlar */
.prayer-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
  contain: layout style;
}

.prayer-table tbody tr:nth-child(even) {
  background: var(--bg-row-alt);
}

.prayer-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.prayer-table td {
  padding: 0.65rem 0.6rem;
  text-align: center;
  white-space: nowrap;
  color: var(--text-primary);
}

/* Kolon genişlikleri */
.col-date  { font-size: 0.82rem; color: var(--text-secondary); min-width: 72px; }
.col-day   { font-size: 0.78rem; color: var(--text-dim); min-width: 40px; }
.col-prayer { min-width: 68px; font-variant-numeric: tabular-nums; }

/* ── Satır vurguları ──────────────────────────────────────────── */

/* Bugün */
.row-today {
  background: var(--today-bg) !important;
  box-shadow: inset 3px 0 0 var(--today-border);
}

.row-today .col-date,
.row-today .col-prayer {
  color: #a5b4fc;
}

.day-today {
  color: #818cf8 !important;
  font-weight: 600;
}

/* Ramazan satırı genel */
.row-ramadan {
  background: #100e0a !important;
}

/* Sahur hücresi (İmsak) */
td.highlight-sahur {
  background: var(--ramadan-sahur-bg);
  color: var(--ramadan-sahur-txt) !important;
  border-left: 2px solid var(--ramadan-sahur-bdr);
  border-right: 2px solid var(--ramadan-sahur-bdr);
  position: relative;
}

/* İftar hücresi (Akşam) */
td.highlight-iftar {
  background: var(--ramadan-iftar-bg);
  color: var(--ramadan-iftar-txt) !important;
  border-left: 2px solid var(--ramadan-iftar-bdr);
  border-right: 2px solid var(--ramadan-iftar-bdr);
  position: relative;
}

/* Sahur / İftar rozeti */
.badge-sahur,
.badge-iftar {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 600;
}

.badge-sahur { color: #34d399; }
.badge-iftar { color: #fbbf24; }

/* ── Legend / Footer ──────────────────────────────────────────── */
.site-footer {
  margin-top: 2.5rem;
  text-align: center;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.legend-dot.ramadan-sahur { background: var(--ramadan-sahur-txt); }
.legend-dot.ramadan-iftar { background: var(--ramadan-iftar-txt); }
.legend-dot.today         { background: #818cf8; }

.footer-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.footer-note a {
  color: var(--gold-dim);
  text-decoration: none;
}

.footer-note a:hover { color: var(--gold); }

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.5;
}

/* ── Animasyonlar ─────────────────────────────────────────────── */

/* Kullanıcı hareketi azaltma tercihi varsa animasyonları kapat */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Mobil ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .page-wrapper { padding: 1rem 0.5rem 3rem; }

  .site-title { font-size: 1.9rem; }

  .countdown-card {
    padding: 1.4rem 1.6rem;
    min-width: 0;
    width: 100%;
  }

  .time-num { font-size: 2rem; }

  .prayer-table { font-size: 0.8rem; }
  .prayer-table th, .prayer-table td { padding: 0.55rem 0.4rem; }

  .col-date { min-width: 56px; }
  .col-prayer { min-width: 56px; }

  .badge-sahur, .badge-iftar { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Şehir Seçim Ekranı (Splash)
   ═══════════════════════════════════════════════════════════════ */

.city-splash {
  display: none;           /* JS açar */
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 16, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.city-splash.visible {
  opacity: 1;
}

.city-splash-card {
  background: linear-gradient(160deg, #111827 0%, #0b1020 100%);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 2.4rem 2rem 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.06),
    0 32px 80px rgba(0,0,0,0.7);
  transform: translateY(20px);
  transition: transform 0.35s ease;
  /* scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.city-splash.visible .city-splash-card {
  transform: translateY(0);
}

.splash-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.splash-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--gold-light);
  text-align: center;
  letter-spacing: 0.03em;
  text-shadow: 0 0 30px rgba(201,168,76,0.25);
}

.splash-sub {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0.4rem 0 1.4rem;
  letter-spacing: 0.03em;
}

/* Arama kutusu */
.splash-search-wrap {
  position: relative;
  margin-bottom: 1.2rem;
}

.splash-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dim);
  font-size: 1.1rem;
  pointer-events: none;
  line-height: 1;
}

.splash-search {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 999px;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.splash-search::placeholder { color: var(--text-dim); }

.splash-search:focus {
  border-color: var(--gold-dim);
  background: rgba(255,255,255,0.06);
}

/* Şehir grid */
.splash-city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.splash-city-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.15s ease;
  text-align: center;
}

.splash-city-btn:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold-dim);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.splash-city-btn.active {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

.splash-no-result {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 1rem 0;
}

/* ── Şehir değiştir butonu (header'da) ────────────────────────── */
.change-city-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.8rem 0 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 0.35rem 1rem 0.35rem 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.change-city-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
  color: var(--gold-light);
}

.change-city-icon {
  color: var(--gold);
  font-size: 1rem;
  line-height: 1;
}

/* ── PWA Kurulum Popup ───────────────────────────────────────────── */
.install-popup {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,168,76,0.08);
  animation: slideUp 0.3s ease both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.install-popup-content {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.install-icon {
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
}

.install-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.install-text strong {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 600;
}

.install-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.install-popup-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.install-btn {
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: #0b0f1a;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: background var(--transition), transform 0.15s ease;
}

.install-btn:hover {
  background: var(--gold-light);
  transform: scale(1.04);
}

.install-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem;
  line-height: 1;
  transition: color var(--transition);
}

.install-close:hover {
  color: var(--text-primary);
}

@media (max-width: 400px) {
  .install-popup {
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
    bottom: 1rem;
  }
}
