/* ---------------------- */
/* Toggle button position */
.toggle-position {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

@media (max-width: 768px) and (orientation: portrait) {

  .toggle-position {
    top: 10px;
    right: 0;
    transform: translateX(23px);
  }

  .switch {
    width: 34px;
    height: 60px;
  }

  .slider {
    position: absolute;
    width: 34px;
    height: 60px;
    top: 0;
    left: 0;
    right: auto;   
    bottom: auto;  
  }

  .slider:before,
  .slider.round:before {
    left: 4px;
    top: 4px;
    bottom: auto;
    transform: translateX(0) !important;
  }

  input:checked + .slider:before,
  input:checked + .slider.round:before {
    transform: translateY(26px) !important;
  }
}

/* ---------------------- */
/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
  background-color: #f1c40f; 
}

.slider.round:before {
  position: absolute;
  content: "☀️"; 
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: 0.4s;
}

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

input:checked + .slider.round:before {
  transform: translateX(26px);
  content: "🌙"; 
  background-color: #d3d3d3; 
}

/* ---------------------- */
/* Default (light mode) */
/* ---------------------- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #000000;
}

.map {
    height: 80%;
    width: 90%;
    margin: 1px;
    background-color: #fff;
}

.map:-webkit-full-screen,
.map:fullscreen {
    height: 100%;
    margin: 0;
}

.map .ol-rotate {
    top: 3em;
}

.rotate-north {
    top: 230px;
    left: .5em;
}

.ol-touch .rotate-north {
    top: 250px;
}

.tablinks button {
    background-color: red;
    color: black;
}

.tab {
    top: 80px;
    left: .5em;
}

.autocomplete {
    top: 5px;
    left: 5px;
    position: relative;
    display: inline-block;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
}

.autocomplete-items div:hover {
    background-color: #e9e9e9;
}

.autocomplete-active {
    background-color: DodgerBlue;
    color: #ffffff;
}

.ol-popup {
    font-size: 10px;
    position: absolute;
    background-color: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #cccccc;
    bottom: 12px;
    left: -50px;
    display: inline-block;
    width: auto;
    min-width: 100px;
}

.ol-popup:after, .ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.ol-popup:after {
    border-top-color: white;
    border-width: 10px;
    left: 48px;
    margin-left: -10px;
}

.ol-popup:before {
    border-top-color: #cccccc;
    border-width: 11px;
    left: 48px;
    margin-left: -11px;
}

.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 2px;
    right: 8px;
}

.ol-popup-closer:after {
    content: "✖";
}

/* OL controls default light */
.ol-control {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

.ol-control button {
    background-color: #fff !important;
    color: #000 !important;
}

.ol-control button:hover {
    background-color: #ddd !important;
}

/* ---------------------- */
/* Dark Mode Overrides */
/* ---------------------- */
html.dark-mode, body.dark-mode {
    background-color: #121212;
    color: #f1ebe5;
}

body.dark-mode .map {
    background-color: #1e1e1e;
}

body.dark-mode .tablinks button {
    background-color: #2c2c2c;
    color: #f1ebe5;
    border: 1px solid #444;
}

body.dark-mode .autocomplete-items {
    background-color: #1e1e1e;
    border: 1px solid #444;
}

body.dark-mode .autocomplete-items div {
    background-color: #1e1e1e;
    color: #f1ebe5;
    border-bottom: 1px solid #444;
}

body.dark-mode .autocomplete-items div:hover {
    background-color: #333;
}

body.dark-mode .autocomplete-active {
    background-color: #3a6ea5;
    color: #ffffff;
}

body.dark-mode .ol-popup {
    background-color: #1e1e1e;
    color: #f1ebe5;
    border: 1px solid #444;
    box-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

body.dark-mode .ol-popup:after {
    border-top-color: #1e1e1e;
}

body.dark-mode .ol-popup:before {
    border-top-color: #444;
}

body.dark-mode .ol-popup-closer {
    color: #f1ebe5;
}

body.dark-mode .ol-control {
    background-color: rgba(30, 30, 30, 0.8) !important;
}

body.dark-mode .ol-control button {
    background-color: #2c2c2c !important;
    color: #f1ebe5 !important;
}

body.dark-mode .ol-control button:hover {
    background-color: #444 !important;
}
/* Dark mode support */
body.dark-mode .chart-container canvas {
  background-color: #1e1e1e;
  border: none;
}