/**
 * TimeAny.com - Professional Clean Custom CSS
 * Handcrafted pure CSS3 - Zero external frameworks
 */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --accent-green: #10b981;
  --accent-green-bg: #ecfdf5;
  --accent-amber: #f59e0b;
  --accent-amber-bg: #fffbeb;
  --accent-purple: #8b5cf6;
  --accent-red: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e293b;
  --primary-border: #1e3a8a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --bg-body: #090d16;
  --bg-card: #131b2e;
  --bg-input: #0f172a;
  --border-color: #1e293b;
  --border-focus: #60a5fa;
  --accent-green-bg: #064e3b;
  --accent-amber-bg: #78350f;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  gap: 1rem;
  flex-wrap: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2.2;
}

.brand-text span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.25rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

[data-theme="dark"] .nav-link {
  color: #e2e8f0;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Expandable Icon-Only Search */
.search-wrapper {
  position: relative;
}

.search-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.search-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.search-box-expandable {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  z-index: 60;
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  align-items: center;
  padding: 2px 8px 2px 34px;
}

.search-wrapper.is-open .search-box-expandable {
  display: flex;
}

.search-wrapper.is-open .search-toggle-btn {
  display: none;
}

.search-icon-inside {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.search-box-expandable .search-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.45rem 0.25rem;
  font-size: 0.875rem;
  color: var(--text-main);
  outline: none;
}

.search-close-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.search-close-btn:hover {
  color: var(--text-main);
}

.search-box-expandable .search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.875rem;
}

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

