* {
  box-sizing: border-box;
}

:root {
  --text-main: #1d1d1f;
  --text-soft: #6e6e73;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 255, 255, 0.88);
  --line: rgba(255, 255, 255, 0.45);
  --shadow-big: 0 24px 60px rgba(0, 0, 0, 0.12);
  --shadow-soft: 0 12px 26px rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-2: #2997ff;
  --input-bg: rgba(255, 255, 255, 0.92);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Arial, sans-serif;
  color: var(--text-main);
  transition: background 0.45s ease, color 0.3s ease;
}

body.weather-default {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.85), transparent 30%),
    linear-gradient(180deg, #f4f6fb 0%, #dfeaf8 100%);
}

body.weather-sunny {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.9), transparent 28%),
    linear-gradient(180deg, #fff4cf 0%, #ffd89a 100%);
}

body.weather-cloudy {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.75), transparent 28%),
    linear-gradient(180deg, #e8edf3 0%, #b8c7d8 100%);
}

body.weather-rainy {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 28%),
    linear-gradient(180deg, #7088a3 0%, #3b4d63 100%);
  color: #f5f5f7;
}

body.weather-night {
  background:
    radial-gradient(circle at top left, rgba(95, 132, 255, 0.15), transparent 25%),
    linear-gradient(180deg, #0d1320 0%, #1c2740 100%);
  color: #f5f5f7;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.42;
  z-index: 0;
  animation: floatOrb 14s ease-in-out infinite;
}

.orb-1 {
  width: 280px;
  height: 280px;
  top: 40px;
  left: 40px;
  background: rgba(0, 113, 227, 0.25);
}

.orb-2 {
  width: 360px;
  height: 360px;
  bottom: 40px;
  right: 40px;
  background: rgba(52, 199, 89, 0.18);
  animation-delay: -6s;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px;
}

.weather-card {
  width: 100%;
  max-width: 920px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: 34px;
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: var(--shadow-big);
  animation: appFade 0.7s ease;
  transition: background 0.35s ease, border 0.35s ease, box-shadow 0.35s ease;
}

.top-section {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
}

.top-section h1 {
  margin: 0;
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -2px;
}

.subheadline {
  margin: 14px auto 0;
  max-width: 540px;
  font-size: 20px;
  line-height: 1.4;
  color: var(--text-soft);
}

.search-row {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.search-row input {
  flex: 1;
  height: 64px;
  border: none;
  outline: none;
  border-radius: 22px;
  padding: 0 20px;
  font-size: 17px;
  background: var(--input-bg);
  color: #1d1d1f;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.35s ease, color 0.35s ease;
}

.search-row input:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12), var(--shadow-soft);
}

.search-row button {
  min-width: 160px;
  height: 64px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--blue-2) 0%, var(--blue) 100%);
  color: white;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(0, 113, 227, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.search-row button:hover {
  transform: translateY(-2px) scale(1.01);
}

.message-box {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 59, 48, 0.12);
  color: #b42318;
  font-weight: 600;
  animation: fadeSlide 0.25s ease;
}

.loading-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px;
  border-radius: 20px;
  background: var(--card-strong);
  box-shadow: var(--shadow-soft);
  animation: fadeSlide 0.25s ease;
  transition: background 0.35s ease, color 0.35s ease;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(0, 113, 227, 0.15);
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}

.current-weather {
  background: var(--card-strong);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  animation: fadeSlide 0.35s ease;
  transition: background 0.35s ease, color 0.35s ease;
}

.main-weather {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.location-text {
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-soft);
}

.temperature-text {
  margin: 0;
  font-size: 88px;
  line-height: 0.95;
  letter-spacing: -4px;
}

.description-text {
  margin: 12px 0 0 0;
  font-size: 22px;
  color: var(--text-soft);
  font-weight: 500;
}

.weather-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
}

.weather-emoji {
  font-size: 88px;
  animation: floatEmoji 3.5s ease-in-out infinite;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.detail-card {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.35s ease, color 0.35s ease;
}

.detail-card:hover {
  transform: translateY(-3px);
}

.detail-label {
  display: block;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.detail-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
}

.forecast-section {
  margin-top: 22px;
  animation: fadeSlide 0.35s ease;
}

.section-head {
  margin-bottom: 14px;
}

.section-head h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.8px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.forecast-card {
  background: var(--card-strong);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.35s ease, color 0.35s ease;
}

.forecast-card:hover {
  transform: translateY(-4px);
}

.forecast-day {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
}

.forecast-emoji {
  font-size: 42px;
  margin-bottom: 10px;
}

.forecast-temp {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.forecast-desc {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.4;
}

/* DUNKLE WETTERLAGEN KOMPLETT FIX */
body.weather-rainy .weather-card,
body.weather-night .weather-card {
  background: rgba(22, 28, 38, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.weather-rainy .current-weather,
body.weather-night .current-weather,
body.weather-rainy .forecast-card,
body.weather-night .forecast-card,
body.weather-rainy .loading-box,
body.weather-night .loading-box {
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
}

body.weather-rainy .detail-card,
body.weather-night .detail-card {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
}

body.weather-rainy .top-section h1,
body.weather-night .top-section h1,
body.weather-rainy .section-head h3,
body.weather-night .section-head h3,
body.weather-rainy .temperature-text,
body.weather-night .temperature-text,
body.weather-rainy .forecast-temp,
body.weather-night .forecast-temp,
body.weather-rainy .detail-value,
body.weather-night .detail-value,
body.weather-rainy .forecast-day,
body.weather-night .forecast-day {
  color: #f5f5f7;
}

body.weather-rainy .subheadline,
body.weather-night .subheadline,
body.weather-rainy .location-text,
body.weather-night .location-text,
body.weather-rainy .description-text,
body.weather-night .description-text,
body.weather-rainy .detail-label,
body.weather-night .detail-label,
body.weather-rainy .forecast-desc,
body.weather-night .forecast-desc {
  color: rgba(255, 255, 255, 0.72);
}

body.weather-rainy .search-row input,
body.weather-night .search-row input {
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

body.weather-rainy .search-row input::placeholder,
body.weather-night .search-row input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

body.weather-rainy .message-box,
body.weather-night .message-box {
  background: rgba(255, 69, 58, 0.16);
  color: #ffd7d3;
}

.hidden {
  display: none !important;
}

@keyframes appFade {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatOrb {
  0%, 100% {
    transform: translateY(0px) translateX(0px) scale(1);
  }
  50% {
    transform: translateY(-18px) translateX(12px) scale(1.05);
  }
}

@keyframes floatEmoji {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

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

@media (max-width: 860px) {
  .app-shell {
    padding: 16px;
    align-items: flex-start;
  }

  .weather-card {
    padding: 22px;
    border-radius: 28px;
  }

  .top-section h1 {
    font-size: 42px;
    letter-spacing: -1.6px;
  }

  .subheadline {
    font-size: 18px;
  }

  .search-row,
  .main-weather {
    flex-direction: column;
    align-items: stretch;
  }

  .search-row button {
    width: 100%;
  }

  .temperature-text {
    font-size: 68px;
  }

  .weather-icon-wrap {
    justify-content: flex-start;
  }

  .details-grid,
  .forecast-grid {
    grid-template-columns: 1fr;
  }
}