/* -----------------------------------
   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: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-header: #696969;
  --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 {
  width: 28px;
  height: 28px;
  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);
}

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

.data-item {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

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

.data-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem auto;
  display: block;
}

.data-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.data-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

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

  .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;
}

/* -----------------------------------
   Charts Grid (2 Spalten)
----------------------------------- */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 1200px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------
   Appliance Comparison Grid
----------------------------------- */
.appliance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.appliance-item {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

.appliance-item:hover {
  box-shadow: 0 4px 12px var(--shadow-hover);
  transform: translateY(-2px);
}

.appliance-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem auto;
  display: block;
}

.appliance-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.appliance-count {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2e90fa;
  margin: 0.5rem 0;
}

.appliance-power {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.appliance-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* -----------------------------------
   Jahresübersicht: Becher-Visualisierung
----------------------------------- */
.beaker-legend {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.beaker-grid {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.5rem 0;
  overflow-x: auto;
}

.beaker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 56px;
  cursor: default;
}

.beaker-item:hover .beaker-svg path[stroke] {
  stroke: var(--text-primary);
}

.beaker-month-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.beaker-svg {
  width: 100%;
  max-width: 72px;
  height: auto;
  display: block;
  overflow: visible;
}

.beaker-kwh {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.8;
  margin-top: auto;
}

.bv-prod {
  color: #f7ba0f;
  display: block;
}

.bv-cons {
  color: #2e90fa;
  display: block;
}

.bv-prod svg,
.bv-cons svg {
  width: 1em;
  height: 1em;
  vertical-align: -0.1em;
  display: inline;
}

@media (max-width: 900px) {
  .beaker-grid {
    justify-content: flex-start;
  }
  .beaker-item {
    min-width: 44px;
  }
}

/* -----------------------------------
   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;
}