:root {
  --glass: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.15);
  --text: #ffffff;
  --muted: rgba(255,255,255,0.55);
  --accent: #7dd3fc;
  --accent2: #a78bfa;
}

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

body {
  min-height: 100vh;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  overflow-x: hidden;
  transition: background 1.5s ease;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0c1445 100%);
  position: relative;
}

/* ── Background Orbs ── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.orb1 {
  width: 600px; height: 600px;
  background: rgba(125,211,252,0.12);
  top: -200px; left: -150px;
  animation: driftOrb1 12s ease-in-out infinite;
}
.orb2 {
  width: 500px; height: 500px;
  background: rgba(167,139,250,0.1);
  bottom: -150px; right: -100px;
  animation: driftOrb2 15s ease-in-out infinite;
}
.orb3 {
  width: 300px; height: 300px;
  background: rgba(251,191,36,0.06);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  animation: driftOrb3 10s ease-in-out infinite;
}

@keyframes driftOrb1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(60px,80px) scale(1.1); }
}
@keyframes driftOrb2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-40px,-60px) scale(0.9); }
}
@keyframes driftOrb3 {
  0%,100% { transform: translate(-50%,-50%) scale(1); }
  50% { transform: translate(-50%,-60%) scale(1.2); }
}

/* ── Particles ── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}
@keyframes floatParticle {
  0% { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) translateX(var(--drift)); opacity: 0; }
}

/* ── App Layout ── */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem 4rem;
}

/* ── Header ── */
.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: slideDown 0.8s ease both;
}
.app-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-logo span { color: var(--accent); }

/* ── Search ── */
.search-wrap {
  width: 100%;
  max-width: 520px;
  margin-bottom: 2rem;
  animation: slideDown 0.8s 0.1s ease both;
}
.search-box {
  display: flex;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.4rem 0.4rem 0.4rem 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2),
              inset 0 1px 0 rgba(255,255,255,0.1);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(125,211,252,0.15),
              inset 0 1px 0 rgba(255,255,255,0.1);
}
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
}
.search-box input::placeholder { color: var(--muted); }
.search-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.search-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(125,211,252,0.35);
}
.search-btn:active { transform: scale(0.98); }

.error-msg {
  color: #fca5a5;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.error-msg.show { opacity: 1; }

/* ── Loader ── */
.loader {
  display: none;
  width: 40px; height: 40px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
.loader.show { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Default State ── */
.default-state {
  text-align: center;
  padding: 3rem 1rem;
  animation: fadeIn 0.5s ease both;
}
.default-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  animation: iconFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(125,211,252,0.3));
}
.default-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--muted);
}
.default-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.3);
  margin-top: 0.5rem;
}

/* ── Weather Container ── */
.weather-container {
  width: 100%;
  max-width: 520px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
.weather-container.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ── Main Card ── */
.main-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 2.5rem 2rem 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25),
              inset 0 1px 0 rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
}
.main-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.location-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.location-country {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.local-time { text-align: right; font-size: 0.8rem; color: var(--muted); }
.time-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  display: block;
}
.local-date { font-size: 0.75rem; color: var(--muted); }

.temp-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}
.weather-icon-big {
  font-size: 5rem;
  line-height: 1;
  animation: iconFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(125,211,252,0.4));
}
.temp-flex {
  display: flex;
  align-items: flex-start;
}
.temp-big {
  font-family: 'Outfit', sans-serif;
  font-size: 6rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -4px;
}
.temp-unit {
  font-size: 2rem;
  font-weight: 300;
  color: var(--muted);
  align-self: flex-start;
  margin-top: 1rem;
}
.weather-desc {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 300;
  text-transform: capitalize;
  margin-bottom: 0.3rem;
}
.feels-like { font-size: 0.85rem; color: var(--muted); }
.feels-like span { color: var(--accent); font-weight: 500; }

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 2rem;
}
.stat-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1rem 0.8rem;
  text-align: center;
  transition: all 0.3s ease;
}
.stat-item:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-3px);
  border-color: rgba(125,211,252,0.3);
}
.stat-icon { font-size: 1.3rem; margin-bottom: 0.4rem; display: block; }
.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  display: block;
}
.stat-lbl {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
  display: block;
}

/* ── Mini Cards ── */
.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.mini-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1.3rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15),
              inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}
.mini-card:hover {
  transform: translateY(-4px);
  border-color: rgba(125,211,252,0.25);
}
.mini-card-title {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}
.mini-card-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1;
}
.mini-card-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.sun-rise-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem; }
.sunrise-val { font-size: 1.3rem !important; }

/* ── Sun Bar ── */
.sun-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin: 0.8rem 0;
  overflow: hidden;
}
.sun-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 2px;
  transition: width 1s ease;
}
.sun-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}
.sun-times span { color: var(--text); font-weight: 500; }

/* ── Wind Compass ── */
.wind-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.wind-compass {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  position: relative;
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.compass-needle {
  width: 2px; height: 22px;
  background: linear-gradient(to bottom, var(--accent) 50%, rgba(255,255,255,0.2) 50%);
  border-radius: 2px;
  transform-origin: bottom center;
  position: absolute;
  bottom: 50%;
  transition: transform 1s cubic-bezier(0.4,0,0.2,1);
}
.compass-center {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
}
.pressure-row { margin-top: 0.5rem; }
.pressure-val { color: var(--text); }

/* ── UV Card ── */
.uv-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1.3rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15),
              inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}
.uv-card:hover {
  transform: translateY(-3px);
  border-color: rgba(125,211,252,0.25);
}
.uv-title {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}
.uv-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.uv-val {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
}
.uv-level { font-size: 0.85rem; color: var(--muted); }
.uv-bar-bg {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #22c55e, #eab308, #f97316, #ef4444, #a855f7);
  position: relative;
  margin: 0.5rem 0;
}
.uv-pointer {
  position: absolute;
  top: -4px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: left 1s ease;
}
.uv-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ── Animations ── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes iconFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .temp-big { font-size: 4.5rem; }
  .weather-icon-big { font-size: 3.5rem; }
  .cards-row { grid-template-columns: 1fr; }
  .main-card { padding: 1.8rem 1.4rem 1.5rem; }
}