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

body {
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app {
  width: 100%;
  max-width: 420px;
}

.card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 32px 28px;
  color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Search Area */
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #e0e0e0;
  letter-spacing: -0.5px;
}

.unit-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: all 0.2s;
}

.unit-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.search-box {
  display: flex;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: border 0.2s;
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.4);
}

.search-box input:focus {
  border-color: rgba(99, 179, 237, 0.6);
}

.search-box button {
  padding: 12px 16px;
  background: #3b82f6;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.search-box button:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.error-msg {
  color: #fc8181;
  font-size: 0.85rem;
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
}

/* Weather Info */
.weather-info {
  margin-top: 28px;
}

.location-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.location-row h2 {
  font-size: 1.6rem;
  font-weight: 800;
}

#countryCode {
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #93c5fd;
}

.date {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
}

.main-weather {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.main-weather img {
  width: 90px;
  height: 90px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.temp-block h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.temp-block p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.6);
  text-transform: capitalize;
  margin-top: 4px;
}

/* Details Grid */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.detail-box i {
  color: #60a5fa;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.detail-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.detail-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

/* Loader */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Dynamic Backgrounds */
body.cloudy {
  background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
}

body.rainy {
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

body.sunny {
  background: linear-gradient(135deg, #fceabb 0%, #f8b500 100%);
}
