body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f2f2f2;
  margin: 0;
  padding: 0;
}

/* do <head> nebo do main.css */
body.dark .chart-container,
body.dark .chart-container canvas {
  background-color: #222 !important;
}

/* Dark mode styles */
body.dark {
  background-color: #121212;
  color: #989898;
}
header {
  background-color: #2c3e50;
  color: white;
  padding: 1px;
  text-align: center;
}
body.dark header {
  background-color: #1f1f1f;
  color: #989898;
}
body.dark .section,
body.dark .btn-3d {
  background: #1e1e1e;
  box-shadow: 4px 4px 10px #000, -4px -4px 10px #333;
}
/* ...další selektory podle potřeby... */

/* Tlačítko pro přepínání */
#dark-mode-toggle {
  cursor: pointer;
}
#dark-mode-toggle.dark {
  background: #1f1f1f;
  color: #fff;
}
*/
/* Dark-mode form controls */
body.dark .form-control,
body.dark input,
body.dark select,
body.dark textarea,
body.dark .btn-check + .btn,
body.dark .form-select,
body.dark .input-group-text,
body.dark .segment {
  background-color: #1f1f1f !important;
  color: #eee !important;
  border-color: #444 !important;
}

/* Placeholder text */
body.dark .form-control::placeholder,
body.dark .percentage {
  color: #888 !important;
}

/* Flatpickr (datepicker) */
body.dark .flatpickr-calendar {
  background: #2b2b2b;
  color: #eee;
}
body.dark .flatpickr-time {
  background: #2b2b2b;
  color: #eee;
}

/* Offcanvas panely */
body.dark .offcanvas {
  background-color: #1e1e1e;
  color: #eee;
}

#save-info {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.6);
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 9999;
  pointer-events: none;
}

#save-info.show {
  opacity: 1;
}

