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

:root {
  --bg: #0a0a0f;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --text: #f0f0f5;
  --text-muted: #8888a0;
  --accent: #7c6ff7;
  --accent2: #f05fa0;
  --accent3: #29d9c2;
  --radius: 20px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Background orbs ===== */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: float 18s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: var(--accent);  top: -150px; left: -150px; animation-delay: 0s; }
.orb-2 { width: 500px; height: 500px; background: var(--accent2); bottom: -100px; right: -100px; animation-delay: -6s; }
.orb-3 { width: 400px; height: 400px; background: var(--accent3); top: 40%; left: 45%; animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-40px) scale(1.05); }
}

/* ===== Header ===== */
header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: rgba(10,10,15,0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.5px; }
nav { display: flex; gap: 28px; }
nav a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
nav a:hover { color: var(--text); }

/* ===== Main ===== */
main {
  position: relative; z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  display: flex; flex-direction: column; gap: 32px;
}

/* ===== Hero ===== */
.hero { text-align: center; padding: 20px 0 10px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 700; line-height: 1.1; letter-spacing: -1.5px; }
.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { margin-top: 14px; color: var(--text-muted); font-size: 1.1rem; }

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s;
}
.card:hover { border-color: rgba(255,255,255,0.14); }

/* ===== Converter card ===== */
.converter-card { }
.converter-grid {
  display: grid;
  grid-template-columns: 1fr 56px 1fr;
  align-items: center;
  gap: 20px;
}

.tz-panel { display: flex; flex-direction: column; gap: 12px; }
.panel-label {
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 2px; color: var(--text-muted);
}

.tz-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  transition: border-color 0.2s, background-color 0.2s;
}
.tz-select:hover { border-color: rgba(255,255,255,0.2); background-color: rgba(255,255,255,0.07); }
.tz-select:focus { outline: none; border-color: var(--accent); }
.tz-select option { background: #1a1a2e; }

.time-display { display: flex; flex-direction: column; gap: 8px; }

.time-input, .date-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}
.time-input { font-size: 2rem; font-weight: 600; padding: 10px 16px; width: 100%; letter-spacing: -0.5px; }
.date-input { font-size: 0.9rem; padding: 8px 16px; width: 100%; color: var(--text-muted); }
.time-input:focus, .date-input:focus { outline: none; border-color: var(--accent); }

.converted-time {
  font-size: 2rem; font-weight: 600; letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  padding: 10px 0 2px;
  min-height: 60px; display: flex; align-items: center;
}
.converted-date { font-size: 0.9rem; color: var(--text-muted); padding: 8px 0; }

.tz-info { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; min-height: 36px; }

/* ===== Swap button ===== */
.swap-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  transition: all 0.2s;
}
.swap-btn svg { width: 20px; height: 20px; }
.swap-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(124,111,247,0.1); transform: rotate(180deg); }

/* ===== Offset banner ===== */
.offset-banner {
  margin-top: 28px;
  padding: 14px 20px;
  background: rgba(124,111,247,0.08);
  border: 1px solid rgba(124,111,247,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
}

/* ===== Section title ===== */
.section-title {
  font-size: 1.1rem; font-weight: 600;
  margin-bottom: 24px;
  color: var(--text);
}

/* ===== Quick reference grid ===== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.quick-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.quick-item:hover { border-color: var(--accent); background: rgba(124,111,247,0.08); }
.quick-item .q-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.quick-item .q-offset { font-size: 1rem; font-weight: 600; }
.quick-item .q-cities { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* ===== World clock ===== */
.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.clock-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  transition: all 0.2s;
}
.clock-card:hover { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.05); }
.clock-city { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.clock-time { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.5px; }
.clock-date { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.live-note { margin-top: 20px; font-size: 0.8rem; color: var(--text-muted); text-align: center; }

/* ===== Footer ===== */
footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  header { padding: 14px 20px; }
  main { padding: 40px 16px 60px; }
  .card { padding: 24px 20px; }
  .converter-grid { grid-template-columns: 1fr; }
  .swap-btn { transform: rotate(90deg); }
  .swap-btn:hover { transform: rotate(270deg); }
  .time-input, .converted-time { font-size: 1.6rem; }
}
