/* -----------------------------------
   Custom Font (WOFF2)
----------------------------------- */
@font-face {
  font-family: "Soleil-Lt";
  src: url("../files/Soleil-Lt.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* -----------------------------------
   CSS Variables für Dark/Light Mode
----------------------------------- */
:root {
  --bg-body: #f5f5f5;
  --bg-card: #ffffff;
  --text-primary: #333333;
  --text-secondary: #696969;
  --text-header: #696969;
  --border-color: #ddd;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
  --bg-body: #1a1a1a;
  --bg-card: #2d2d2d;
  --text-primary: #e0e0e0d5;
  --text-secondary: #b0b0b098;
  --text-header: #ffffff;
  --border-color: #404040;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(0, 0, 0, 0.4);
}

/* -----------------------------------
   Base
----------------------------------- */
body {
  font-family: "Soleil-Lt", system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--text-secondary);
  margin: 2rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* -----------------------------------
   Theme Toggle Switch (im Footer)
----------------------------------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.footer-left {
  flex: 1;
}

.footer-right {
  display: flex;
  align-items: center;
}

.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
}

.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2e90fa;
}

input:checked + .slider:before {
  transform: translateX(30px);
}

.theme-icon {
  font-size: 18px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.theme-icon:first-child {
  color: #f7ba0f; /* Sonne - Gelb */
}

.theme-icon:last-child {
  color: #2e90fa; /* Mond - Blau */
}

/* -----------------------------------
   Header
----------------------------------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 1.8rem;
  margin: 0;
  color: var(--text-header);
}

.logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

/* -----------------------------------
   Cards
----------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 2px 6px var(--shadow);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.card h2 {
  color: var(--text-primary);
}

/* -----------------------------------
   Values + Units
----------------------------------- */
.value-verbrauch {
  color: #2e90fa;
  font-size: 25px;
  font-weight: 700;
}

.value-leistung {
  color: #f7ba0f;
  font-size: 25px;
  font-weight: 700;
}

.label {
  color: var(--text-secondary);
}

/* -----------------------------------
   Data Items
----------------------------------- */
.data-item {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.data-item:hover {
  box-shadow: 0 2px 8px var(--shadow-hover);
  transform: translateY(-2px);
}

/* -----------------------------------
   Grid
----------------------------------- */
.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

/* SPALTE 1 */
.data-item.verbrauch-now {
  grid-column: 1;
  grid-row: 1;
}

.data-item.solar-now {
  grid-column: 1;
  grid-row: 2;
}

/* SPALTE 2 */
.data-item.verbrauch-year {
  grid-column: 2;
  grid-row: 1;
}

.data-item.prod-year {
  grid-column: 2;
  grid-row: 2;
}

/* SPALTE 3 */
.data-item.verbrauch-day {
  grid-column: 3;
  grid-row: 1;
}

.data-item.prod-day {
  grid-column: 3;
  grid-row: 2;
}

/* ===== RESPONSIVE: MOBIL = 1 SPALTE ===== */
@media (max-width: 768px) {
  .data-grid {
    grid-template-columns: 1fr;
  }

  .data-item {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .data-item.verbrauch-now { order: 1; }
  .data-item.solar-now { order: 2; }
  .data-item.verbrauch-year { order: 3; }
  .data-item.prod-year { order: 4; }
  .data-item.verbrauch-day { order: 5; }
  .data-item.prod-day { order: 6; }
  
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .footer-right {
    width: 100%;
    justify-content: center;
  }
}

/* -----------------------------------
   Footer / Info Texts
----------------------------------- */
.last-update,
.solar-id {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 5px 0;
}

/* -----------------------------------
   JSON Viewer (für logs.html)
----------------------------------- */
.json-viewer {
  font-family: 'Courier New', monospace;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}