@font-face {
  font-family: 'Play Extra';
  src: url('fonts/Play-Extra-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

@font-face {
  font-family: 'Neue Haas Grotesk';
  src: url('fonts/NHaasGroteskDSPro-55Rg.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Neue Haas Grotesk';
  src: url('fonts/NHaasGroteskDSPro-65Md.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Neue Haas Grotesk';
  src: url('fonts/NeueHaasGroteskDisplay-75Bold-Web.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

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

:root {
  --bg: #0d0f1a;
  --surface: #151828;
  --surface2: #1c1f35;
  --border: #252840;
  --text: #e8eaf6;
  --text2: #7b809a;
  --accent: #ff6b35;
  --accent-bg: rgba(255,107,53,0.12);
  --font: 'Neue Haas Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-logo: 'Play Extra', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

#app {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ── HEADER ── */
header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.logo {
  font-family: var(--font);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
  color: var(--accent);
}

#now-btn { justify-self: end; }

/* ── SEARCH ── */
.search-wrap {
  position: relative;
  width: 400px;
  max-width: 100%;
}

#search {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 9px 14px 9px 36px;
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--font);
}
#search::placeholder { color: var(--text2); }
#search:focus { border-color: var(--accent); }

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text2);
  pointer-events: none;
}

#dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  z-index: 200;
  display: none;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
#dropdown.open { display: block; }

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.result-item:hover, .result-item.active { background: var(--surface2); }
.result-left { display: flex; flex-direction: column; gap: 2px; }
.result-city { font-size: 14px; font-weight: 500; }
.result-region { font-size: 12px; color: var(--text2); }
.result-time { font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; }
.no-results { padding: 14px; font-size: 13px; color: var(--text2); text-align: center; }

/* ── NOW BUTTON ── */
#now-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  font-family: var(--font);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
#now-btn:hover { border-color: var(--accent); color: var(--accent); }
#now-btn.live { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }

/* ── TIMEZONE LIST ── */
#tz-list { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }

/* ── ROW ── */
.tz-row {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, opacity 0.2s;
  min-height: 88px;
  position: relative;
}
.tz-row:hover { border-color: #2e3158; }
.tz-row.dragging { opacity: 0.35; }
.tz-row.drag-over { border-color: var(--accent) !important; border-style: dashed; }

/* ── DRAG HANDLE ── */
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  flex-shrink: 0;
  cursor: grab;
  color: var(--border);
  font-size: 14px;
  transition: color 0.15s;
  user-select: none;
}
.drag-handle:hover { color: var(--text2); }
.drag-handle:active { cursor: grabbing; }

/* ── INFO PANEL ── */
.tz-info {
  width: 210px;
  min-width: 210px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
  user-select: none;
  flex-shrink: 0;
}
.tz-city { font-size: 15px; font-weight: 500; line-height: 1.2; }
.tz-region { font-size: 11px; color: var(--text2); margin-top: 2px; }
.tz-time {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.5px;
  margin-top: 6px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tz-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.tz-date { font-size: 11px; color: var(--text2); }
.tz-offset {
  font-size: 10px;
  color: var(--text2);
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── TIMELINE ── */
.tz-timeline-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
  cursor: ew-resize;
  overflow: hidden;
}

.tl-labels {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 18px;
  pointer-events: none;
  z-index: 2;
}
.tl-label {
  position: absolute;
  font-size: 9px;
  color: var(--text2);
  transform: translateX(-50%);
  top: 5px;
  white-space: nowrap;
}

.tl-bg {
  position: absolute;
  top: 18px; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to right,
    #07101f 0%,
    #07101f 22.9%,
    #0d2245 29.2%,
    #122d6a 37.5%,
    #1a3d8f 41.7%,
    #1a3d8f 62.5%,
    #122d6a 66.7%,
    #0d2245 72.9%,
    #07101f 79.2%,
    #07101f 100%
  );
}

/* hour ticks */
.tl-tick {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}
.tl-tick.major { background: rgba(255,255,255,0.08); }

/* cursor */
.tl-cursor {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255,107,53,0.5);
}
.tl-cursor::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
}
.tl-cursor-label {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: rgba(13,15,26,0.7);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── REMOVE BUTTON ── */
.remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.remove-btn:hover { color: #ff4444; background: rgba(255,68,68,0.08); }

/* ── EMPTY STATE ── */
#empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--text2);
  display: none;
}
#empty h3 { font-size: 18px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
#empty p { font-size: 14px; }

@media (max-width: 600px) {
  .tz-info { width: 160px; min-width: 160px; }
  .tz-time { font-size: 20px; }
}
