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

:root {
  --bg:        #0b0f1a;
  --bg2:       #111827;
  --card:      #161d2e;
  --card-hover:#1e2840;
  --border:    #1f2d4a;
  --accent:    #4f8ef7;
  --accent2:   #7c5cf6;
  --green:     #10d68e;
  --yellow:    #f5c842;
  --red:       #e74c3c;
  --text:      #e8eaf0;
  --muted:     #6b7a99;
  --font:      'Inter', sans-serif;
  --mono:      'Orbitron', monospace;
}

html { scroll-behavior: smooth; }

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

/* ===========================
   HEADER
=========================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 26, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  color: var(--accent);
}
.logo i { font-size: 1.5rem; }
.logo span { color: var(--text); font-weight: 300; }
.logo strong { color: var(--accent); font-weight: 700; }

.local-time {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.local-time i { color: var(--accent); }
#localClock {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--green);
  letter-spacing: 2px;
}

/* ===========================
   HERO
=========================== */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(79,142,247,0.12) 0%, transparent 70%);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.search-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 12px 24px;
  width: min(480px, 90%);
  transition: border-color 0.3s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar i { color: var(--muted); }
.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  width: 100%;
}
.search-bar input::placeholder { color: var(--muted); }

/* ===========================
   FILTERS
=========================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 1rem 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 50px;
  padding: 8px 20px;
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ===========================
   GRID
=========================== */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0 2rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===========================
   CLOCK CARD
=========================== */
.clock-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  cursor: default;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.4s ease both;
}

.clock-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
}
.clock-card.day::before   { background: linear-gradient(90deg, var(--yellow), #f39c12); }
.clock-card.night::before { background: linear-gradient(90deg, var(--accent2), #2c3e77); }
.clock-card.dawn::before  { background: linear-gradient(90deg, #e67e22, #e74c3c); }
.clock-card.dusk::before  { background: linear-gradient(90deg, #8e44ad, #e74c3c); }

.clock-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(79,142,247,0.12);
  border-color: rgba(79,142,247,0.4);
  background: var(--card-hover);
}

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

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

.flag { font-size: 1.8rem; line-height: 1; }

.city-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.country-name {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1px;
}

.time-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.time-badge.day   { background: rgba(245,200,66,0.15); color: var(--yellow); }
.time-badge.night { background: rgba(124,92,246,0.15); color: var(--accent2); }
.time-badge.dawn  { background: rgba(230,126,34,0.15);  color: #e67e22; }
.time-badge.dusk  { background: rgba(142,68,173,0.15);  color: #8e44ad; }

/* Analog clock */
.analog-clock {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--border);
  position: relative;
  margin: 0 auto 1.2rem;
  background: radial-gradient(circle at 30% 30%, #1e2840, #0d1120);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.4), 0 0 20px rgba(79,142,247,0.06);
}

/* Tick marks */
.analog-clock::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dotted rgba(255,255,255,0.06);
}

.center-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  z-index: 5;
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 3px;
}
.hour-hand {
  width: 3px; height: 26px;
  margin-left: -1.5px;
  background: var(--text);
}
.minute-hand {
  width: 2px; height: 34px;
  margin-left: -1px;
  background: var(--accent);
}
.second-hand {
  width: 1.5px; height: 38px;
  margin-left: -0.75px;
  background: var(--red);
}

.digital-time {
  text-align: center;
  font-family: var(--mono);
  font-size: 1.6rem;
  letter-spacing: 3px;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.date-str {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.offset-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}
.offset-info span.diff { color: var(--accent); font-weight: 500; }

/* No results */
.no-results {
  grid-column: 1/-1;
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 4rem 0;
}
.no-results i { font-size: 3rem; margin-bottom: 1rem; display: block; }

/* ===========================
   FOOTER
=========================== */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ===========================
   ANIMATIONS
=========================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 600px) {
  .header-content { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
  .hero { padding: 3rem 1rem 2rem; }
  .grid-container { grid-template-columns: 1fr; padding: 0 1rem 3rem; }
  .filters { padding: 0.5rem 1rem 1.5rem; }
}
