:root {
  --bg: #050810;
  --surface: #0c1220;
  --surface2: #111a2e;
  --border: #1e2d4a;
  --accent: #00e5ff;
  --accent2: #ff6b35;
  --accent3: #7c3aed;
  --text: #e8edf5;
  --text2: #8899b4;
  --gold: #ffd166;
  --green: #06ffa5;
  --red: #ff4060;
  --font-display: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(0,229,255,.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(124,58,237,.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ── HEADER ── */
header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(5,8,16,.95);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  animation: spin 20s linear infinite;
  box-shadow: 0 0 20px rgba(0,229,255,0.4);
}

@keyframes spin { to { transform: rotate(360deg); } }

.logo-text { font-size: 20px; font-weight: 800; color: var(--text); }
.logo-text span { color: var(--accent); }

.back-btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent); /* Text same as border */
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.3s ease, border-color 0.3s ease;
  z-index: 1;
}

.back-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: -1;
}

.back-btn:hover::before {
  transform: scaleX(1);
}

.back-btn:hover {
  color: #0b1f4d; /* Dark blue text */
}

.back-btn:active {
  transform: scale(0.98);
}

/* ── HERO ── */
.hero { padding: 60px 20px; text-align: center; }

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  font-family: var(--font-mono);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.city-flag {
  font-size: 72px;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.4));
}

h1 {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 8px;
}

.sub-title { font-size: 16px; color: var(--text2); margin-bottom: 40px; }

/* ── CLOCK ── */
.clock-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 70px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.clock-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.clock-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.live-time {
  font-family: var(--font-mono);
  font-size: clamp(48px, 8vw, 96px);
  color: var(--accent);
  letter-spacing: -4px;
  font-weight: 700;
  line-height: 1;
}

.live-date {
  font-size: 15px;
  color: var(--text2);
  margin-top: 10px;
  font-family: var(--font-mono);
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #ff4060;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  box-shadow: 0 0 7px #ff4060;
}

.live-dot::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #ff4060;
  animation: livePulse 1.8s ease-out infinite;
}

@keyframes livePulse {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  70% {
    transform: scale(1.8);
    opacity: 0;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* ── INFO GRID ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 40px 0;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
}

.info-card .label {
  font-size: 11px;
  color: var(--text2);
  font-family: var(--font-mono);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.info-card .value { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.info-card .value.mono { font-family: var(--font-mono); font-size: 18px; color: var(--accent); }

/* ── CONVERTER ── */
.converter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin: 40px 0;
}

.converter h2 { font-size: 22px; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.5px; }

.convert-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.tz-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.tz-input label {
  display: block;
  font-size: 11px;
  color: var(--text2);
  font-family: var(--font-mono);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.tz-input input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 20px;
  font-family: var(--font-mono);
  font-weight: 700;
  outline: none;
}

.arrow { font-size: 28px; color: var(--text2); text-align: center; }

.city-flag {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  margin: 0 auto;
}

/* ── FACT LIST ── */
.section-title { font-size: 24px; font-weight: 800; letter-spacing: -1px; margin-bottom: 20px; }

.fact-list { list-style: none; display: grid; gap: 12px; }

.fact-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.fact-list li::before {
  content: '→';
  color: var(--accent);
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── NEARBY GRID ── */
/* ── Grid Layout ──────────────────────────────────────── */
.nearby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

/* ── Card ─────────────────────────────────────────────── */
.nearby-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: inherit;

  display: flex;
  flex-direction: column;
  gap: 6px;

  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  will-change: transform;
}

.nearby-card:hover {
  border-color: rgba(0, 229, 255, .5);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

/* ── Flag (emoji + image support) ─────────────────────── */
.nearby-card .flag {
  width: 28px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 22px;
  line-height: 1;
}

/* image flag support */
.nearby-card .flag img {
  width: 26px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

/* ── City Name ────────────────────────────────────────── */
.nearby-card .nc-city {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

/* ── Time ──────────────────────────────────────────────── */
.nearby-card .nc-time {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
}

/* ── Optional Country Text ─────────────────────────────── */
.nearby-card .nc-country {
  font-size: 11px;
  color: var(--text2);
  opacity: .8;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  margin-top: 60px;
  text-align: center;
  font-size: 12px;
  color: var(--text2);
}

footer a { color: var(--text2); text-decoration: none; margin: 0 12px; }
footer a:hover { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .convert-grid { grid-template-columns: 1fr; }
  .arrow { transform: rotate(90deg); }
  .clock-display { padding: 28px 20px; }
}