.search-result-item:hover {
  background-color: var(--primary-light);
  text-decoration: none;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

/* Hero Section */
.hero {
  padding: 2.75rem 0 2rem 0;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-body) 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero-content {
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Cleanly Separated UTC Showcase Card */
.utc-showcase-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  background: var(--bg-card);
  padding: 1.25rem 2.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  text-align: left;
  max-width: 100%;
}

.utc-analog-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.analog-dial-wrap {
  width: 82px;
  height: 82px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.utc-analog-svg {
  width: 82px;
  height: 82px;
  display: block;
}

.clock-type-tag {
  font-size: 0.685rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.utc-divider {
  width: 1px;
  height: 80px;
  background: var(--border-color);
  flex-shrink: 0;
}

.utc-digital-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.utc-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.utc-badge-live {
  font-size: 0.7rem;
  font-weight: 700;
  color: #10b981;
  background: var(--accent-green-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  letter-spacing: 0.04em;
}

.utc-zone-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.utc-digital-main {
  margin: 0.1rem 0 0.35rem 0;
}

.utc-time-display {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 2.15rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.utc-time-display .seconds {
  font-size: 1.35rem;
  color: var(--text-muted);
}

.utc-sub-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.utc-date-display {
  font-size: 0.885rem;
  font-weight: 500;
  color: var(--text-muted);
}

.utc-offset-pill {
  font-size: 0.725rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .utc-showcase-card {
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    gap: 1.25rem;
    text-align: center;
  }
  .utc-divider {
    width: 80%;
    height: 1px;
  }
  .utc-meta-row, .utc-sub-row {
    justify-content: center;
  }
  .utc-time-display {
    font-size: 1.85rem;
  }
}

/* Cards & Grids */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  border-color: var(--primary-border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* World Clock Grid Cards */
.city-clock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.city-clock-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  text-decoration: none;
}

.clock-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.city-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.city-info .country-name {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.period-badge {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  text-transform: uppercase;
}

.badge-day {
  background: #fef3c7;
  color: #92400e;
}

.badge-night {
  background: #1e293b;
  color: #93c5fd;
}

.badge-work {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.clock-display {
  margin: 0.5rem 0;
}

.clock-time-digital {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.1;
}

.clock-time-digital .seconds {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.clock-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.clock-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Interactive Time Converter Utility */
.converter-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.25rem 1rem;
  margin: 1.5rem 0;
}

.converter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.form-control {
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--border-focus);
}

/* 24-Hour Comparison Grid & Converter Toolbar */
.tc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.tc-quick-jumps {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  scrollbar-width: none;
}

.tc-quick-jumps::-webkit-scrollbar {
  display: none;
}

.tc-quick-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.25rem;
  white-space: nowrap;
}

.tc-jump-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tc-jump-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.tc-jump-btn.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.tc-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-body);
}

.tc-view-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tc-view-btn.is-active {
  background: var(--primary);
  color: #ffffff;
}

/* Selected Time Header & Swipe Hint */
.tc-selected-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tc-selected-banner-text {
  font-size: 0.875rem;
  color: var(--text-main);
}

.tc-selected-banner-text strong {
  color: var(--primary);
  font-weight: 700;
}

.tc-swipe-hint {
  display: none;
  font-size: 0.725rem;
  color: var(--text-muted);
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.tc-swipe-hint svg {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  flex-shrink: 0;
  stroke: var(--text-muted);
  display: inline-block;
  vertical-align: middle;
}

.timeline-board {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.5rem;
  padding-bottom: 0.5rem;
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--border-color);
  touch-action: pan-x pan-y;
}

.timeline-board::-webkit-scrollbar {
  height: 6px;
}

.timeline-board::-webkit-scrollbar-track {
  background: var(--bg-body);
  border-radius: 3px;
}

.timeline-board::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.timeline-board::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.timeline-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.timeline-zone-info {
  width: 175px;
  min-width: 175px;
  max-width: 175px;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  position: sticky;
  left: 0;
  z-index: 5;
  box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.timeline-zone-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-zone-sub {
  font-size: 0.725rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.timeline-hours-wrap {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: stretch;
}

.timeline-hour-col {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  height: auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 1px 3px 1px;
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s ease, box-shadow 0.1s ease;
  position: relative;
  box-sizing: border-box;
  text-align: center;
}

.timeline-hour-col .hour-val {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 700;
  line-height: 1.1;
  display: block;
}

.timeline-hour-col .hour-ampm {
  font-family: var(--font-sans);
  font-size: 0.575rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  opacity: 0.85;
  display: block;
}

.timeline-hour-col:last-child {
  border-right: none;
}

.timeline-hour-col:hover {
  filter: brightness(0.95);
}

.hour-business {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}

[data-theme="dark"] .hour-business {
  background: #064e3b;
  color: #a7f3d0;
}

.hour-morning {
  background: #fef9c3;
  color: #854d0e;
}

[data-theme="dark"] .hour-morning {
  background: #451a03;
  color: #fde68a;
}

.hour-evening {
  background: #ffedd5;
  color: #9a3412;
}

[data-theme="dark"] .hour-evening {
  background: #431407;
  color: #fed7aa;
}

.hour-night {
  background: #f1f5f9;
  color: #64748b;
}

[data-theme="dark"] .hour-night {
  background: #0f172a;
  color: #475569;
}

.timeline-hour-col.is-active-col {
  box-shadow: inset 0 0 0 2px var(--primary);
  font-weight: 800;
}

.timeline-hour-col.is-active-col::after {
  content: '';
  position: absolute;
  top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

/* Legend bar */
.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* Converted Table & Summary Cards */
.tc-summary-wrap {
  margin-top: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
}

.tc-summary-header {
  padding: 0.75rem 1rem;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.tc-table-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: normal;
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.tc-summary-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  min-width: 580px;
}

.tc-summary-table th {
  background: var(--bg-body);
  padding: 0.65rem 0.85rem;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.tc-summary-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.tc-summary-table .col-city {
  min-width: 140px;
}

.tc-summary-table .col-time {
  min-width: 115px;
  white-space: nowrap;
}

.tc-summary-table .col-day {
  min-width: 95px;
  white-space: nowrap !important;
  text-align: center;
}

.tc-summary-table .col-day *,
.tc-summary-table .col-day .period-badge {
  white-space: nowrap !important;
  display: inline-block;
}

.tc-summary-table .col-offset {
  min-width: 85px;
  white-space: nowrap;
  text-align: center;
}

.tc-summary-table .col-period {
  min-width: 95px;
  white-space: nowrap;
  text-align: center;
}

.tc-summary-table .col-action {
  width: 48px;
  min-width: 48px;
  text-align: center;
  white-space: nowrap;
}

.tc-summary-table tr:last-child td {
  border-bottom: none;
}

.tc-summary-table tr:hover td {
  background: var(--primary-light);
}

/* Day Shift Badges */
.badge-same-day {
  background: var(--bg-body);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  white-space: nowrap !important;
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.725rem;
  font-weight: 600;
  border-radius: 12px;
}

.badge-day-ahead {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
  white-space: nowrap !important;
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.725rem;
  font-weight: 700;
  border-radius: 12px;
}

.badge-day-behind {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
  white-space: nowrap !important;
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.725rem;
  font-weight: 700;
  border-radius: 12px;
}

[data-theme="dark"] .badge-same-day {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

[data-theme="dark"] .badge-day-ahead {
  background: #2e1065;
  color: #c4b5fd;
  border-color: #4c1d95;
}

[data-theme="dark"] .badge-day-behind {
  background: #431407;
  color: #fdba74;
  border-color: #7c2d12;
}

/* Section Headings */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Detailed City Page Clocks */
.city-hero {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 2.5rem 0;
}

.city-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.big-digital-time {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.big-digital-time .ampm {
  font-size: 1.5rem;
  color: var(--primary);
  margin-left: 0.35rem;
}

.city-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.75rem;
}

.stat-box {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.stat-box .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.stat-box .stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.2rem;
}

/* SVG Analog Clock */
.analog-clock-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.analog-clock-svg {
  width: 140px;
  height: 140px;
}

/* SEO Content & Article Sections */
.content-section {
  padding: 3rem 0;
}

.rich-content {
  color: var(--text-main);
  font-size: 1.025rem;
  line-height: 1.75;
}

.rich-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem 0;
  color: var(--text-main);
}

.rich-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem 0;
}

.rich-content p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.rich-content ul, .rich-content ol {
  margin: 0.5rem 0 1.25rem 1.5rem;
  color: var(--text-muted);
}

.rich-content li {
  margin-bottom: 0.4rem;
}

/* Popular Pairs Grid */
.pair-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.15s ease;
  text-decoration: none;
}

.pair-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.pair-codes {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pair-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.pair-arrow {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.15rem;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.styled-table th {
  background: var(--bg-body);
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.styled-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.styled-table tr:last-child td {
  border-bottom: none;
}

.styled-table tr:hover td {
  background-color: var(--primary-light);
}

/* Year Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.calendar-month-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.month-name {
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.month-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.8rem;
}

.month-table th {
  padding: 0.35rem 0;
  color: var(--text-muted);
  font-weight: 600;
}

.month-table td {
  padding: 0.35rem 0;
  color: var(--text-main);
}

.month-table td.weekend {
  color: var(--accent-red);
}

.month-table td.today {
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  font-weight: 700;
}

/* Forms & Calculators */
.calc-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.tz-form-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 1rem;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .tz-form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .tz-form-grid #swap-tz-btn {
    align-self: center;
    width: 60px;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.calc-result-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.calc-result-highlight {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs .separator {
  color: var(--text-light);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.825rem;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 992px) {
  .header-inner {
    height: 3.75rem;
  }
  .nav-links {
    display: none;
  }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }
  .mobile-menu-btn {
    display: block;
  }
  .search-box-expandable {
    width: 260px;
    max-width: calc(100vw - 40px);
  }
}

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  .city-hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .city-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .calendar-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.95rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }

  /* Interactive Converter Utility Responsiveness */
  .converter-container {
    padding: 1.15rem 0.85rem;
    margin: 1.25rem 0;
    border-radius: var(--radius-md);
  }
  .converter-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }
  .control-group {
    width: 100%;
    gap: 0.5rem;
  }
  .control-group input[type="date"],
  .control-group select {
    flex: 1 1 140px;
    min-width: 0;
    max-width: 100% !important;
  }
  .control-group .btn {
    flex: 0 0 auto;
  }
  .tc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .tc-quick-jumps {
    width: 100%;
  }
  .tc-view-toggle {
    width: 100%;
    display: flex;
  }
  .tc-view-btn {
    flex: 1;
    justify-content: center;
    padding: 0.5rem 0.75rem;
  }
  .tc-selected-banner {
    padding: 0.6rem 0.75rem;
    font-size: 0.825rem;
  }
  .tc-swipe-hint {
    display: inline-flex;
  }
  .timeline-board {
    margin-top: 0.35rem;
  }
  .timeline-row {
    width: max-content;
    min-width: 100%;
    margin-bottom: 0.5rem;
  }
  .timeline-zone-info {
    width: 125px;
    min-width: 125px;
    max-width: 125px;
    padding: 0.5rem 0.6rem;
  }
  .timeline-zone-name {
    font-size: 0.825rem;
    line-height: 1.2;
  }
  .timeline-zone-sub {
    font-size: 0.7rem;
    line-height: 1.3;
    margin-top: 0.15rem;
  }
  .btn-remove-zone {
    font-size: 1.15rem;
    padding: 0 0.2rem;
  }
  .timeline-hours-wrap {
    flex: none;
  }
  .timeline-hour-col {
    flex: none;
    min-width: 33px;
    min-height: 44px;
    height: auto;
    align-self: stretch;
    padding: 4px 1px 2px 1px;
    gap: 1px;
  }
  .timeline-hour-col .hour-val {
    font-size: 0.775rem;
  }
  .timeline-hour-col .hour-ampm {
    font-size: 0.55rem;
    letter-spacing: 0.1px;
  }
  .timeline-legend {
    gap: 0.6rem 1rem;
    font-size: 0.75rem;
  }
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .styled-table {
    min-width: 520px;
    font-size: 0.825rem;
  }
  .styled-table th, .styled-table td {
    padding: 0.55rem 0.75rem;
  }
  .tc-summary-table {
    min-width: 580px;
  }
  .tc-summary-table th, .tc-summary-table td {
    padding: 0.55rem 0.65rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .converter-container {
    padding: 0.85rem 0.5rem;
    margin: 1rem 0;
  }
  .timeline-zone-info {
    width: 105px;
    min-width: 105px;
    max-width: 105px;
    padding: 0.4rem 0.45rem;
  }
  .timeline-zone-name {
    font-size: 0.78rem;
  }
  .timeline-zone-sub {
    font-size: 0.68rem;
  }
  .timeline-hour-col {
    flex: none;
    min-width: 30px;
    min-height: 40px;
    height: auto;
    align-self: stretch;
    padding: 3px 1px 2px 1px;
    gap: 1px;
  }
  .timeline-hour-col .hour-val {
    font-size: 0.725rem;
  }
  .timeline-hour-col .hour-ampm {
    font-size: 0.5rem;
    letter-spacing: 0;
  }
  .tc-jump-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
  }
  .tc-quick-label {
    font-size: 0.75rem;
  }
  .tc-selected-banner {
    font-size: 0.78rem;
    padding: 0.5rem 0.65rem;
  }
  .section-title {
    font-size: 1.4rem;
  }
  .section-subtitle {
    font-size: 0.85rem;
  }
  .tc-summary-table {
    min-width: 550px;
  }
  .tc-summary-table th, .tc-summary-table td {
    padding: 0.5rem 0.55rem;
    font-size: 0.775rem;
  }
  .tc-table-hint {
    display: inline-flex !important;
  }
}

/* Print CSS */
@media print {
  .site-header, .site-footer, .btn, .converter-controls, .theme-toggle-btn {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .card, .calendar-month-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

