/* === whattimeisitin.app — Dark Theme Stylesheet === */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Dark mode (default) — warm charcoal */
  --bg: #111113;
  --bg-card: #1c1c1f;
  --bg-card-day: #1f2228;
  --bg-card-night: #17171a;
  --text: #e8e8ec;
  --text-muted: #8a8a95;
  --accent: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.12);
  --border: rgba(255, 255, 255, 0.06);
  --shadow: rgba(0, 0, 0, 0.5);
  --search-bg: #1c1c1f;
  --overlay: rgba(17, 17, 19, 0.85);

  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;

  /* Spacing */
  --container-max: 1200px;
  --gap: 1rem;
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-card: #f0f0f3;
  --bg-card-day: #ede9fe;
  --bg-card-night: #e8e8ee;
  --text: #1a1a2e;
  --text-muted: #555570;
  --accent: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.1);
  --border: rgba(15, 23, 42, 0.1);
  --shadow: rgba(0, 0, 0, 0.1);
  --search-bg: #f0f0f3;
  --overlay: rgba(250, 250, 250, 0.85);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* --- Header --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gap);
  max-width: var(--container-max);
  margin: 0 auto;
}

.site-logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.site-logo span {
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.hero-city {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.hero-time {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
  min-height: 1.1em;
}

.hero-time .seconds {
  font-weight: 600;
  opacity: 0.4;
  font-size: 1em;
  vertical-align: baseline;
}

.hero-time .ampm {
  font-size: 0.35em;
  font-weight: 500;
  opacity: 0.5;
  margin-left: 0.25em;
  vertical-align: super;
  letter-spacing: 0.02em;
}

.hero-date {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.hero-timezone {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  opacity: 0.7;
}

/* --- Search --- */
.search-wrapper {
  max-width: 560px;
  margin: 1rem auto;
  position: relative;
  z-index: 100;
}

.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--search-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 40px var(--shadow);
  display: none;
  z-index: 200;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.highlighted {
  background: var(--accent-glow);
}

.search-result-city {
  font-weight: 500;
}

.search-result-country {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.search-result-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--accent);
  white-space: nowrap;
}

/* --- Region Tabs --- */
.region-tabs {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.region-tab {
  padding: 0.5rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  background: none;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.region-tab:hover {
  color: var(--text);
}

.region-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* --- World Clock Grid --- */
.world-clock-section {
  padding: 1rem 0 2rem;
  min-height: 400px;
}

.world-clock-section h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.5rem;
  min-height: 340px;
}

/* --- City Card --- */
.city-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}

.city-card:hover {
  background: var(--bg-card-day);
  border-color: var(--accent-glow);
  opacity: 1;
}

.city-card.is-day {
  border-left: 3px solid rgba(250, 204, 21, 0.4);
}

.city-card.is-night {
  border-left: 3px solid rgba(167, 139, 250, 0.3);
}

.city-card-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.city-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.city-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-card-flag {
  font-size: 1.1rem;
  flex-shrink: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}

.city-card-country {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-card-time {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.city-card-time .ampm {
  font-size: 0.5em;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 0.1em;
}

.city-card-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
}

.city-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-card-indicator {
  font-size: 0.8rem;
}

.city-card-day-diff {
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.8;
}

/* --- Filters --- */
.filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.filter-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem var(--gap);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  opacity: 0.6;
  font-size: 0.8rem;
}

/* --- Ad Zone --- */
.ad-zone {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Affiliate Banner --- */
.affiliate-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.affiliate-banner a {
  color: var(--accent);
  white-space: nowrap;
  font-weight: 500;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-time {
    font-size: clamp(3rem, 20vw, 5rem);
  }

  .city-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .city-card {
    padding: 1rem;
  }

  .city-card-time {
    font-size: 1.4rem;
  }

  .search-wrapper {
    margin: 1.5rem auto;
    padding: 0 0.5rem;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .region-tabs {
    gap: 0.15rem;
  }

  .region-tab {
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .city-grid {
    grid-template-columns: 1fr;
  }

  .hero-city {
    font-size: 1.05rem;
  }

  .hero-date {
    font-size: 0.95rem;
  }
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 1rem;
  padding-bottom: 0.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span[aria-hidden] {
  margin: 0 0.4rem;
  opacity: 0.5;
}

/* --- City Info Grid --- */
.city-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.info-card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}

.info-card-content {
  flex: 1;
  min-width: 0;
}

.info-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.info-card-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.info-card-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.info-card.biz-open {
  border-left: 3px solid #22c55e;
}

.info-card.biz-closed {
  border-left: 3px solid #c97373;
}

@media (max-width: 640px) {
  .city-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 400px) {
  .city-info-grid {
    grid-template-columns: 1fr;
  }
}

/* --- DST Countdown --- */
.dst-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 600px;
  margin: 1.5rem auto;
}

.dst-widget-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.dst-widget-text {
  flex: 1;
}

.dst-widget-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.dst-widget-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.dst-widget-days {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* --- Related Cities Section --- */
.related-section {
  padding: 2rem 0 3rem;
}

.related-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

/* --- Content Pages (About, Privacy) --- */
.content-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem var(--gap) 4rem;
}

.content-page h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.content-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.content-page p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.content-page ul {
  color: var(--text-muted);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-page li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.content-page a {
  color: var(--accent);
}

/* --- World Clock Page --- */
.world-clock-page .city-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.world-clock-page .region-group {
  margin-bottom: 2.5rem;
}

.world-clock-page .region-group h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sort-controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sort-btn {
  padding: 0.4rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.sort-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* --- Tools Pages --- */
.tool-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem var(--gap) 4rem;
}

.tool-page h1 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.tool-page .tool-desc {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tool-row:last-child {
  margin-bottom: 0;
}

.tool-row label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 60px;
}

.tool-select {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.tool-select:focus {
  border-color: var(--accent);
}

.tool-input {
  padding: 0.6rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  width: 120px;
  text-align: center;
  transition: border-color 0.2s;
}

.tool-input:focus {
  border-color: var(--accent);
}

.tool-result {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tool-result-time {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.tool-result-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tool-result-diff {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--text);
}

/* --- Meeting Planner --- */
.city-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.city-picker .tool-select {
  flex: 1;
  min-width: 150px;
}

.add-city-btn,
.remove-city-btn {
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.add-city-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.remove-city-btn {
  background: none;
  border-color: var(--border);
  color: var(--text-muted);
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
}

.remove-city-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.timeline-container {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.timeline-table th,
.timeline-table td {
  padding: 0.4rem 0.15rem;
  text-align: center;
  border: 1px solid var(--border);
  white-space: nowrap;
  min-width: 32px;
}

.timeline-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  position: sticky;
  top: 0;
}

.timeline-table th.city-name-col {
  text-align: left;
  padding-left: 0.5rem;
  min-width: 100px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-card);
}

.timeline-table td.city-name-cell {
  text-align: left;
  padding-left: 0.5rem;
  font-weight: 500;
  color: var(--text);
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg);
}

.timeline-table td.hour-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
}

.hour-business {
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
}

.hour-overlap {
  background: rgba(34, 211, 238, 0.3);
  color: var(--text);
  font-weight: 600;
}

.hour-off {
  background: var(--bg);
  color: var(--text-muted);
  opacity: 0.5;
}

.best-window {
  text-align: center;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-weight: 500;
}

/* --- Tools Page Nav --- */
.tools-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tools-nav a {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.2s;
}

.tools-nav a:hover,
.tools-nav a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
  opacity: 1;
}

@media (max-width: 768px) {
  .content-page {
    padding: 2rem var(--gap) 3rem;
  }
  .content-page h1 {
    font-size: 1.5rem;
  }
  .tool-result-time {
    font-size: 2rem;
  }
  .tool-row {
    flex-direction: column;
    align-items: stretch;
  }
  .tool-input {
    width: 100%;
  }
  .timeline-table th,
  .timeline-table td {
    padding: 0.3rem 0.1rem;
    min-width: 28px;
    font-size: 0.7rem;
  }
  .timeline-table td.hour-cell {
    font-size: 0.6rem;
  }
}

/* --- 12h/24h Format Toggle --- */
.format-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  font-size: 0.8rem;
}

.format-toggle button {
  padding: 0.25rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: none;
  color: var(--text-muted);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.format-toggle button.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.format-toggle button:hover:not(.active) {
  color: var(--text);
}

/* --- Copy Time Button --- */
.copy-time-wrapper {
  position: relative;
  display: inline-block;
  margin-top: 0.5rem;
}

.copy-time-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-time-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copy-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.copy-tooltip.show {
  opacity: 1;
}

/* --- Week Number --- */
.hero-week {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  opacity: 0.7;
}

/* --- Midnight Countdown --- */
.midnight-countdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 600px;
  margin: 1rem auto;
}

.midnight-countdown-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.midnight-countdown-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.midnight-countdown-text strong {
  color: var(--text);
  font-family: var(--font-mono);
}

/* --- Weather Card --- */
.city-info-grid.has-weather {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 680px) {
  .city-info-grid.has-weather {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .city-info-grid.has-weather {
    grid-template-columns: 1fr;
  }
}

/* --- City SEO Content --- */
.city-content {
  max-width: 600px;
  margin: 1.5rem auto;
  padding: 0 var(--gap);
}

.city-content p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.city-content a {
  color: var(--accent);
}

/* --- Timezone Page --- */
.tz-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem var(--gap) 4rem;
}

.tz-page h1 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.tz-page .tz-desc {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.tz-hero-time {
  text-align: center;
  font-family: var(--font-mono);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin: 1rem 0;
}

.tz-hero-time .seconds {
  font-weight: 600;
  opacity: 0.4;
}

.tz-hero-time .ampm {
  font-size: 0.35em;
  font-weight: 500;
  opacity: 0.5;
  margin-left: 0.25em;
  vertical-align: super;
}

.tz-meta {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.tz-cities-heading {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent);
}

/* --- Time Difference Page --- */
.timediff-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem var(--gap) 4rem;
}

.timediff-page h1 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.timediff-page .timediff-desc {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.timediff-clocks {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  max-width: 700px;
  margin: 0 auto 2rem;
}

.timediff-clock {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
}

.timediff-clock-city {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timediff-clock-time {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1;
}

.timediff-clock-time .ampm {
  font-size: 0.4em;
  font-weight: 500;
  opacity: 0.5;
  margin-left: 0.15em;
  vertical-align: super;
}

.timediff-clock-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.timediff-separator {
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.timediff-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2rem;
}

.timediff-summary-diff {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.timediff-summary-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .timediff-clocks {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .timediff-separator {
    transform: rotate(90deg);
  }
  .timediff-clock-time {
    font-size: 1.6rem;
  }
}

/* --- Searchable Select --- */
.ss-trigger {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 2.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-trigger:focus,
.ss-trigger[aria-expanded="true"] {
  border-color: var(--accent);
}

.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px var(--shadow);
  z-index: 200;
  overflow: hidden;
}

.ss-search {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
}

.ss-search::placeholder {
  color: var(--text-muted);
}

.ss-list {
  max-height: 240px;
  overflow-y: auto;
}

.ss-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}

.ss-option:last-child {
  border-bottom: none;
}

.ss-option:hover,
.ss-option.ss-highlighted {
  background: var(--accent-glow);
}

.ss-option.ss-selected {
  color: var(--accent);
}

.ss-option-flag {
  flex-shrink: 0;
  font-size: 1.05rem;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.ss-option-name {
  font-weight: 500;
  font-size: 0.92rem;
}

.ss-option-country {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: auto;
  white-space: nowrap;
}

.ss-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Personal Time Difference Badge --- */
.personal-diff {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* --- Time Difference Table --- */
.timediff-table-section {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 var(--gap);
}

.timediff-table-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.timediff-table-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timediff-table-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  gap: 0.6rem;
}

.timediff-table-row:first-child {
  border-top: 1px solid var(--border);
}

.timediff-table-row:hover {
  background: var(--accent-glow);
}

.timediff-table-flag {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.timediff-table-city {
  flex: 1;
  font-weight: 500;
  font-size: 0.92rem;
}

.timediff-table-offset {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* --- Day Length Card --- */
.day-length-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* --- Moon Phase Card --- */
.moon-phase-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* --- Share Button --- */
.share-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Embed Section --- */
.embed-section {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 var(--gap);
}

.embed-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.embed-code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.5;
  position: relative;
}

.embed-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.embed-copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Shared Time Banner --- */
.shared-time-banner {
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
  max-width: 600px;
  margin: 1rem auto;
}

.shared-time-banner-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.shared-time-banner-time {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.shared-time-banner-local {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- ICS Export Button --- */
.ics-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
  margin-top: 1rem;
}

.ics-export-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.ics-export-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
