/* =========================================================
   Wetter Morgen – modernes Glas-Design
   ========================================================= */

:root {
  --bg-1: #dbeafe;
  --bg-2: #e0e7ff;
  --bg-3: #f0f9ff;
  --blob-1: #60a5fa;
  --blob-2: #a78bfa;
  --blob-3: #38bdf8;

  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.7);
  --gloss: rgba(255, 255, 255, 0.65);

  --text: #0f172a;
  --muted: #55637a;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-contrast: #ffffff;

  --shadow-sm: 0 2px 10px rgba(15, 40, 90, 0.07);
  --shadow: 0 10px 34px rgba(15, 40, 90, 0.12);
  --shadow-lg: 0 22px 60px rgba(15, 40, 90, 0.18);

  --radius: 22px;
  --radius-sm: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-1: #070b18;
    --bg-2: #0d1226;
    --bg-3: #0a1020;
    --blob-1: #1d4ed8;
    --blob-2: #6d28d9;
    --blob-3: #0369a1;

    --glass: rgba(24, 32, 54, 0.55);
    --glass-strong: rgba(28, 37, 62, 0.78);
    --glass-border: rgba(255, 255, 255, 0.12);
    --gloss: rgba(255, 255, 255, 0.08);

    --text: #eef2ff;
    --muted: #9dabc7;
    --accent: #60a5fa;
    --accent-2: #a78bfa;
    --accent-soft: rgba(96, 165, 250, 0.14);
    --accent-contrast: #06101f;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui,
    -apple-system, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(1200px 800px at 10% -10%, var(--bg-2), transparent 60%),
    radial-gradient(1000px 700px at 100% 0%, var(--bg-3), transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Weiche, langsam treibende Farbflächen im Hintergrund */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}

body::before {
  width: 46vw;
  height: 46vw;
  top: -12vw;
  left: -10vw;
  background: radial-gradient(circle at 30% 30%, var(--blob-1), transparent 70%);
  animation: drift-a 22s ease-in-out infinite alternate;
}

body::after {
  width: 40vw;
  height: 40vw;
  right: -12vw;
  bottom: -14vw;
  background: radial-gradient(circle at 70% 70%, var(--blob-2), transparent 70%);
  animation: drift-b 26s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 5vh, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-5vw, -4vh, 0) scale(1); }
}

/* ---------- Glas-Grundbaustein ---------- */

.glass,
.weather-card,
.article-card,
.article-detail,
.search-results,
.city-chip,
.daypart,
.fact,
.forecast-day {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

/* Glanzkante oben – erzeugt den „glossy“ Eindruck */
.weather-card,
.article-card,
.article-detail {
  position: relative;
  overflow: hidden;
}

.weather-card::before,
.article-card::before,
.article-detail::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 55%;
  background: linear-gradient(to bottom, var(--gloss), transparent);
  pointer-events: none;
  opacity: 0.9;
}

/* ---------- Kopfzeile ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--glass-strong);
  border-bottom: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
}

.brand-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 3px 8px rgba(37, 99, 235, 0.45));
}

.brand-name {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--accent-soft);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tab-btn:hover { color: var(--text); transform: translateY(-1px); }

.tab-btn.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

/* ---------- Layout ---------- */

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.1rem 4rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.hidden { display: none !important; }

.page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.6rem;
  background: linear-gradient(120deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-intro {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 1.02rem;
}

/* ---------- Suche ---------- */

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

#city-input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#city-input::placeholder { color: var(--muted); }

#city-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-sm);
}

.search-form button {
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.search-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
  filter: brightness(1.06);
}

.search-form button:active { transform: translateY(0); }

#locate-btn {
  background: var(--glass-strong);
  color: var(--text);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

#locate-btn:hover { box-shadow: var(--shadow); }

.search-results {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop-in 0.25s ease both;
}

.search-results li {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-results li:hover { background: var(--accent-soft); }

.status-text {
  color: var(--muted);
  margin: 0.5rem 0;
  min-height: 1.2rem;
  font-size: 0.92rem;
}

/* ---------- Wetterkarte ---------- */

.weather-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  animation: rise 0.5s ease both;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}

.weather-icon {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(37, 99, 235, 0.35));
  animation: float 5s ease-in-out infinite;
}