.toggle-password {
  position: absolute;
  top: 61%;
  right: 1.5rem;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
}
/* ********************************************** */
/* *********** FORECAST PANEL ******************** */
/* ********************************************** */
.not_available {
  background: linear-gradient(to bottom, #eeeeee, #cccccc);
  color: #000;
}

.sunny, .clear {
  background: linear-gradient(to bottom, #fff2d1, #ffd700);
  color: #000;
}

.mostly_sunny {
  background: linear-gradient(to bottom, #fdd775, #ffd700);
  color: #000;
}

.partly_sunny {
  background: linear-gradient(to bottom,#d2d2d2 ,#ffd700 );
  color: #000;
}

.cloudy {
  background: linear-gradient(to bottom,#5e5e5e, #ffd700  );
  color: #000;
}
.mostly_cloudy {
  background: linear-gradient(to bottom, #d3d3d3, #a9a9a9);
  color: #000;
}

.overcast_with_low_clouds {
  background: linear-gradient(to bottom, #d3d3d3, #515151);
  color: #fff;
}
.overcast {
  background: linear-gradient(to bottom, #d3d3d3, #303030);
  color: #fff;
}

.fog {
  background: linear-gradient(to bottom, #cccccc, #999999);
  opacity: 0.85;
  color: #000;
}
.psbl_rain {
  background: linear-gradient(to bottom, #a0c4ff, #b3cde0);
  color: #000;
}

.light_rain {
  background: linear-gradient(to bottom, #a0c4ff, #5f9ea0);
  color: #000;
}
.rain_shower {
  background: linear-gradient(to bottom, #87ceeb, #4682b4);
  color: #000;
}
.rain {
  background: linear-gradient(to bottom, #6ca0dc, #274472);
  color: #fff;
}

.thunderstorm {
  background: linear-gradient(to bottom, #2c3e50, #4b79a1);
  color: #fff;
}

.local_thunderstorms {
  background: linear-gradient(to bottom, #3a3a52, #2c2c34);
  color: #fff;
}

.light_snow {
  background: linear-gradient(to bottom, #e0f7fa, #b2ebf2);
  color: #000;
}

.snow {
  background: linear-gradient(to bottom, #ffffff, #cfd8dc);
  color: #000;
}

.possible_snow {
  background: linear-gradient(to bottom, #e1f5fe, #b3e5fc);
  color: #000;
}

.snow_shower {
  background: linear-gradient(to bottom, #ffffff, #90a4ae);
  color: #000;
}

.rain_and_snow {
  background: linear-gradient(to bottom, #ccddee, #aaaaff);
  color: #000;
}

.possible_rain_and_snow {
  background: linear-gradient(to bottom, #ddeeff, #cfd8dc);
  color: #000;
}

.rain_and_snow {
  background: linear-gradient(to bottom, #ccddee, #aaaaff);
  color: #000;
}

.freezing_rain {
  background: linear-gradient(to bottom, #aee1f9, #89b0d9);
  color: #000;
}

.possible_freezing_rain {
  background: linear-gradient(to bottom, #bdd9f2, #a3c2db);
  color: #000;
}

.hail {
  background: linear-gradient(to bottom, #d9d9d9, #8e9eab);
  color: #000;
}

/* .clear {
  background: linear-gradient(to bottom, #0b3d91, #1c1c3c);
  color: #fff;
} */

.mostly_clear {
  background: linear-gradient(to bottom, #1e3c72, #2a5298);
  color: #fff;
}

.partly_clear {
  background: linear-gradient(to bottom, #2c3e50, #34495e);
  color: #fff;
}

.card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

.wind-arrow {
  display: inline-block;
  transform-origin: center;
  transition: transform 0.3s ease;
  font-size: 1.25rem;
  line-height: 1;
}
.section-forecast {
  border-radius: 16px;
  box-shadow: 6px 6px 15px #826e6e, -6px -6px 15px #ffffff;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
}
/* ********************************************** */
/* *********** INFO PANEL ******************** */
/* ********************************************** */
.popover-body i {
  vertical-align: middle;
}
/* Fixní šířka ikon pro zarovnání do sloupce */
.bi-fw {
  display: inline-block;
  width: 1.25em; /* uprav podle potřeby */
  text-align: center;
}
/* INFO PANEL SECTIONS */
.voltage {
  top: 6.8rem;
  position: absolute;
}
.arrow {
  transform-origin: center bottom;
  /* otočení kolem středu šipky */
  transform-origin: 50% 50%;
  /* místo pevného transformu budeme používat CSS proměnnou --angle */
  transform: rotate(var(--angle, 0deg));
  /* přidáme animaci kývání */
  animation: sway 3s ease-in-out infinite;
}

/* klíčové snímky animace */
@keyframes sway {
  0% {
    transform: rotate(calc(var(--angle) - 5deg));
  }
  50% {
    transform: rotate(calc(var(--angle) + 5deg));
  }
  100% {
    transform: rotate(calc(var(--angle) - 5deg));
  }
}
.section {
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  padding: 1.3rem 1.3rem 0.8rem 1.3rem;
  border-radius: 16px;
  box-shadow: 6px 6px 15px #826e6e, -6px -6px 15px #ffffff;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
}
.section-btn:hover {
  transform: scale(1.02);
  box-shadow: 8px 8px 20px #371c1c, -8px -8px 20px #ffffff;
}
.section h2 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 1.4em;
  margin-bottom: 10px;
}
.section p {
  margin: 8px 0;
  color: #444;
}
/* INFO PANEL VALUES */
.value {
  font-size: 1.8rem;
  font-weight: bold;
}
/* ICON IN SECTIONS */
/* .icon {
  position: absolute;
  top: 0.1rem;
  right: -0.1rem;
  font-size: 2.1rem;
} */
.big-icon {
  position: absolute;
  font-size: 2.8rem;
  right: 1.3rem;
  top: 0.5rem;
  opacity: 0.4;
}
/* ********************************************** */
/* *********** CHART ******************** */
/* ********************************************** */
.chart-container {
  background-color: white;
  margin: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
canvas {
  touch-action: auto !important;
  pointer-events: auto !important;
}
/* ********************************************** */
/* *********** BATTERY ICON ******************** */
/* ********************************************** */
.battery-container {
  position: absolute;
  top: 0.9rem;
  right: 1.4rem;
  width: 75px;
  height: 37px;
  border-radius: 7px;
  opacity: 0.7;
  /* animation: pulse-shadow 4s infinite ease-in-out; */
  border: solid 1px rgb(0, 0, 0);
  font-size: 16px;
  transition: all 0.5s ease;
}
.battery-tip {
  width: 4px;
  height: 25px;
  background: #000000;
  position: absolute;
  top: 5.6px;
  right: -6px;
  border-radius: 4px;
}
.battery-level {
  height: 100%;
  /* background: linear-gradient(145deg, #ffffff, #4caf50); */
  width: 0%;
  border-radius: 7px;
  transition: width 2s ease;
}
.percentage {
  position: absolute;
  top: 45%;
  left: 63%;
  width: 57px;
  transform: translate(-50%, -50%);
  font-size: 25px;
  font-weight: bolder;
  color: #000000;
}
/* ********************************************** */
/* *********** FV PANEL ******************** */
/* ********************************************** */

.led { 
  opacity: 0.5;
  position: absolute;
  width: 10px;
  height: 5px;
  background: rgb(205, 205, 205);
  border-radius: 4px;
  transform-origin: center center;
  transition: background 0.2s, box-shadow 0.2s;
}
.led.on {
  background: #00be00;
  box-shadow: 0 0 8px lime;
}
.led.red{
  background: #be0000;
  box-shadow: 0 0 8px rgb(255, 0, 0);
}
input[type="range"] {
  width: 300px;
}
label {
  margin-bottom: 10px;
}
.fv-icon {
  position: absolute;
  top: 0.4em;
  right: 0.5rem;
}
/* ********************************************** */
/* *********** SECTION BUTTON FOR SHOW OFFCANVAS SETTING ******************** */
/* ********************************************** */
.pulse-btn {
  font-size: 1rem;
  animation: pulse-shadow 1s infinite ease-in-out;
  box-shadow: -6px -6px 12px #59ff06, /* světlo vlevo nahoře */ 6px 6px 12px #00ff22; /* stín vpravo dole */
}
.btn-3d {
  display: inline-block;
  padding: 1px 6px;
  cursor: pointer;
  animation: pulse-shadow 4s infinite ease-in-out;
  background: linear-gradient(145deg, #ffffff, #c1c1c1);

  font-size: 16px;
  border-radius: 20%; /* kruhový tvar */
  /* stín vpravo dole */
  cursor: pointer;
  transition: all 0.5s ease;
  border: solid 2px rgb(0, 0, 0);
}
.btn-3d:hover {
  background: linear-gradient(145deg, #ffffff, #707070);
  transform: scale(1.07);
}
.btn-3d-red {
  box-shadow: 0px 0px 20px rgb(251 0 0);
}
.btn-3d-green {
  box-shadow: 0px 0px 20px rgb(8, 251, 0);
}
.btn-3d-gray {
  box-shadow: -6px -6px 12px #ffffff, /* světlo vlevo nahoře */ 6px 6px 12px #1eff00;
}
@keyframes pulse-shadow {
  0% {
       background-color: rgba(0, 255, 0, 0.413);
    box-shadow: 0 0 10px red;
  }
  50% {
    background-color: rgba(244, 10, 104, 0.413);    
    box-shadow: 0 0 50px red;
    color: #79ffb8;
    font-size: 1.2rem ;
  }
  100% {
      background-color: rgba(0, 255, 0, 0.413);   
    box-shadow: 0 0 10px red;
  }
}

/* ********************************************** */
/* ***********  WEATHER FORECAST GRAPH ******************** */
/* ********************************************** */
.outer-wrapper {   box-sizing: border-box; padding: 0; margin: 0; }
.weather-container { width: 100%;  background: #e4e4e4; border-radius: 8px; box-sizing: border-box; display: flex; flex-direction: column; height: 28vh; }
.days-row { display: flex;    }
.icons-row { display: flex; margin-bottom: 4px; }
.days-row .day, .icons-row .icon { display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.days-row .day { font-size: 14px; font-weight: bold; text-transform: uppercase; color: #101010; }
.icons-row .icon img { width: 32px; height: 32px; visibility: visible; }

@media (max-width: 990px) {
  /* skryjeme každou druhou ikonu, ale ponecháme prostor pro zarovnání */
  .icons-row .icon:nth-child(2n) img {
    visibility: hidden;
  }
}
#weatherChart {
  flex: 1;
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
}
/* ********************************************** */
/* ***********  RIGHT SETTING PANEL ******************** */
/* ********************************************** */
/*  WATER HEATER MODE SWITCH  */
#knob {
  transition: transform 0.5s ease-out;
}
.rotary-wrapper {
  position: relative;
  width: 165px;
  height: 165px;
}
.rotary-base {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at center, #cccccc 0%, #999999 100%);
  box-shadow: inset -3px -3px 8px rgba(255, 255, 255, 0.5), inset 3px 3px 8px rgba(0, 0, 0, 0.2);
}
.rotary-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, #666, #333);
  border-radius: 50%;
  box-shadow: -2px -2px 5px rgba(255, 255, 255, 0.5), 2px 2px 5px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center;
  transition: transform 0.3s ease-out;
}
.indicator {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 4px;
  height: 20px;
  background: red;
  border-radius: 2px;
  transform: translateX(-50%);
}
/* SEGMENT BUTTON IN THE WATER HEATER MODE SWITCH */
.segment {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 30%;
  text-align: center;
  line-height: 40px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.6);
  transition: background 0.2s;
  cursor: pointer;
  user-select: none;
}
.segment:hover {
  background: rgba(255, 255, 255, 0.9);
}
.segment.active.off {
  background: #ff0000;
  color: white;
}
.segment.active.aut {
  background: #0084ff;
  color: white;
}
.segment.active.on {
  background: #4caf50;
  color: white;
}
.segment.active.bat {
  background: #aaaf4c;
  color: white;
}
.segment.aut {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}
.segment.on {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.segment.off {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}
.segment.bat {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.form-check-input:checked {
  background-color: #4caf50;
  border-color: #014703;
}
/* ˇPICK TEMPERATURE OR TIME FOR ON MODE */
.disabled {
  opacity: 0.35;
  pointer-events: none;
}
/* ********************************************** */
/* ***********  LEFT SETTING PANEL ******************** */
/* ********************************************** */
/* SWIITCH SLIDER FOR LOW TARIF TIME */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 0;
}

.checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 35px;
  height: 100%;
  border: 2px solid gray;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: all 0.2s ease-in-out;
}

.checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox {
  background-color: #4caf50;
  border-color: #4caf50;
}

.checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 12px;
  width: 9px;
  height: 14px;
  border: solid white;
  border-width: 0 3px 2px 0;
  transform: rotate(45deg);
}

.text-bg-gray {
  background-color: #f4f4f4;
}
