/* Globaler Basisstil */
body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  margin: 0;
  padding: 0;
}

/* Header */
header {
  background-color: #2E7D32;
  padding: 20px;
  text-align: center;
  color: white;
  position: relative;
}

header img {
  max-height: 50px;
  vertical-align: middle;
}

header h1 {
  display: inline;
  margin-left: 10px;
  font-size: 24px;
  font-weight: normal;
}

/* Container */
.container {
  width: 90%;
  margin: 20px auto;
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Buttons – Standard: inaktiv = gray, aktiv bzw. hover = grün */
button {
  background-color: gray;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}

button.active,
button:hover,
.button-group button.selected {
  background-color: #2E7D32;
}

/* Grüne Buttons (dauerhaft grün) */
.greenButton {
  background-color: #2E7D32 !important;
}

/* Input und Select */
input, select {
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: calc(100% - 24px);
}

/* Spinner (Ladekreis) */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #ccc;
  border-top: 3px solid #555;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  visibility: hidden;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* PAYPAL BUTTON */
.paypal-donate {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 1000;
}

.donate-btn {
  background: #0070ba;
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 8px 16px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s, box-shadow 0.2s;
  line-height: 1.25;
  min-width: 120px;
  white-space: pre-line; /* Zeilenumbruch bei <br> oder bei / falls du ersetzt */
}
.donate-btn:hover {
  background: #005c99;
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}

/* Wechselbutton Einergie - Leistung */
.wechsel-btn {
  background-color: #2E7D32;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 8px 16px;
  margin-left: 8px;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  transition: background 0.2s;
}
.wechsel-btn:hover {
  background-color: #246022;
}
/* Tooltip */
.tooltip {
  position: absolute;
  padding: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border-radius: 4px;
  pointer-events: none;
  font-size: 12px;
}

/* Kacheln (z.B. in index.html) */
.kachel {
  display: inline-block;
  width: 40%;
  padding: 20px;
  margin: 20px;
  background-color: #f4f4f4;
  border: 2px solid #2E7D32;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-align: center;
}

.kachel:hover {
  background-color: #d9f2e6;
}

/* Geräteauswahlzeile: Label + Dropdown links, Button rechts */
.device-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.device-select-group {
  flex: 1;
  display: flex;
  align-items: center;
}
.device-select-group > div {
  flex: 1;
}
.energiedaten-button-group {
  flex: 1;
  text-align: right;
}

/* Button-Gruppen (z.B. für Zeitwahl) – linksbündig */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
  justify-content: flex-start;
}
.button-group button {
  background-color: gray;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}
.button-group button.active,
.button-group button.selected {
  background-color: #2E7D32;
}

/* Chart Header (z.B. für Live Chart) */
#chart-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 20px 0;
  height: 40px;
}
#title-container {
  display: flex;
  align-items: center;
  gap: 5px;
}
#chart-title {
  font-size: 24px;
  margin: 0;
  line-height: 40px;
}

/* Historische Leistungswerte Header und Aktionen */
#csvChartHeader {
  margin-bottom: 10px;
}
#csvChartHeader .csvHeaderTitle {
  font-size: 20px;
  font-weight: bold;
}
#csvActionContainer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
#csvActionContainer button {
  /* Dauerhaft grün */
  background-color: #2E7D32;
}
#csvActionContainer .dropZone {
  border: 2px dashed #ccc;
  padding: 10px;
  flex-grow: 1;
}

/* CSV Zoom Button Container: Reset-Zoom-Button links unter dem Diagramm */
#csvZoomContainer {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

/* Zero-Lines */
.live-zero-line,
.csv-zero-line {
  stroke: #999;
  stroke-dasharray: 4 2;
}

/* Responsive Anpassungen */
@media screen and (max-width: 600px) {
  .kachel {
    width: 100%;
    margin: 10px 0;
  }
  .device-selection {
    flex-direction: column;
  }
}
