:root {
  --blue: #1a73e8;      /* Modern American Blue */
  --red: #b22234;       /* Flag Red */
  --white: #ffffff;
  --bg: linear-gradient(135deg, #f2f7ff, #e8eefb, #fdfdff);
  --card: rgba(255, 255, 255, 0.92);
  --text: #0d1117;
  --muted: #555;
  --accent: var(--blue);
  --accent-red: var(--red);
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --overlay-light: rgba(255, 255, 255, 0.25);
}

/* 🌍 Glossy Flag-Inspired Gradient */
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background:
    /* 🇺🇸 Layer 1 — Smooth gradient (Blue → White → Red) */
    linear-gradient(
      135deg,
      rgba(26, 115, 232, 0.9) 0%,      /* Blue */
      rgba(255, 255, 255, 0.95) 50%,   /* White Gloss Center */
      rgba(178, 34, 52, 0.9) 100%      /* Red */
    ),
    /* 🌟 Layer 2 — Glossy overlay highlight */
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.25) 0%,
      transparent 60%
    );
  background-blend-mode: overlay;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
  transition: background 0.4s ease, color 0.3s ease;
}

/* 🌙 Dark Mode */
body.dark-mode {
  background:
    linear-gradient(
      135deg,
      rgba(26, 115, 232, 0.3) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(178, 34, 52, 0.3) 100%
    ),
    radial-gradient(
      circle at center,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0.85) 100%
    );
  background-blend-mode: overlay, multiply;
  color: #e6edf3;
}

/* 🌟 Animated Gloss Reflection */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: -60%;
  width: 220%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.04) 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.04) 75%,
    rgba(255, 255, 255, 0.12) 100%
  );
  mix-blend-mode: overlay;
  animation: gloss-flow 20s infinite linear;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}

@keyframes gloss-flow {
  0% { transform: translateX(-10%) translateY(-10%) rotate(0deg); }
  50% { transform: translateX(10%) translateY(10%) rotate(1deg); }
  100% { transform: translateX(-10%) translateY(-10%) rotate(0deg); }
}

/* ============================
   🌍 MAIN LAYOUT
============================ */
.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin: 30px auto;
  max-width: 1280px;
  padding: 0 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: background 0.3s, box-shadow 0.3s;
}

