/* ============================================
 🏴 SCOTLAND PAGE — GlobalTime.io
 Responsive + Retina + 4K Optimized Stylesheet
============================================ */

/* ---------- Root Colors & Variables ---------- */
:root {
  /* 🏴 Scotland Flag Gradient — Blue & White */
  --bg: linear-gradient(135deg, #0065bf 0%, #ffffff 50%, #003f87 100%);
  --card: rgba(255, 255, 255, 0.85);
  --text: #111;
  --muted: #555;
  --accent: #003f87;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
}

/* 🌙 Dark Mode */
body.dark-mode {
  --bg: linear-gradient(135deg, #0b1b2b 0%, #001f3f 50%, #003f87 100%);
  --card: rgba(25, 25, 25, 0.9);
  --text: #f5f5f5;
  --muted: #aaa;
  --accent: #4da3ff;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* ---------- Base Layout ---------- */
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s, color 0.3s;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero Section ---------- */
.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin: 30px auto;
  max-width: 1280px;
  padding: 0 20px;
}

/* ---------- Cards ---------- */
.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;
}

/* ---------- Main Clock ---------- */
.main-clock {
  position: relative;
  text-align: center;
  margin-bottom: 24px;
}
.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(0, 63, 135, 0.15);
  border-radius: 10px;
  padding: 6px 12px;
  text-align: right;
}
.utc-small .clock-time {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
}
.utc-small .clock-tz {
  font-size: 12px;
  color: var(--muted);
}
body.dark-mode .main-clock .time,
body.dark-mode .utc-small .clock-time {
  color: #4da3ff;
  text-shadow: 0 0 10px rgba(77, 163, 255, 0.6);
}

/* ---------- Meta Info ---------- */
.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);
}

/* ---------- Cities 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;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.city-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.25);
}
.city-name {
  display: inline-flex;        /* ⬅️ inline-flex instead of flex */
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;         /* ⬅️ prevents wrapping to new line */
}
.city-name img.flag-inline {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 2px rgba(0,0,0,0.3);
}
body.dark-mode .city-card {
  background: rgba(0, 0, 0, 0.35);
}
body.dark-mode .city-name {
  color: #4da3ff;
}
body.dark-mode .city-time {
  color: #4da3ff;
}

/* ---------- Flags ---------- */
.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);
}

/* ---------- Converter ---------- */
.converter {
  text-align: center;
}
.converter .row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}
.converter .row select,
.converter .row input {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #111;
  box-sizing: border-box;
  text-align: left;
}
.converter .row button.cta,
.converter .row button.swap-btn {
  flex: 0 0 auto;
  min-width: 120px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

/* ---------- Buttons ---------- */
.cta {
  background: linear-gradient(90deg, #003f87, #ffffff, #0065bf);
  border: none;
  color: #000;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  transition: 0.2s;
}
.cta:hover {
  background: linear-gradient(90deg, #0065bf, #ffffff, #003f87);
  box-shadow: 0 3px 12px rgba(0, 63, 135, 0.5);
  transform: translateY(-2px);
  color: #000;
}

/* ---------- Time Converter Result Box ---------- */
#convert-result-box {
  display: none;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: all 0.4s ease;
}
#convert-result-box.visible {
  display: block;
  animation: fadeInBox 0.5s ease-in-out;
}
#convert-result-box h3 {
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #222;
}
#convert-result {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 10px 14px;
  display: inline-block;
  min-width: 240px;
}
body.dark-mode #convert-result-box {
  background: rgba(22, 27, 34, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.1);
}
body.dark-mode #convert-result {
  background: #1c2128;
  color: #f0f0f0;
}

/* ---------- UK Divisions ---------- */
.uk-divisions {
  text-align: center;
}
.states-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.division-link {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: 0.3s;
  text-align: center;
}
.division-link.active {
  background: linear-gradient(90deg, #003f87, #ffffff, #0065bf);
  color: #000;
  font-weight: 600;
  border-radius: 8px;
}
.division-link:hover {
  background: linear-gradient(90deg, #0065bf, #ffffff, #003f87);
  color: #000;
  font-weight: 600;
  transform: translateY(-2px);
}

/* ---------- Back Button ---------- */
.back-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #003f87;
  color: #fff;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}
.back-home-button:hover {
  background-color: #0065bf;
}
.back-home-wrapper {
  text-align: center;
  margin: 40px 0;
}

/* ---------- Animation ---------- */
@keyframes fadeInBox {
  from {opacity: 0; transform: translateY(12px);}
  to {opacity: 1; transform: translateY(0);}
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 20px; }
  .main-clock .time { font-size: 48px; }
}
@media (max-width: 480px) {
  .hero { padding: 0 12px; gap: 16px; }
  .main-clock .time { font-size: 40px; }
  .card { padding: 16px; border-radius: 12px; }
  .city-card { padding: 14px; font-size: 14px; }
}
@media (min-width: 1600px) {
  .hero { max-width: 1600px; gap: 40px; padding: 0 40px; }
  .main-clock .time { font-size: 80px; }
}
@media (min-width: 2400px) {
  body { font-size: 18px; }
  .main-clock .time { font-size: 96px; }
}

/* ---------- Retina Optimization ---------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .flag-inline-title { image-rendering: crisp-edges; filter: saturate(1.05) contrast(1.05); }
  .card { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }
}
