/* ===== unks.css — Global + Alabama page styles (updated for horizontal states) ===== */

/* ---------- Layout: Hero / Main ---------- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
}

/* ---------- Card ---------- */
.card {
  background: #ffffffee;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  padding: 18px 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box;
}

/* Slight variation for nested cards in facts section */
.info-block .card {
  background: rgba(248, 250, 252, 0.9);
  border-style: dashed;
}

/* Dark mode overrides for cards */
body.dark-mode .card {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
}

body.dark-mode .info-block .card {
  background: rgba(15, 23, 42, 0.8);
}

/* ---------- Main Clock Block ---------- */
.info-block { display:flex; flex-direction:column; gap:22px; }
.main-clock {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
}

/* Primary big time */
.main-clock .time {
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  margin: 0;
}

body.dark-mode .main-clock .time { color: #e5e7eb; }

/* timezone label */
.main-clock .tz {
  flex: 1;
  min-width: 220px;
  font-size: 0.95rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.dark-mode .main-clock .tz { color: #9ca3af; }

.flag-inline-title {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
}

/* Small UTC clock */
.utc-small {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(37, 99, 235, 0.06);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

body.dark-mode .utc-small {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.2);
}

.clock-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  font-weight: 500;
}

.clock-tz {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
}

body.dark-mode .clock-tz { color: #9ca3af; }

/* ---------- Meta Row (country, capital, etc.) ---------- */
.meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px 16px;
  margin-top: 6px;
}

.meta {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #4b5563;
  padding: 8px 10px;
  border-left: 3px solid rgba(148, 163, 184, 0.6);
  background: rgba(241, 245, 249, 0.9);
  border-radius: 0 10px 10px 0;
}

body.dark-mode .meta {
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.7);
}

/* ---------- Section Titles ---------- */
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 12px 0 10px;
  color: #0f172a;
}

body.dark-mode .section-title { color: #e5e7eb; }

.section-title img.flag-inline-title { box-shadow: none; }

/* ---------- Cities Lists ---------- */
.cities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

/* JS-populated city cards */
.city-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 58%),
              #ffffff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

body.dark-mode .city-card {
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 58%),
              rgba(15, 23, 42, 0.95);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
}

.city-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.city-time {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.city-offset {
  font-size: 0.8rem;
  color: #6b7280;
}

body.dark-mode .city-offset { color: #9ca3af; }

/* ---------- Info Toggle (Theme Aligned) ---------- */
.info-toggle {
  width: 100%;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.08),
    rgba(37, 99, 235, 0.02)
  );
  color: #0f172a;
  border: 1px solid rgba(37, 99, 235, 0.35);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-radius: 14px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* Hover */
.info-toggle:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

/* Toggle icon */
.toggle-icon {
  font-size: 20px;
  color: #2563eb;
  transition: transform 0.25s ease;
}

/* Active (Open) State */
.info-section.active .info-toggle {
  background: rgba(37, 99, 235, 0.16);
  border-color: #2563eb;
}

/* Rotate + icon */
.info-section.active .toggle-icon {
  transform: rotate(45deg);
}

/* Content area */
.info-content {
  display: none;
  padding: 20px 6px 6px;
}

.info-section.active .info-content {
  display: block;
}

/* ---------- Dark Mode: Info Toggle ---------- */
body.dark-mode .info-toggle {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.18),
    rgba(37, 99, 235, 0.08)
  );
  color: #e5e7eb;
  border-color: rgba(37, 99, 235, 0.4);
}

body.dark-mode .info-toggle:hover {
  background: rgba(37, 99, 235, 0.22);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}

body.dark-mode .toggle-icon {
  color: #93c5fd;
}

/* ---------- Sidebar & Converter (Alabama page) ---------- */
.converter-countries-wrapper { display:flex; gap:20px; flex-wrap:wrap; }

.converter { display:flex; flex-direction:column; gap:14px; }
.converter .row { display:grid; grid-template-columns:1.1fr 1.1fr 1.1fr; gap:8px; }

