* {
  box-sizing: border-box;
}

/* =========================
   GENEL BODY (APPLE THEME)
========================= */
body {
  margin: 0;
  padding-top: 60px;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    system-ui,
    Helvetica,
    Arial,
    sans-serif;
  background: radial-gradient(
    circle at top,
    #f2f2f7 0%,
    #d1d1d6 55%,
    #b1b1b6 100%
  );
  color: #1c1c1e;
}
  .clock-frame {
    display: inline-block;
    padding: 16px;
    border-radius: 32px;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(22px);
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow:
      0 25px 55px rgba(0,0,0,0.35),
      inset 0 0 0 1px rgba(255,255,255,0.5);
    margin: 30px auto;
  }
  
.clock-card {
  padding: 28px 42px;
  border-radius: 22px;
  background: rgba(255,255,255,0.88);
  border: 1px solid #d2d2d7;
  backdrop-filter: blur(20px);
  box-shadow:
    0 12px 30px rgba(0,0,0,0.18),
    inset 0 0 0 1px rgba(255,255,255,0.5);
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.clock-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 18px 40px rgba(0,0,0,0.25),
    inset 0 0 0 1px rgba(255,255,255,0.6);
}

/* =========================
   ANA İÇERİK
========================= */
.container {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

/* =========================
   SAAT (INDEX + CITY)
========================= */

.time,
#time {
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #1c1c1e;
}


.time,
#time {
  transform: none !important;
  transition: none !important;
}

/* =========================
   TARİH
========================= */
#date,
.date {
  margin-top: 10px;
  font-size: 15px;
  color: #2c2c2e;
  letter-spacing: 0.4px;
}

/* =========================
   AÇIKLAMA
========================= */
.description {
  color: #2c2c2e;
  margin-top: 18px;
  max-width: 680px;
}

/* =========================
   CITY BANNER (APPLE NAV)
========================= */
.city-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  display: flex;
  gap: 18px;
  overflow-x: auto;
  white-space: nowrap;

  padding: 14px 24px;

  background: #c7c7cc;
  border-bottom: 1px solid #d2d2d7;
  backdrop-filter: blur(20px);
}

.city-banner a {
  background: #e5e5ea;
  color: #2e2e2e;
  text-decoration: none;

  font-size: 14px;
  font-weight: 500;

  padding: 8px 14px;
  border-radius: 14px;

  transition: all 0.25s ease;
}

.city-banner a:hover {
  background: #d1d1d6;
}

/* Aktif şehir */
.city-banner a[style*="#ef4444"],
.city-banner a[style*="rgb(239, 68, 68)"] {
  background: #f2f2f7;
  color: #1c1c1e !important;
  font-weight: 700;
}

/* =========================
   LAYOUT & ADS
========================= */
.layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

main.container {
  flex: 1;
  padding-top: 40px;
}

.ad {
  width: 160px;
  display: none;
}

@media (min-width: 1024px) {
  .ad {
    display: block;
  }

  body.city-page main.container {
    padding-top: 160px;
  }
}

@media (max-width: 1023px) {
  .layout {
    flex-direction: column;
  }

  .ad-left,
  .ad-right {
    display: none;
  }

  .ad-mobile {
    display: block;
    margin: 20px auto;
  }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 600px) {
  #time,
  .time {
    font-size: 48px;
  }

  #date,
  .date {
    font-size: 14px;
  }

  .city-banner a {
    font-size: 13px;
    padding: 6px 12px;
  }
}


/* =========================
   FIX PACK (MOBILE + ALIGN)
   ========================= */

/* Yazıları biraz yukarı al (index + city genel) */
.container {
  padding-top: 18px; /* daha yukarı */
}

/* City sayfasında başlık + kartlar arası boşluğu toparla */
body.city-page #city-title {
  margin-top: 10px;
  margin-bottom: 14px;
}

