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

:root {
  --bg:      #0f2027;
  --bg2:     #203a43;
  --accent:  #ffd166;
  --text:    #fff;
  --text2:   rgba(255,255,255,0.6);
  --text3:   rgba(255,255,255,0.35);
  --glass:   rgba(255,255,255,0.07);
  --border:  rgba(255,255,255,0.1);
  --radius:  18px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg2) 50%, #2c5364 100%);
  min-height: 100vh;
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   Header
═══════════════════════════════════════════════════════════ */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,32,39,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 900px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
#langSelect {
  background: var(--glass); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; font-size: 0.85rem; cursor: pointer;
  outline: none;
}
#langSelect option { background: #1a3040; }

/* ═══════════════════════════════════════════════════════════
   Hero
═══════════════════════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 56px 20px 32px;
  max-width: 700px; margin: 0 auto;
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; margin-bottom: 12px; }
.hero p  { color: var(--text2); font-size: 1rem; line-height: 1.6; margin-bottom: 16px; }
.hero-date { color: var(--accent); font-size: 0.9rem; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   Search
═══════════════════════════════════════════════════════════ */
.search-section {
  max-width: 560px; margin: 0 auto 32px;
  padding: 0 20px;
}
.search-box {
  display: flex; gap: 8px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 16px; padding: 6px 6px 6px 14px;
}
.search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 0.95rem; padding: 6px 0;
}
.search-box input::placeholder { color: var(--text3); }
.search-box button {
  background: var(--accent); color: #1a2f3f;
  border: none; border-radius: 10px;
  padding: 8px 16px; font-size: 1rem; cursor: pointer;
  font-weight: 600; transition: opacity 0.15s;
}
.search-box button:hover { opacity: 0.85; }

.search-results {
  margin-top: 8px; background: #1a3040;
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.search-results.hidden { display: none; }

.search-result-item {
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  display: flex; flex-direction: column; gap: 2px;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(255,255,255,0.06); }
.sri-name { font-weight: 600; font-size: 0.95rem; }
.sri-detail { color: var(--text3); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sri-tz { color: var(--accent); font-size: 0.72rem; }

/* ═══════════════════════════════════════════════════════════
   Cards Grid
═══════════════════════════════════════════════════════════ */
.cards-section { max-width: 900px; margin: 0 auto; padding: 0 20px 48px; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ── City Card ── */
.city-card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}
.city-card:hover { transform: translateY(-2px); }

.card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.card-flag { font-size: 2rem; line-height: 1; }
.card-meta { flex: 1; }
.card-name    { font-size: 1.1rem; font-weight: 700; margin: 0 0 2px; }
.card-country { color: var(--text3); font-size: 0.75rem; }
.card-daylength {
  background: rgba(255,200,60,0.15); border: 1px solid rgba(255,200,60,0.3);
  border-radius: 20px; padding: 3px 10px;
  color: var(--accent); font-size: 0.72rem; font-weight: 600;
}

/* ── Sun Arc SVG ── */
.arc-wrap { margin-bottom: 14px; border-radius: 12px; overflow: hidden; }
.arc-wrap svg { width: 100%; display: block; }

/* ── Time Row ── */
.time-row {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.time-item {
  flex: 1; text-align: center; padding: 8px 4px;
  background: rgba(255,255,255,0.04); border-radius: 10px;
}
.ti-emoji { font-size: 1.3rem; display: block; margin-bottom: 3px; }
.ti-label { display: block; color: var(--text3); font-size: 0.6rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.ti-value { display: block; color: var(--text); font-size: 1.05rem; font-weight: 700; }
.ti-value.small { font-size: 0.85rem; }

/* ── Progress ── */
.prog-section { margin-top: 8px; }
.prog-label {
  display: flex; justify-content: space-between;
  color: var(--text3); font-size: 0.68rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px;
}
.prog-track {
  background: rgba(255,255,255,0.1); border-radius: 10px; height: 8px; overflow: visible;
}
.prog-fill {
  background: linear-gradient(90deg, #f7971e, #ffd200);
  border-radius: 10px; height: 100%; position: relative;
  transition: width 0.5s ease; min-width: 16px;
}
.prog-sun {
  position: absolute; right: -5px; top: 50%; transform: translateY(-50%);
  font-size: 0.85rem; line-height: 1; filter: drop-shadow(0 0 5px rgba(255,200,0,0.8));
}

.card-loading, .card-error {
  text-align: center; padding: 30px; color: var(--text2); font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   Features
═══════════════════════════════════════════════════════════ */
.features {
  max-width: 900px; margin: 0 auto;
  padding: 0 20px 64px;
  text-align: center;
}
.features h2 {
  font-size: 1.6rem; font-weight: 700; margin-bottom: 28px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.feat-card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 18px;
  text-align: center;
}
.feat-icon { font-size: 2.2rem; margin-bottom: 10px; }
.feat-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; color: var(--accent); }
.feat-card p  { color: var(--text2); font-size: 0.82rem; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   Footer
═══════════════════════════════════════════════════════════ */
footer {
  background: rgba(15,32,39,0.9);
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-links { margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.85rem; }
.footer-credit { color: var(--text3); font-size: 0.72rem; }

/* ═══════════════════════════════════════════════════════════
   Modal overlay
═══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #1a3040; border: 1px solid var(--border);
  border-radius: 20px; padding: 28px;
  max-width: 560px; width: 90%;
  max-height: 80vh; overflow-y: auto;
  position: relative;
}
.modal-box h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; color: var(--accent); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 50%; width: 32px; height: 32px;
  color: var(--text); cursor: pointer; font-size: 0.9rem;
}
.modal-body p {
  color: var(--text2); font-size: 0.85rem; line-height: 1.7; margin-bottom: 6px;
}
.modal-body p:empty { height: 10px; margin: 0; }

/* Spinner */
.spinner {
  width: 24px; height: 24px; margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 500px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid    { grid-template-columns: 1fr; }
}