/* ============================
   ⏰ CLOCK SECTION
============================ */
.main-clock {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.main-clock .time {
  font-size: 64px;
  font-weight: 700;
  color: var(--accent);
}

.main-clock .tz {
  font-size: 16px;
  color: var(--muted);
  margin-top: 6px;
}

.utc-small {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(26, 115, 232, 0.1);
  border-radius: 10px;
  padding: 6px 12px;
  text-align: right;
}

.utc-small .clock-time {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.utc-small .clock-tz {
  font-size: 12px;
  color: var(--muted);
}

/* 🌙 Dark Mode Clock Accent */
body.dark-mode .main-clock .time,
body.dark-mode .utc-small .clock-time {
  color: var(--accent-red);
  text-shadow: 0 0 8px rgba(178, 34, 52, 0.6);
}

/* ============================
   📍 META INFO GRID
============================ */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.meta {
  background: rgba(0, 0, 0, 0.05);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
}

body.dark-mode .meta {
  background: rgba(255, 255, 255, 0.05);
}

/* ============================
   🏙️ CITY CLOCKS GRID
============================ */
.cities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.city-card {
  background: rgba(255, 255, 255, 0.15);
  padding: 14px;
  border-radius: var(--radius);
  text-align: center;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.city-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.city-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.city-time {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

/* 🌙 Dark Mode Accent */
body.dark-mode .city-time {
  color: var(--accent-red);
}

body.dark-mode .city-name {
  color: var(--accent);
}

/* ============================
   🇺🇸 FLAG INLINE ICON
============================ */
.flag-inline-title {
  height: 1em;
  width: auto;
  margin-right: 0.4em;
  vertical-align: middle;
  border-radius: 0.2em;
  object-fit: cover;
  box-shadow: 0 0.05em 0.15em rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.flag-inline-title:hover {
  transform: scale(1.05);
}

/* ============================
   🗂️ SIDEBAR SECTION
============================ */
.sidebar-main-box {
  background: var(--card);
  border-radius: var(--radius);
  text-align: center;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.sidebar-inner-box {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Sidebar Links */
.sidebar-inner-box .division-link {
  display: block;
  width: 60%;
  padding: 8px 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
}

.sidebar-inner-box .division-link:hover {
  background: linear-gradient(90deg, #1a73e8, #ffffff, #b22234);
  color: #000;
  transform: translateY(-2px);
  font-weight: 600;
}

.sidebar-inner-box .division-link.active-division {
  background: linear-gradient(90deg, #1a73e8, #ffffff, #b22234);
  color: #000 !important;
  font-weight: 700;
}

/* 🌙 Dark Mode Sidebar */
body.dark-mode .sidebar-main-box {
  background: rgba(22, 27, 34, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .sidebar-inner-box {
  background: rgba(22, 27, 34, 0.2);
}

body.dark-mode .sidebar-inner-box .division-link {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

body.dark-mode .sidebar-inner-box .division-link:hover {
  background: linear-gradient(90deg, #1a73e8, #b22234);
  color: #fff;
}

/* ============================
   🇺🇸 SIDEBAR HEADER
============================ */
.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 15px;
  margin-bottom: 15px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.flag-inline-title {
  width: 28px;
  height: auto;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
}

/* 🌙 Dark Mode Header */
body.dark-mode .section-title {
  color: #fff;
}

body.dark-mode .section-title::after {
  background: linear-gradient(90deg, #1a73e8, #b22234);
}

/* ============================
   🔙 BACK BUTTON
============================ */
.back-home-wrapper {
  text-align: center;
  margin: 40px 0;
}

.back-home-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--accent);
  color: #fff;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s ease;
}

.back-home-button:hover {
  background-color: var(--accent-red);
}

/* ============================
   🌙 DARK MODE — MAIN LAYOUT
============================ */
body.dark-mode .hero {
  background: rgba(22, 27, 34, 0.85);
  border-radius: var(--radius);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
  padding: 20px;
}

/* Card Dark Mode */
body.dark-mode .card {
  background: rgba(22, 27, 34, 0.9);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  color: #e6edf3;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Clock Dark Mode Accent */
body.dark-mode .main-clock {
  background: linear-gradient(145deg, rgba(26,115,232,0.15), rgba(178,34,52,0.15));
  border-radius: var(--radius);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.05);
}

/* UTC Box */
body.dark-mode .utc-small {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Meta Info */
body.dark-mode .meta {
  background: rgba(255, 255, 255, 0.08);
  color: #c9d1d9;
}

/* City Cards */
body.dark-mode .city-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6edf3;
}

body.dark-mode .city-card:hover {
  box-shadow: 0 0 15px rgba(178, 34, 52, 0.3);
}

/* Sidebar */
body.dark-mode .sidebar-main-box {
  background: rgba(22, 27, 34, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .sidebar-inner-box {
  background: rgba(255, 255, 255, 0.04);
}

/* Sidebar Links */
body.dark-mode .sidebar-inner-box .division-link {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e6edf3;
}

body.dark-mode .sidebar-inner-box .division-link:hover {
  background: linear-gradient(90deg, rgba(26,115,232,0.6), rgba(178,34,52,0.6));
  color: #fff;
}

/* Section Titles */
body.dark-mode .section-title {
  color: #fff;
  text-shadow: 0 0 8px rgba(26, 115, 232, 0.3);
}

/* Back Button */
body.dark-mode .back-home-button {
  background-color: rgba(26, 115, 232, 0.8);
  color: #fff;
  box-shadow: 0 0 15px rgba(26, 115, 232, 0.3);
}

body.dark-mode .back-home-button:hover {
  background-color: rgba(178, 34, 52, 0.9);
  box-shadow: 0 0 20px rgba(178, 34, 52, 0.4);
}

/* ============================
   📱 FULL RESPONSIVE DESIGN
   (900px → 768px → 480px)
============================ */

/* ---------- 💻 Tablets & Small Laptops (≤ 900px) ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .main-clock .time {
    font-size: 52px;
  }

  .utc-small {
    position: static;
    margin-top: 10px;
    text-align: center;
  }

  .sidebar-inner-box {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .sidebar-inner-box .division-link {
    flex: 1 1 45%;
    margin: 4px;
  }

  .cities {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ---------- 📱 Tablets & Large Mobiles (≤ 768px) ---------- */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .main-clock .time {
    font-size: 44px;
  }

  .main-clock .tz {
    font-size: 14px;
  }

  .card {
    padding: 18px;
  }

  .city-card {
    padding: 12px;
  }

  .city-name {
    font-size: 14px;
  }

  .city-time {
    font-size: 18px;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .sidebar-main-box {
    width: 100%;
    order: 2;
    margin-top: 20px;
  }

  .main-clock {
    order: 1;
  }

  .sidebar-inner-box .division-link {
    flex: 1 1 100%;
    margin: 5px 0;
  }

  .section-title {
    font-size: 16px;
  }

  .back-home-button {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* ---------- 📞 Small Mobiles (≤ 480px) ---------- */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .main-clock .time {
    font-size: 36px;
  }

  .utc-small {
    margin-top: 8px;
    padding: 5px 10px;
  }

  .meta-row {
    flex-direction: column;
    align-items: center;
  }

  .meta {
    width: 100%;
    text-align: center;
  }

  .cities {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .city-card {
    padding: 10px;
  }

  .sidebar-main-box {
    padding: 8px;
  }

  .sidebar-inner-box {
    flex-direction: column;
  }

  .back-home-button {
    width: 90%;
    font-size: 13px;
    padding: 9px 16px;
  }
}
