/* =============================================================================
   Timezone Comparison Page
   ============================================================================= */

body { background: var(--bg-soft); }

/* ── Page header row ── */
.tzc-page { padding: 28px 0 56px; }

.tzc-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.tzc-title-row h1 {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 26px;
  color: var(--fg-1);
  margin: 0;
  letter-spacing: -0.01em;
}

.tzc-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--fg-4);
}

.tzc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Section label ── */
.section-label {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 10px;
}

/* ── Action buttons (pill style) ── */
.tzc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background .12s ease, box-shadow .12s ease, border-color .12s ease, color .12s ease;
  text-decoration: none;
}
.tzc-btn:hover { background: var(--bg-soft); box-shadow: var(--shadow-2); }
.tzc-btn svg { flex-shrink: 0; }

.meeting-btn--active {
  border-color: var(--g-blue);
  background: rgba(66,133,244,0.08);
  color: var(--g-blue);
}
.meeting-btn--active:hover { background: rgba(66,133,244,0.12); }

/* ── Search bar ── */
.tzc-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tzc-search-wrap {
  position: relative;
  width: 320px;
}

.tzc-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s, border-color .15s;
}
.tzc-search-box:focus-within {
  box-shadow: var(--shadow-2);
  border-color: var(--g-blue);
}

.tzc-search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--fg-1);
  width: 100%;
  min-width: 0;
}
.tzc-search-box input::placeholder { color: var(--fg-4); }

.tzc-search-clear {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--fg-4);
  padding: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color .1s;
}
.tzc-search-clear:hover { color: var(--fg-1); }

.tzc-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  z-index: 200;
  overflow: hidden;
  display: none;
}

.zone-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-text);
  transition: background .1s;
}
.zone-search-item:hover:not([disabled]) { background: var(--bg-soft); }
.zone-search-item--added { background: var(--bg-soft); cursor: default; }

.zone-search-emoji {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

.zone-search-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.zone-search-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zone-search-item--added .zone-search-name { color: var(--fg-4); }

.zone-added-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  color: var(--fg-4);
  font-weight: 400;
}

.zone-search-tz { font-size: 11px; color: var(--fg-4); }

.zone-search-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--fg-4);
  text-align: center;
}

/* ── Zone count ── */
#zone-count {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-4);
}

.zone-limit-badge {
  font-size: 12px;
  color: #C5221F;
  background: #FCE8E6;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

/* ── 24h toggle ── */
.tzc-time-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-sunken);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}
.tzc-time-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--fg-3);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tzc-time-toggle-btn.active {
  background: var(--bg);
  color: var(--fg-1);
  box-shadow: var(--shadow-1);
}

/* ── Sections ── */
.tzc-section { margin-bottom: 20px; }
.tzc-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* ── Timeline ── */
.tl-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.tl-grid { width: 100%; }

.tl-row {
  display: grid;
  grid-template-columns: 140px repeat(24, 1fr);
}

.tl-header { background: var(--bg-soft); border-bottom: 1px solid var(--border); }

.tl-header-cell {
  padding: 6px 0;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-4);
  font-family: var(--font-mono);
}

.tl-label-cell {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-header-cell.tl-label-cell {
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-4);
  font-family: var(--font-text);
  text-transform: none;
  letter-spacing: 0;
}

.tl-zone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tl-zone-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-hour-cell {
  border-left: 1px solid var(--border);
}

.tl-legend {
  padding: 6px 12px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.tl-legend-item {
  font-size: 11px;
  color: var(--fg-4);
  display: flex;
  align-items: center;
  gap: 5px;
}

.tl-legend-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* ── Meeting Planner ── */
.mp-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  user-select: none;
}

.mp-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.mp-bar-left { display: flex; align-items: center; gap: 12px; }
.mp-bar-right { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.mp-sel-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-text);
  font-size: 20px;
  font-weight: 500;
  color: var(--fg-2);
}

.mp-sel-dur {
  font-family: var(--font-mono);
  color: var(--g-blue);
  font-weight: 600;
}

.mp-overlap-badge {
  background: #E6F4EA;
  color: #137333;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
}

