/* Historikgraf under status-tabellen på PVBatt.htm */

.historycard {
  background: #ffffff;
  border-radius: 10px;
  margin-top: 22px;
  padding: 24px 26px;
  box-shadow: 0 4px 16px rgba(30,20,120,0.12);
}

.historycard h2 {
  font-size: 16px;
  color: #2200cc;
  margin: 0 0 16px 0;
  text-align: center;
}

.history-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.history-controls label {
  font-weight: bold;
  font-size: 13px;
  color: #2200cc;
  margin-right: 4px;
}

.history-controls select {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  padding: 6px 8px;
  border: 2px solid #2200cc;
  border-radius: 6px;
  color: #1a1a2e;
  background: #f7f8ff;
}

/* Fargkodade kanter som matchar kurvfargerna i grafen. Behover samma
   specificitet (klass+element) som ".history-controls select" ovan for att
   faktiskt vinna over standardfargen dar - annars vinner den blaa kanten
   pga kalllordning/specificitet aven pa de andra dropdownarna. */
.history-controls select.history-select-1 { border-color: #2200cc; }
.history-controls select.history-select-2 { border-color: #d32f2f; }
.history-controls select.history-select-3 { border-color: #1a1a1a; }
.history-controls select.history-select-4 { border-color: #ffa000; }

.history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 10px;
  font-size: 12px;
  color: #1a1a2e;
}

.history-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.history-rangebtn {
  display: inline-block;
  background-color: #2200cc;
  color: #ffffff;
  font-weight: bold;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.history-rangebtn:hover {
  background-color: #3a1fd6;
  transform: translateY(-1px);
}
.history-rangebtn.active {
  background-color: #ff8800;
}

.history-canvas-wrap {
  position: relative;
  width: 100%;
}

#historyCanvas {
  width: 100%;
  height: 320px;
  display: block;
  border: 1px solid #e2e4f5;
  border-radius: 6px;
  background: #f7f8ff;
}

.history-missing {
  text-align: center;
  color: #a30000;
  font-weight: bold;
  padding: 20px 10px;
  font-size: 14px;
}

.history-loading {
  text-align: center;
  color: #6b6f9a;
  font-size: 12px;
  padding: 6px 0 0 0;
}
