:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #22263a;
  --border: #2a2f3f;
  --text: #e8eaf0;
  --text-dim: #8b93a7;
  --accent: #4f8cff;
  --accent-hover: #3a74e0;
  --green: #3ddc84;
  --red: #ff5d5d;
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.85);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
}

.brand h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.status-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.online { background: rgba(61, 220, 132, 0.12); color: var(--green); }
.status-badge.offline { background: rgba(255, 93, 93, 0.12); color: var(--red); }
.status-badge.connecting { background: rgba(255, 200, 80, 0.12); color: #ffc850; }

main { padding: 28px; max-width: 1100px; margin: 0 auto; }

.module-section { margin-bottom: 40px; }

.module-header { margin-bottom: 16px; }
.module-header h2 { font-size: 1.05rem; font-weight: 600; }
.module-header p { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

.devices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.device-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.device-card:active { transform: translateY(0); }

.device-card.loading { opacity: 0.6; pointer-events: none; }

.device-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.device-name { font-size: 1.05rem; font-weight: 600; }
.device-desc { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }
.device-action { margin-top: 16px; font-size: 0.8rem; font-weight: 600; color: var(--accent); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.toast.success { background: rgba(61, 220, 132, 0.15); border: 1px solid var(--green); color: var(--green); }
.toast.error { background: rgba(255, 93, 93, 0.15); border: 1px solid var(--red); color: var(--red); }
.toast.hidden { display: none; }

.empty { color: var(--text-dim); padding: 40px; text-align: center; }

/* ---- Übersicht (Uhrzeit, Wetter) ---- */
.overview {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 36px;
}

.overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

.clock-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.1), var(--bg-card) 60%);
}

.greeting { color: var(--text-dim); font-size: 1rem; }

.clock {
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  margin: 6px 0;
  color: var(--text);
}

.date { color: var(--text-dim); font-size: 0.95rem; }

.weather-card { display: flex; flex-direction: column; gap: 14px; }

.weather-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.weather-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 140, 255, 0.12);
  border-radius: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.weather-temp { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.weather-location { color: var(--text-dim); font-size: 0.85rem; }

.weather-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.weather-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.weather-daily {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.weather-day {
  text-align: center;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.weather-day .day-name { font-size: 0.78rem; color: var(--text-dim); }
.weather-day svg { width: 26px; height: 26px; margin: 6px 0; color: var(--accent); }
.weather-day .day-temps { font-size: 0.8rem; }
.weather-day .day-temps .max { color: var(--text); font-weight: 600; }
.weather-day .day-temps .min { color: var(--text-dim); margin-left: 6px; }

.weather-error { color: var(--text-dim); font-size: 0.9rem; }

@media (max-width: 760px) {
  .overview { grid-template-columns: 1fr; }
  .clock { font-size: 2.6rem; }
}
