/* ============================================
 🇮🇶 IRAQ PAGE — GlobalTime.io
 Responsive + Retina + 4K Optimized Stylesheet
============================================ */

/* ---------- Root Colors & Variables ---------- */
:root {
  /* 🇮🇶 Iraq Flag Gradient — Red → White → Black */
  --bg: linear-gradient(180deg, #d71a28 0%, #ffffff 50%, #007847 100%);
  --card: rgba(255, 255, 255, 0.85);
  --text: #111;
  --muted: #444;
  --accent: #da0000;
  --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(180deg, #d71a28 0%, #ffffff 50%, #007847 100%);
  --card: rgba(25, 25, 25, 0.9);
  --text: #f4f4f4;
  --muted: #b0b0b0;
  --accent: #ff4444;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ---------- 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(218, 0, 0, 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: #ff4444;
  text-shadow: 0 0 10px rgba(255, 68, 68, 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 + Flag ---------- */
.city-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.city-name span.flag {
  font-size: 1.4em;
  line-height: 1;
}

/* ---------- City Time ---------- */
.city-time {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}
body.dark-mode .city-card {
  background: rgba(0, 0, 0, 0.35);
}
body.dark-mode .city-name {
  color: #ffd6d6;
}
body.dark-mode .city-time {
  color: #ff4444;
}

/* ---------- 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 .row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.converter .row select,
.converter .row input {
  flex: 1 1 250px;
  min-width: 250px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}
body.dark-mode .converter select,
body.dark-mode .converter input {
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* ---------- Result Box ---------- */
.convert-result-box {
  position: relative;
  border: 3px double var(--accent);
  padding: 18px 22px;
  display: none;
}
body.dark-mode .convert-result-box {
  border: 3px double #ff4444;
}
.convert-result-box.show {
  display: block;
  animation: fadeInBox 0.4s ease-in-out;
}
@keyframes fadeInBox {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Compact Action Buttons (All in One Line) ---------- */
.convert-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px; /* spacing between buttons */
  flex-wrap: nowrap; /* force single line */
  margin-top: 12px;
}

/* Copy button style */
.copy-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s ease-in-out;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #ff8800;
  color:#fff;
}

/* Share buttons container */
.share-buttons {
  display: flex;
  gap: 6px;
}

/* ---------- Buttons ---------- */
.cta {
  background: linear-gradient(180deg, #da0000, #ffffff, #007847);
  border: none;
  color: #000;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  transition: 0.2s;
}
.cta:hover {
  background: linear-gradient(180deg, #007847, #ffffff, #da0000);
  box-shadow: 0 3px 12px rgba(218, 0, 0, 0.4);
  transform: translateY(-2px);
}

/* ---------- Regions List ---------- */
.iraq-regions {
  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:hover {
  background: linear-gradient(180deg, #da0000, #ffffff, #007847);
  color: #000;
  font-weight: 600;
  transform: translateY(-2px);
}
body.dark-mode .division-link {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
body.dark-mode .division-link:hover {
  color: #d71a28;
}

/* ---------- Back Button ---------- */
.back-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #da0000, #ffffff, #007847);
  color: #000;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: 0.3s;
}
.back-home-button:hover {
  background: linear-gradient(180deg, #007847, #ffffff, #da0000);
  color: #000;
}
.back-home-wrapper {
  text-align: center;
  margin: 40px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 20px; }
  .main-clock .time { font-size: 48px; }
  .utc-small { position: static; margin-top: 10px; text-align: center; }
  .card { padding: 20px; }
}

/* ---------- Small Devices (≤480px) ---------- */
@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; }
  .cta { padding: 10px 20px; font-size: 15px; }
  .meta { font-size: 14px; line-height: 1.4; }
}

/* ---------- XL Screens (≥1600px) ---------- */
@media (min-width: 1600px) {
  .hero { max-width: 1600px; gap: 40px; padding: 0 40px; }
  .main-clock .time { font-size: 80px; }
  .card { padding: 32px; }
  .city-card { padding: 18px; }
}

/* ---------- 4K Screens (≥2400px) ---------- */
@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); }
  .city-card { backdrop-filter: blur(8px); }
  .cta { filter: contrast(1.1) brightness(1.05); }
  .main-clock .time { letter-spacing: -0.02em; }
  .city-time { text-shadow: 0 0 2px rgba(0, 0, 0, 0.15); }
}

/* ---------- Super Retina (≥3× Density) ---------- */
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
  .flag-inline-title { filter: saturate(1.15) brightness(1.1); }
  .cta { filter: contrast(1.2) brightness(1.1); }
  .main-clock .time { text-shadow: 0 0 4px rgba(218, 0, 0, 0.25); }
}