.converter select,
.converter input[type="datetime-local"] {
  width: 100%;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  font-size: 0.9rem;
  background: #f9fafb;
  color: #111827;
  outline: none;
  appearance: none;
}

/* Sidebar specific */
.sidebar { padding: 14px; box-sizing: border-box; }

/* ---------- HORIZONTAL Explore U.S. STATES section ---------- */
/* Make the states section full-width and grid-based (placed below main content) */
.sidebar-main-box {
  width: 100%;
  max-width: 100%;
  margin-top: 20px;
  box-sizing: border-box;
}

/* Convert vertical list into a responsive grid of tiles */
.sidebar-inner-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
  align-items: stretch;
}

/* Make state links rectangular tiles */
.division-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  border-radius: 10px;
  font-size: 0.95rem;
  text-decoration: none;
  color: #111827;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.35);
  transition: background 0.12s ease-out, border-color 0.12s ease-out,
              transform 0.08s ease-out, color 0.12s ease-out;
  text-align: center;
  box-sizing: border-box;
}

/* Remove the arrow used for pill links in vertical layout */
.division-link::after { content: ""; }

/* Hover effect (subtle lift) */
.division-link:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: #2563eb;
  color: #111827;
  transform: translateY(-2px);
}

/* Active state for current division (tile highlight) */
.active-division {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #0b1220;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.06);
}

/* Dark mode variations */
body.dark-mode .division-link {
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .division-link:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #e5f0ff;
}

body.dark-mode .active-division {
  background: rgba(37, 99, 235, 0.18);
  color: #e5f0ff;
  border-color: #2563eb;
}

/* Convert actions & buttons */
.convert-actions { display:flex; gap:8px; margin-top:4px; }

.cta {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: #2563eb;
  color: #f9fafb;
  transition: transform 0.08s ease-out, box-shadow 0.12s ease-out, background 0.1s ease-out;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.45);
}

.cta:hover { background: #1d4ed8; transform: translateY(-1px); }

.swap-btn {
  flex: 0 0 auto;
  width: 40px;
  padding-inline: 0;
  font-size: 1.1rem;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: none;
}

/* Converter result box */
#convert-result-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

body.dark-mode #convert-result-box { background: rgba(15, 23, 42, 0.95); }

/* Hidden utility */
.hidden { display: none !important; }

/* Small info text under converter */
.info-text { font-size: 0.82rem; color: #6b7280; }
body.dark-mode .info-text { color: #9ca3af; }

/* Divider inside converter */
.divider { border: none; border-top: 1px solid rgba(148, 163, 184, 0.3); margin: 10px 0; }

/* Back button wrapper */
.back-home-wrapper {
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 0 16px;
}

.back-home-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  color: #6b7280;
  background: #f9fafb;
  transition: background 0.12s ease-out, border-color 0.12s ease-out,
              transform 0.08s ease-out, color 0.12s ease-out;
}

.back-home-button:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: #2563eb;
  color: #111827;
  transform: translateY(-1px);
}

body.dark-mode .back-home-button {
  color: #9ca3af;
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.6);
}

body.dark-mode .back-home-button:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #e5e7eb;
}

/* Dark mode: ensure readable lists and headings */
body.dark-mode .info-block h4 { color: #e5e7eb; }
body.dark-mode .info-block p,
body.dark-mode .info-block ul,
body.dark-mode .info-block li { color: #9ca3af !important; }

/* ---------- Responsiveness ---------- */
@media (max-width: 960px) {
  .main-clock { align-items: flex-start; }
  .converter .row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero { padding-inline: 12px; }
  .card { padding: 16px 14px; }
  .main-clock { flex-direction: column; align-items: flex-start; }
  .utc-small { align-self: stretch; justify-content: space-between; }
  .cities { grid-template-columns: 1fr; }
  /* tighten state tiles on narrow screens */
  .sidebar-inner-box { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
}

/* smaller phones */
@media (max-width: 400px) {
  .sidebar-inner-box { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
  .division-link { padding: 8px 8px; font-size: 0.85rem; }
}

/* ---------- Reduced Motion Preference ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