.weather-temp {
  font-size: clamp(3rem, 9vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(140deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.weather-location {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 0.9rem 0 0;
}

.weather-desc {
  color: var(--muted);
  margin-top: 0.2rem;
  font-size: 0.98rem;
}

.weather-details {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.weather-details span {
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  white-space: nowrap;
}

.weather-updated {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Vorhersage-Leiste ---------- */

.forecast-row {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  margin-top: 1.5rem;
  padding: 1.2rem 0.2rem 0.4rem;
  border-top: 1px solid var(--glass-border);
  scrollbar-width: thin;
}

.forecast-row::-webkit-scrollbar { height: 6px; }
.forecast-row::-webkit-scrollbar-thumb {
  background: var(--accent-soft);
  border-radius: 999px;
}

.forecast-day {
  flex: 0 0 auto;
  width: 82px;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.4rem;
  font-size: 0.82rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.forecast-day:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.fd-name { font-weight: 700; margin-bottom: 0.25rem; }
.fd-icon { font-size: 1.5rem; margin: 0.25rem 0; }
.fd-temp { color: var(--muted); font-size: 0.78rem; }

/* ---------- Artikelliste ---------- */

.articles-list {
  display: grid;
  gap: 0.9rem;
}

.article-card {
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.35rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: rise 0.45s ease both;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.article-card h2,
.article-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.article-summary { color: var(--muted); font-size: 0.9rem; }

.article-date {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.article-now {
  margin-top: 0.55rem;
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
}

/* ---------- Artikeldetail ---------- */

.article-detail {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.8rem 1.6rem;
  animation: rise 0.5s ease both;
}

.article-detail h1 {
  font-size: clamp(1.4rem, 3.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.28;
  margin: 0.55rem 0 0.9rem;
}

.back-btn {
  display: inline-block;
  border: 1px solid var(--glass-border);
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 0.9rem;
  transition: transform 0.15s ease, background 0.2s ease;
}

.back-btn:hover { transform: translateX(-3px); background: var(--accent-soft); }

.update-note {
  font-size: 0.83rem;
  color: var(--muted);
  background: var(--accent-soft);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  margin: 0 0 1.3rem;
  display: inline-block;
}

.article-lead {
  font-size: 1.08rem;
  line-height: 1.65;
  font-weight: 500;
  margin: 0 0 0.4rem;
}

.article-body h2 {
  font-size: 1.06rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  margin: 1.9rem 0 0.6rem;
  padding-left: 0.75rem;
  border-left: 3px solid;
  border-image: linear-gradient(var(--accent), var(--accent-2)) 1;
}

.article-body p {
  margin: 0;
  line-height: 1.75;
  color: var(--muted);
}

.article-cta { margin-top: 2rem; }

.cta-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-soft);
  transition: border-color 0.2s ease;
}

.cta-link:hover { border-color: var(--accent); }

/* ---------- Kennzahlen & Tageszeiten ---------- */

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 0.65rem;
  margin: 1.6rem 0;
}

.fact {
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}

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

.fact-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.fact-value {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.daypart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.65rem;
  margin: 0.9rem 0 1.6rem;
}

.daypart {
  border-radius: var(--radius-sm);
  padding: 0.95rem 0.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.daypart:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.dp-label { font-size: 0.78rem; font-weight: 750; }
.dp-icon { font-size: 1.7rem; margin: 0.35rem 0; line-height: 1; }
.dp-temp { font-size: 1.22rem; font-weight: 800; letter-spacing: -0.02em; }
.dp-desc { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.dp-rain { font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; }

/* ---------- Tags, Städte, Archiv ---------- */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--glass-border);
}

.tag {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
}

.city-links,
.seo-text,
.archive { margin-top: 2.8rem; }

.city-links h2,
.seo-text h2,
.archive h2 {
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  margin-bottom: 0.85rem;
}

.seo-text p {
  line-height: 1.75;
  color: var(--muted);
  margin: 0 0 1rem;
}

.seo-text a { color: var(--accent); font-weight: 600; }

.city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.city-chip {
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.city-chip:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: var(--accent);
}

.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li { margin-bottom: 0.55rem; }

.archive-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.archive-list a:hover { text-decoration: underline; }

/* ---------- Fußzeile ---------- */

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 2rem 1rem 2.5rem;
}

.app-footer a { color: var(--accent); font-weight: 600; }

/* ---------- Animationen ---------- */

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

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  body::before,
  body::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Mobil ---------- */

@media (max-width: 560px) {
  .app-header { padding: 0.7rem 1rem; }
  main { padding: 1.4rem 0.9rem 3rem; }
  .weather-card { padding: 1.5rem 1.1rem 1.2rem; }
  .article-detail { padding: 1.4rem 1.15rem; }
  .search-form { flex-wrap: wrap; }
  #city-input { flex: 1 1 100%; }
  .search-form button { flex: 1; }
}

/* Ältere Browser ohne backdrop-filter bekommen kräftigere Flächen */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass,
  .weather-card,
  .article-card,
  .article-detail,
  .search-results,
  .city-chip,
  .daypart,
  .fact,
  .forecast-day,
  .app-header { background: var(--glass-strong); }
}