.mp-no-overlap {
  background: #FCE8E6;
  color: #C5221F;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

.mp-scroll { overflow-x: auto; }
.mp-scroll::-webkit-scrollbar { height: 4px; }
.mp-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.mp-inner { min-width: calc(200px + 24 * 36px); }

.mp-row {
  display: grid;
  grid-template-columns: 200px repeat(24, 36px);
}

.mp-header { background: var(--bg-soft); border-bottom: 1px solid var(--border); }

.mp-header-cell {
  padding: 4px 0 3px;
  text-align: center;
  border-left: 1px solid var(--border);
  position: relative;
}

.mp-half-tick {
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 50%;
  width: 0px;
  background: var(--border);
  pointer-events: none;
}

.mp-info-cell {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.mp-hour-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mp-base-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--g-blue);
  background: rgba(66,133,244,0.1);
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: middle;
}

/* ── Resize handles ── */
.mp-resize-handle {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 6px;
  background: #4285F4;
  border-radius: 3px;
  cursor: ew-resize;
  z-index: 3;
  opacity: 0.85;
  transition: opacity .1s, width .1s;
}
.mp-resize-handle:hover { opacity: 1; width: 7px; }
.mp-resize-left  { left: 1px; }
.mp-resize-right { right: 1px; }

.mp-legend {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.mp-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--fg-4);
}

.mp-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* ── Comparison Table ── */
.ct-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.ct-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ct-scroll::-webkit-scrollbar { height: 6px; }
.ct-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }

.ct-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.ct-table thead th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.ct-table thead th:last-child { border-right: 0; }

.ct-row td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); transition: background .12s; }
.ct-row td:last-child { border-right: 0; }
.ct-row:last-child td { border-bottom: 0; }
.ct-row:hover td { background: var(--bg-soft); }
.ct-row--base td { background: rgba(66,133,244,0.03); }
.ct-row--base:hover td { background: rgba(66,133,244,0.06); }

.ct-cell { padding: 14px 14px; vertical-align: middle; }

.ct-city { border-left-width: 3px; border-left-style: solid; }

.ct-city-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ct-city-name {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 14px;
  color: var(--fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-base-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--g-blue);
  background: rgba(66,133,244,0.1);
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

.ct-zone-id {
  font-size: 11px;
  color: var(--fg-4);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.ct-city-actions { display: flex; gap: 4px; flex-shrink: 0; }

.ct-icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--fg-4);
  transition: background .1s, border-color .1s, color .1s;
}
.ct-icon-btn:hover { background: var(--border); border-color: var(--border-strong); color: var(--fg-1); }

.ct-time { padding: 14px 16px; }

.ct-time-inner { display: flex; align-items: center; gap: 10px; }

.ct-day-icon { font-size: 14px; flex-shrink: 0; }

.ct-time-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg-1);
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.ct-ampm {
  font-size: 13px;
  color: var(--fg-3);
  margin-left: 5px;
  font-weight: 400;
}

.ct-date-val { font-size: 11px; color: var(--fg-4); margin-top: 3px; }

.ct-label-mini {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 2px;
}

.ct-utc-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-1);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.ct-diff-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.ct-diff-ref { font-size: 13px; color: var(--fg-4); font-style: italic; }

.ct-sun-inner { display: flex; align-items: center; gap: 6px; }
.ct-sun-icon { font-size: 13px; }
.ct-sun-val { font-family: var(--font-mono); font-size: 13px; color: var(--fg-2); }

.ct-moon-inner { display: flex; align-items: center; gap: 8px; }
.ct-moon-name { font-size: 13px; color: var(--fg-2); font-weight: 500; }
.ct-moon-pct { font-size: 11px; color: var(--fg-4); }

/* ── Empty state ── */
.tzc-empty {
  text-align: center;
  padding: 80px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--r-xl);
  background: #fff;
}

.tzc-empty-icon { font-size: 48px; margin-bottom: 16px; }

.tzc-empty-title {
  font-family: var(--font-text);
  font-size: 20px;
  font-weight: 500;
  color: var(--fg-1);
  margin-bottom: 8px;
}

.tzc-empty-body { font-size: 14px; color: var(--fg-4); max-width: 380px; margin: 0 auto; }

/* ── Fade in ── */
@keyframes tzc-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tzc-fade { animation: tzc-fade-in .25s ease both; }

/* ── Base zone hint ── */
#base-zone-label {
  font-size: 12px;
  color: var(--fg-4);
}

/* ── Responsive ── */
@media (max-width: 880px) {
  .tzc-title-row { flex-direction: column; align-items: flex-start; }
  .tzc-search-wrap { width: 100%; }
  .tzc-actions { width: 100%; }
}

@media (max-width: 640px) {
  .tzc-page { padding: 16px 0 40px; }
  .tzc-title-row h1 { font-size: 22px; }
}
