:root {
  --bg-color: #0b1120;
  --card-bg: #1e293b;
  --card-border: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 1000px;
}

/* Hero-Banner mit integriertem Header-Overlay */
.hero-location-banner {
  width: 100%;
  min-height: 180px;
  border-radius: 16px;
  background-image: linear-gradient(to bottom, rgba(11, 17, 32, 0.75), rgba(11, 17, 32, 0.85)), url('https://www.wetter-crostau.de/V2/crk_Sommer.jpg');
  background-size: cover;
  background-position: center;
  border: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  gap: 15px;
}

@media (max-width: 768px) {
  .hero-location-banner {
    flex-direction: column;
    align-items: stretch;
  }
}

.hero-title-area h1 {
  font-size: 1.6rem;
  color: var(--text-main);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.hero-title-area h1 span {
  color: var(--accent);
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  align-items: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .header-right {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
  }
}

.status-badge {
  background: rgba(11, 17, 32, 0.8);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(56, 189, 248, 0.4);
  backdrop-filter: blur(4px);
}

.last-update-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .card { grid-column: span 6; }
}

@media (min-width: 900px) {
  .card { grid-column: span 4; }
}

.card h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.card-inner-layout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.main-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.hero-value {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  transition: color 0.3s ease;
}

.hero-unit {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.card-sub-details {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid var(--card-border);
  padding-top: 6px;
  margin-top: 10px;
}

.card-sub-details span strong {
  color: var(--text-main);
}

/* 2-spaltiges Layout für Rekorde */
.stats-grid-2col {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.stat-group-2col {
  grid-column: span 12;
}

@media (min-width: 768px) {
  .stat-group-2col { grid-column: span 6; }
}

.stat-table {
  width: 100%;
  font-size: 0.9rem;
  border-collapse: collapse;
}

.stat-table tr {
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.stat-table tr:last-child {
  border-bottom: none;
}

.stat-table td {
  padding: 9px 0;
  color: var(--text-muted);
  vertical-align: top;
}

.stat-table td.val {
  text-align: right;
  color: var(--text-main);
  font-weight: 600;
}

.stat-table td.val span {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: normal;
  margin-top: 2px;
}

/* Langzeit Monatswerte Tabelle */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 10px;
}

.longterm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
}

.longterm-table th, .longterm-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.longterm-table th {
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.5);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.longterm-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-main);
}

.longterm-table tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

/* Webcam Banner */
.card-webcam-banner {
  grid-column: span 12;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.webcam-banner-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: transform 0.3s ease;
  background-color: #000;
}

.webcam-banner-img:hover {
  transform: scale(1.005);
}

/* Wind-Anpassungen */
.wind-combined-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.wind-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compass-rose {
  width: 54px;
  height: 54px;
  border: 2px solid var(--card-border);
  border-radius: 50%;
  position: relative;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compass-arrow {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.5s ease-in-out;
}

.compass-arrow::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 14px solid var(--accent);
}

.compass-labels {
  position: absolute;
  width: 100%;
  height: 100%;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: bold;
}

.compass-labels span { position: absolute; }
.c-n { top: 2px; left: 50%; transform: translateX(-50%); color: var(--accent); }
.c-o { right: 3px; top: 50%; transform: translateY(-50%); }
.c-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.c-w { left: 3px; top: 50%; transform: translateY(-50%); }

/* 5-Tage-Vorhersage Grid */
.forecast-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .forecast-container {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

.forecast-day {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forecast-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.forecast-icon {
  font-size: 1.5rem;
  margin: 2px 0;
}

.forecast-temps {
  font-size: 0.85rem;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.forecast-max {
  font-weight: bold;
}

.forecast-details {
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  padding-top: 6px;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.forecast-details div {
  display: flex;
  justify-content: space-between;
}

.forecast-details span strong {
  color: var(--text-main);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(11, 17, 32, 0.9);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  max-width: 95%;
  max-height: 90vh;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.text-modal-content {
  background-color: var(--card-bg);
  color: var(--text-main);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  padding: 30px;
  position: relative;
  line-height: 1.6;
}

.text-modal-content h2 {
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 15px;
}

.text-modal-content h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-top: 20px;
  margin-bottom: 10px;
}

.text-modal-content p, .text-modal-content ul {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.text-modal-content ul {
  padding-left: 20px;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--text-main);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover { color: var(--accent); }

.footer {
  max-width: 1000px;
  width: 100%;
  margin-top: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 15px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.footer-links a:hover {
  text-decoration: underline;
}
/* Langzeit Monatswerte Tabelle mit Original-Farbcodierung */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 10px;
}

.longterm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
}

.longterm-table th, .longterm-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  border-right: 1px solid rgba(51, 65, 85, 0.3);
}

.longterm-table th {
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.8);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.longterm-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.5);
}

.longterm-table tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

/* Farbige Spalten-Hintergründe analog zur Vorlage (mit Darkmode-Optimierung) */
.col-temp-min  { background-color: rgba(99, 102, 241, 0.15); } /* Blau */
.col-temp-max  { background-color: rgba(239, 68, 68, 0.15); }  /* Rot/Rosa */
.col-rain      { background-color: rgba(6, 182, 212, 0.15); }   /* Türkis */
.col-sun       { background-color: rgba(234, 179, 8, 0.15); }   /* Gelb */