/* Clock-frame / card mobilde taşmayı engelle */
@media (max-width: 600px) {
  .clock-frame {
    padding: 10px !important;
    border-radius: 26px !important;
    max-width: calc(100vw - 24px) !important;
    box-sizing: border-box !important;
    margin: 16px auto !important;
  }

  .clock-card {
    padding: 18px 18px !important;
    border-radius: 18px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .time {
    font-size: clamp(38px, 10vw, 54px) !important;
    letter-spacing: 0.04em !important;
  }

  .date {
    font-size: 14px !important;
    margin-top: 8px !important;
  }

  /* Açıklama biraz yukarı ve daha okunur */
  #city-description,
  .description {
    margin-top: 14px !important;
    padding: 0 14px;
  }
}


/* ============ MOBILE LAYOUT FIX (City) ============ */
@media (max-width: 600px) {
  /* içerik yukarı gelsin */
  body.city-page .container,
  body.city-page main.container {
    padding-top: 12px !important;
  }

  /* şehir başlığı daha yukarı */
  body.city-page #city-title {
    margin-top: 6px !important;
    margin-bottom: 10px !important;
  }

  /* kart daha geniş olsun (mavi çizgilere yaklaşsın) */
  body.city-page .clock-frame {
    width: min(94vw, 520px) !important;
    max-width: 94vw !important;
    margin: 14px auto !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  body.city-page .clock-card {
    width: 100% !important;
    padding: 18px 14px !important;
    box-sizing: border-box !important;
  }

  /* saat yazısı sabit genişlik: saniye akarken kayma olmasın */
  body.city-page .time {
    display: inline-block !important;
    min-width: 9ch !important;           /* 00:00:00 için sabit alan */
    text-align: center !important;
    font-variant-numeric: tabular-nums;  /* mümkünse sabit rakam genişliği */
    font-feature-settings: "tnum" 1;     /* destekleyen fontlarda etkili */
    letter-spacing: 0.05em !important;
  }

  /* açıklama biraz yukarı */
  body.city-page #city-description {
    margin-top: 12px !important;
    padding: 0 16px !important;
  }
}

/* ============ CLOCK STABILITY (ALL DEVICES) ============ */
/* Saniye akarken layout kaymasın */
.time {
  display: inline-block;
  min-width: 9ch;                 /* 00:00:00 sabit alan */
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ============ CITY PAGE POSITION TWEAK (DESKTOP + MOBILE) ============ */
/* City sayfasında genel olarak biraz yukarı al */
body.city-page main.container,
body.city-page .container {
  padding-top: 18px !important;
}

/* Şehir başlığı üst boşluk azalt */
body.city-page #city-title {
  margin-top: 4px !important;
  margin-bottom: 10px !important;
}

/* MOBİL daha da yukarı + daha iyi genişlik */
@media (max-width: 600px) {
  body.city-page main.container,
  body.city-page .container {
    padding-top: 6px !important;  /* daha yukarı */
  }

  body.city-page #city-title {
    margin-top: 2px !important;
    margin-bottom: 8px !important;
  }

  body.city-page .clock-frame {
    width: min(96vw, 520px) !important;
    max-width: 96vw !important;
    margin: 10px auto !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  body.city-page .clock-card {
    width: 100% !important;
    padding: 18px 14px !important;
    box-sizing: border-box !important;
  }

  body.city-page #city-description {
    margin-top: 10px !important;
    padding: 0 16px !important;
  }
}


/* MOBILE: kart sağa-sola yapışmasın */
@media (max-width: 600px) {
  .clock-frame {
    width: calc(100% - 28px);  /* iki yandan 14px boşluk */
    margin: 18px auto;
    padding: 12px;            /* dış cam çerçeve biraz incelsin */
    border-radius: 26px;
  }

  .clock-card {
    width: 100%;
    padding: 18px 16px;       /* içerik daha kompakt */
    border-radius: 18px;
  }

  /* Saat metni taşma yapmasın */
  #time.time {
    width: 100%;
    text-align: center;
  }
}


/* Aktif tıklanan şehir (daha koyu gri) */
.city-banner a.active {
  background: #b1b1b6 !important;
  color: #1c1c1e !important;
  font-weight: 700;
}


/* ✅ Mobilde kart ekrana yapışmasın */
@media (max-width: 600px) {
  /* city.html içindeki <main class="container"> için */
  body.city-page .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* dış çerçeve ekrandan taşmasın */
  body.city-page .clock-frame {
    width: 100%;
    max-width: 480;         /* istersen 480 yap */
    margin-left: auto;
    margin-right: auto;
    padding: 10px;            /* dış cam boşluğu */
    box-sizing: border-box;
  }

  /* iç kart da çerçeveye tam otursun */
  body.city-page .clock-card {
    width: 100%;
    box-sizing: border-box;
    padding: 22px 18px;       /* mobilde biraz daha kompakt */
  }
}

.estimated-location {
  color: #1c1c1e;
}


/* Banner'da aktif (tıklanmış) şehir */
.city-banner a.is-active {
  background: #b0b0b6;   /* koyu gri */
  color: #1c1c1e !important;
  font-weight: 700;
}


/* Swipe preview animasyonu için */
main.container {
  will-change: transform;
}

.city-banner a.is-preview {
  background: #d0d0d6;
  color: #1c1c1e !important;
  font-weight: 700;
}
