/* Dark mode - controlled via data-theme attribute set by JS */
:root[data-theme="dark"] .leaflet-control-locate {
  --locate-control-icon-color: #fff;
}

:root[data-theme="dark"] #dark-mode-toggle,
:root[data-theme="dark"] .leaflet-bar a,
:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip,
:root[data-theme="dark"] .leaflet-control-attribution {
  background-color: #3a3a3a;
  color: #fff;
}

:root[data-theme="dark"] .leaflet-control-attribution a {
  color: #6db3f2;
}

:root[data-theme="dark"] .leaflet-bar a {
  border-color: rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] #dark-mode-toggle:hover,
:root[data-theme="dark"] .leaflet-bar a:hover {
  background-color: #555;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: #181818;
  color: #fff;
}

html,
body {
  padding: 0;
  margin: 0;
  background-color: #fff;
  color: #000;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#map {
  position: absolute;
  width: 100%;
  height: 100%;
}

#dark-mode-toggle {
  position: fixed;
  top: 130px;
  left: 10px;
  z-index: 2000;
  background: #fff;
  border-radius: 4px;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 26px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/*
   The part below is for a fancy "Fork me on GitHub" ribbon in the top right corner.
   It was created with the help of https://github.com/codepo8/css-fork-on-github-ribbon.
*/

#forkmeongithub a {
  background: #bb1111cc;
  color: #fff;
  font-family: arial, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  text-shadow: 2px 2px #00000055;
  line-height: 1.4rem;
  padding: 5px 40px;
  top: -150px;
}

#forkmeongithub a:hover {
  background: #333388bb;
}

#forkmeongithub a::before,
#forkmeongithub a::after {
  content: "";
  width: 100%;
  display: block;
  position: absolute;
  top: 1px;
  left: 0;
  height: 1px;
  background: #fff;
}

#forkmeongithub a::after {
  bottom: 1px;
  top: auto;
}

@media screen and (min-width: 800px) {
  #forkmeongithub {
    position: fixed;
    display: block;
    top: -10px;
    right: -10px;
    width: 200px;
    overflow: hidden;
    height: 200px;
    z-index: 9999;
  }
  #forkmeongithub a {
    width: 200px;
    position: absolute;
    top: 60px;
    right: -60px;
    transform: rotate(45deg);
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.8);
  }
}
