:root {
  --background: 255 255 255;
  --color: 0 0 0;
  --toolbar-width: 70px;
  --font-weight: 500;
}

[data-theme="dark"] {
  --background: 0 0 0;
  --color: 255 255 255;
  --font-weight: 400;
}
[data-theme="dark"] .icon img {
  filter: invert();
}
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}
body {
  background-color: rgb(0 0 0 / 25%);
}
body,
button,
input {
  font-family: "Poppins", sans-serif;
  color: rgb(var(--color));
  font-size: 15px;
  font-weight: var(--font-weight);
}
button {
  border: none;
  outline: none;
  background-color: transparent;
  cursor: pointer;
  padding: 0;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

body > .wrapper {
  position: relative;
  width: 100%;
  height: calc(100% - 48px);
  overflow: hidden;
}

/* CESIUM */
#cesiumContainer {
  margin-left: var(--toolbar-width);
  height: 100%;
  display: flex;
}

.print .wrapper {
  padding-left: 415px;
}
.print #cesiumContainer {
  position: relative;
  top: 50%;
  width: calc(100% - 5px);
  transform: translateY(-50%);
  height: 0;
  padding-bottom: 52%;
  margin: 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.print #cesiumContainer.highres {
  width: 200%;
  padding-bottom: 116%;
}
.print .cesium-viewer {
  position: absolute;
}
.cesium-viewer-toolbar,
.cesium-viewer-bottom {
  display: none !important;
}

/* baselayers */
#baseLayerPickerContainer > button {
  display: none;
}
.cesium-baseLayerPicker-dropDown {
  transform: translate(0, 0);
  visibility: visible;
  opacity: 1;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
}
.cesium-baseLayerPicker-dropDown,
.cesium-baseLayerPicker-choices {
  border: none;
  padding: 0;
  margin: 0;
}
.cesium-baseLayerPicker-sectionTitle,
.cesium-baseLayerPicker-itemLabel {
  font-family: "Poppins", sans-serif;
  color: rgb(var(--color));
  font-size: 1em;
}
.cesium-baseLayerPicker-sectionTitle {
  opacity: 0.75;
  margin-bottom: 14px;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cesium-baseLayerPicker-item {
  display: flex;
  align-items: center;
  margin: 0 0 8px;
  width: unset;
  text-align: left;
}
.cesium-baseLayerPicker-itemIcon {
  border-radius: 50%;
  width: 38px;
  border: none;
  margin-right: 10px;
}
.cesium-baseLayerPicker-selectedItem {
  background: rgb(255 255 255 / 6%);
  border-radius: 20px;
}
.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon {
  border: none;
}
.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon {
  box-shadow: none;
}
.cesium-baseLayerPicker-item:not(:first-child)
  .cesium-baseLayerPicker-itemLabel {
  display: inline-block;
  color: rgb(var(--color) / 30%);
}
.cesium-baseLayerPicker-item:not(
    :first-child
  ).cesium-baseLayerPicker-selectedItem
  .cesium-baseLayerPicker-itemLabel {
  color: rgb(var(--color));
}
.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel,
.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel {
  text-decoration: none;
}

.cesium-baseLayerPicker-item:first-of-type {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
}
.cesium-baseLayerPicker-item:first-of-type.cesium-baseLayerPicker-selectedItem {
  display: none;
}
.cesium-baseLayerPicker-item:first-of-type .cesium-baseLayerPicker-itemIcon {
  display: none;
}
.cesium-baseLayerPicker-item:first-of-type .cesium-baseLayerPicker-itemLabel {
  font-size: 0.8em;
}

#flash {
  z-index: 10;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  pointer-events: none;
  opacity: 0;
}
#flash.play {
  animation: flash 1.2s ease;
}
@keyframes flash {
  0% {
    opacity: 0;
  }
  2% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
  }
}

body > header {
  height: 48px;
  background-color: rgb(var(--background));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 22px;
  border-bottom: 1px solid rgb(var(--color) / 5%);
  width: 100%;
}

.ctrl {
  z-index: 999;
  position: absolute;
}
.ctrl.top-right {
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ctrl.bottom-right {
  bottom: 5px;
  right: 10px;
}
.ctrl > div {
  margin-bottom: 5px;
  background-color: rgb(var(--background) / 90%);
  width: 40px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
}
.ctrl svg {
  fill: rgb(var(--color));
  width: 18px;
}

#compass {
  width: 54px;
  height: 54px;
  border-radius: 100%;
  padding: 14px;
}
#compass > div {
  width: 100%;
  height: 100%;
  border-radius: 100%;
  background-color: rgb(var(--color) / 15%);
  display: flex;
  justify-content: center;
  align-items: center;
}
#compass > div > svg {
  width: 22px;
}
#compass > div > svg > path:nth-child(2) {
  fill: rgb(var(--color) / 50%);
}
#dimension button {
  letter-spacing: 1px;
}
#settings {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  opacity: 0.8;
}

#settingsBox {
  z-index: 999;
  position: absolute;
  bottom: 10px;
  right: 48px;
  padding: 16px 24px;
  border-radius: 6px;
  text-align: center;
  background-color: rgb(var(--background) / 80%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#settingsBox > div > div {
  margin-bottom: 12px;
}
#settingsBox > div > div p {
  margin: 0;
}
#settingsBox > div > div small {
  opacity: 0.6;
}
#settingsBox.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#settingsBox button {
  background-color: rgb(var(--color) / 4%);
  padding: 5px 12px;
  border-radius: 4px;
}
#settingsBox button.active {
  background-color: #4d89a7;
  color: #fff;
}
#settingsBox hr {
  margin: 17px 0 14px;
  opacity: 0.2;
}
#settingsBox #bgcolor {
  margin-right: 10px;
  cursor: pointer;
}
#settingsBox > div > small {
  cursor: pointer;
}

/* TOOLBAR */
#toolbar {
  z-index: 900;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  padding: 15px 0;
  background-color: rgb(var(--background) / 95%);
  display: flex;
  flex-direction: column;
}
#toolbar > div.off {
  display: none;
}
#toolbar > .action:first-child,
:not(.action) + .action {
  margin-top: auto;
}
#toolbar > div > button {
  z-index: 2;
  position: relative;
  width: var(--toolbar-width);
  height: 70px;
  padding: 10px 11px 10px 9px;
}
#toolbar > div > button > .icon {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
}
#toolbar > div > button:hover > .icon,
#toolbar > div.legend-open > button > .icon {
  background-color: rgb(var(--color) / 8%);
}
#toolbar > div > button > span {
  font-size: 1.15em;
  letter-spacing: 0.5px;
  font-weight: bold;
}

#toolbar > div > button .tooltip {
  position: absolute;
  left: 100%;
  top: 0;
  bottom: 0;
  font-size: 0.95em;
  background-color: rgb(var(--background));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
#toolbar > div > button .tooltip > div {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 20px 0 12px;
  white-space: nowrap;
  line-height: 1.5;
  transition: all 0.2s ease;
}

#toolbar > div.hasLegend > button .tooltip > div {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
}
#toolbar > div.hasLegend > button .tooltip > div > span {
  position: relative;
  display: none;
  width: 16px;
  height: 2px;
  margin-right: 14px;
  background-color: rgb(var(--color));
  border-radius: 2px;
  opacity: 1;
}
#toolbar > div.hasLegend > button .tooltip > div > span:after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: 0;
  top: -4px;
  transform: rotate(45deg);
  border-bottom: 2px solid rgb(var(--color));
  border-left: 2px solid rgb(var(--color));
  border-radius: 2px;
}
#toolbar > div > button .tooltip div span {
  opacity: 0.5;
  font-size: 0.9em;
}
body:not(.noTooltip) #toolbar button:hover .tooltip {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

#toolbar > div.legend-open > button {
  position: unset;
}
#toolbar > div.legend-open .legend {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
#toolbar > div.legend-open .tooltip {
  opacity: 1;
  transform: translateX(0);
  z-index: 10;
  bottom: unset;
  height: 100px;
  width: 340px;
  pointer-events: auto;
  border-bottom: 1px solid rgb(var(--color) / 5%);
  background-color: rgb(var(--color) / 4%);
}
#toolbar > div.legend-open .tooltip:hover {
  background-color: rgb(var(--color) / 6%);
}
#toolbar > div.legend-open .tooltip > div {
  padding-left: 30px;
}
#toolbar > div.hasLegend.legend-open > button .tooltip > div > span {
  display: inline-block;
}

#toolbar .legend {
  z-index: 1;
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--toolbar-width);
  width: 340px;
  background-color: rgb(var(--background) / 95%);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
  transition: all 0.2s ease;
}
#toolbar .legend > div {
  position: relative;
  top: 100px;
  height: calc(100% - 100px);
  padding-bottom: 40px;
  overflow: auto;
  background-color: rgb(var(--color) / 4%);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#toolbar .legend > div::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
#toolbar .legend > div > div,
#toolbar .legend > div > ul {
  margin: 0;
  padding: 30px 0 0;
}

#toolbar .legend > div > div {
  padding-right: 30px;
  padding-left: 30px;
}
#toolbar .legend > div > ul:before {
  display: block;
  color: rgb(var(--color));
  font-size: 0.75em;
  margin-left: 30px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#toolbar .legend > div > ul.models:before {
  content: "Befintligt";
}
#toolbar .legend > div > ul.other:before {
  content: "Nytt";
}

#toolbar .legend > div > ul > li:hover,
#toolbar .legend .dropdown.open {
  background-color: rgb(var(--color) / 3%);
}

#layers li > input {
  display: none;
}
#layers li > label {
  position: relative;
  display: block;
  padding: 3px 30px;
  cursor: pointer;
  color: rgb(var(--color) / 30%);
  border-left: 0 solid rgb(132 144 154 / 0);
  transition: color 0.2s ease;
}
#layers li > input:checked + label {
  color: rgb(var(--color));
}
#layers li > label:after {
  content: "Av";
  position: absolute;
  top: 10px;
  right: 30px;
  font-size: 0.85em;
}
#layers li > input:checked + label:after {
  content: "På";
}

#viewpoints li {
  padding: 5px 30px;
  cursor: pointer;
}

#toolbar .legend .dropdown > div {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}
#toolbar .legend .dropdown > div p {
  font-size: 0.95em;
  padding-top: 10px;
}
#toolbar .legend .dropdown.open > div {
  max-height: 100%;
  opacity: 1;
  pointer-events: auto;
}
#toolbar .legend .dropdown ul {
  padding: 20px 0 0;
}
#toolbar .legend .dropdown li {
  padding: 10px 15px;
}
#toolbar .legend .dropdown li:hover {
  background-color: rgb(var(--color) / 3%);
}
#toolbar .legend .dropdown li > span {
  right: 40px;
}

#toolbar > div > button img,
#toolbar > div > button svg {
  width: 23px;
}
#toolbar > div svg g {
  fill: rgb(var(--color));
}
#projection svg:not(.visible) {
  display: none;
}

html:not([data-theme="dark"]) #sun.active .icon,
html:not([data-theme="dark"]) #sun.active:hover .icon {
  background-color: rgb(251, 207, 123) !important;
}
html:not([data-theme="dark"]) #sun.active svg g {
  fill: #fff !important;
}

[data-theme="dark"] #sun.active svg g {
  fill: rgb(251, 207, 123);
}

#sun > div > div > div > ul {
  margin-top: 40px;
}

#calendar {
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#toolbar #calendar.active > button:hover .tooltip {
  opacity: 0;
  pointer-events: none;
}
#toolbar .action.active > button > .icon {
  background-color: rgb(var(--color) / 8%);
}

.actions {
  z-index: 100;
  position: absolute;
  bottom: 5px;
  left: calc(var(--toolbar-width) + 10px);
  display: flex;
  flex-direction: column;
  width: 350px;
}
.noTooltip .actions {
  left: calc(var(--toolbar-width) + 350px);
}
.actions > div {
  position: relative;
  padding: 20px 24px;
  border-radius: 6px;
  background-color: rgb(var(--background) / 80%);
  opacity: 0;
  pointer-events: none;
  margin-bottom: 5px;
  height: 130px;
  margin-bottom: -135px;
  transition: opacity 0.3s ease, margin 0.3s ease;
}
.actions > div.active {
  opacity: 1;
  pointer-events: auto;
  margin-bottom: 5px;
}
.actions > div > p {
  margin: 0 0 16px;
  line-height: 1.5;
  font-size: 0.95em;
  letter-spacing: 0.2px;
}

/* TIME AND DATE */
#timeDate > div {
  margin: 22px -4px 0;
  display: flex;
}
#timeDate .export {
  height: 43px;
  min-width: 43px;
  background-color: rgb(var(--background) / 80%);
  border-radius: 100%;
  cursor: pointer;
  pointer-events: auto;
}
#timeDate .date {
  pointer-events: none;
  position: relative;
  display: inline-block;
}
#timeDate .date.active {
  pointer-events: auto;
}
#timeDate .date button {
  position: relative;
  border-radius: 22px;
  background: transparent;
  color: rgb(var(--color));
  padding: 0 0 0 18px;
  height: 43px;
  min-width: 125px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgb(var(--color) / 10%);
  overflow: hidden;
  pointer-events: auto;
}
#timeDate .date button i {
  font-size: 1.4em;
  min-width: 43px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgb(var(--color) / 4%);
  transform: rotate(0deg);
  transition: 0.4s cubic-bezier(0.2, 0.6, 0.3, 1.1);
}
#timeDate .date button i:before {
  content: "+";
  font-style: normal;
}
#timeDate .date.active button i {
  transform: rotate(180deg);
}
#timeDate .date.active button i:before {
  content: "-";
  font-weight: bold;
}
#timeDate .date ul {
  position: absolute;
  width: 100%;
  bottom: 42px;
  margin: 0 0 3px;
  padding: 0;
  list-style: none;
  background: rgb(var(--background) / 90%);
  border-radius: 12px;
  overflow: hidden;
  transform: translateY(15px);
  opacity: 0;
  transition: all 0.2s ease;
}
#timeDate .date.active ul {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#timeDate .date li {
  padding: 7px 14px;
  cursor: pointer;
  background: rgb(var(--color) / 4%);
  border-left: 0 solid rgb(132 144 154 / 0);
  transition: border-left 0.1s ease;
}
#timeDate .date li:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#timeDate .date li:hover,
#timeDate .date li.active {
  border-left: 4px solid rgb(var(--color) / 30%);
}

#time {
  position: relative;
  width: 100%;
  margin-left: 10px;
  pointer-events: auto;
}
#time input[type="range"] {
  -webkit-appearance: none;
  margin: 17px 0;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: rgb(var(--color) / 50%);
  /* box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */
}
#time input[type="range"]:focus {
  outline: none;
}
#time input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  border-radius: 3px;
  background: transprent;
}
#time input[type="range"]::-webkit-slider-thumb {
  height: 30px;
  width: 30px;
  border-radius: 50%;
  background: rgb(251, 207, 123);
  border: 1px solid rgb(var(--color) / 20%);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -13px;
}
#hourOutput {
  position: absolute;
  top: -50%;
  left: calc(43.4783% + 2.6087px);
}
#hourOutput span {
  color: #000;
  font-size: 0.9em;
  position: relative;
  left: -50%;
  top: 30px;
  border-radius: 50%;
  pointer-events: none;
}

#printscreen .legend > div > div > p {
  margin-top: 0;
  margin-bottom: 10px;
}
#printscreen .legend input[type="text"] {
  background-color: transparent;
  border: 1px solid rgb(var(--color) / 15%);
  color: rgb(var(--color) / 90%);
  padding: 7px 10px;
  border-radius: 4px;
  width: 100%;
}
#printscreen .legend input[type="text"]:focus-visible {
  background-color: rgb(var(--color) / 4%);
}
#printscreen .legend .add {
  margin: 8px 0 20px;
  border-radius: 4px;
  background-color: #4d89a7;
  color: #fff;
  font-weight: 400;
  letter-spacing: 0.3px;
  border: none;
}
#printscreen .legend > div > div > ul > li {
  display: flex;
  align-items: center;
  margin: 0 -24px;
  padding: 6px 24px;
  transition: background-color 0.2s ease;
}
#printscreen .legend > div > div > ul > li:hover {
  background-color: rgb(var(--color) / 3%);
}
#printscreen .legend .image {
  width: 42px;
  height: 42px;
  border-radius: 100%;
  overflow: hidden;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}
#printscreen .legend .image img {
  height: 100%;
}

#printscreen .legend .content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  margin: 0 10px;
  -webkit-mask-image: linear-gradient(
    to right,
    rgb(var(--color)) 70%,
    rgb(var(--color) / 0%)
  );
}
#printscreen .legend .content > div {
  font-size: 0.95em;
}

#printscreen .legend .btn {
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgb(var(--color) / 4%);
  border-radius: 100%;
  font-size: 1.3em;
  cursor: pointer;
}
#printscreen .legend .btn.close {
  transform: rotate(45deg);
  margin-left: 4px;
}
#printscreen .legend > div > div button {
  padding: 6px 12px;
  font-size: 0.9em;
  border: 1px solid rgb(var(--color) / 10%);
}
#printscreen .legend .buttons {
  pointer-events: none;
  opacity: 0.3;
  margin-top: 20px;
  text-align: right;
}
#printscreen.legend-open .legend .buttons.active {
  pointer-events: auto;
  opacity: 1;
}
#printscreen .legend .buttons button:last-of-type {
  color: rgb(var(--background));
  font-weight: bold;
  background-color: rgb(var(--color) / 90%);
  margin-left: 10px;
}

#printThis {
  display: none;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }
  body > .wrapper,
  body > header {
    display: none;
  }
  #printThis {
    display: block;
  }
  #printThis > div {
    position: relative;
    min-height: 100vh;
    padding: 34px 50px;
  }
  #printThis header {
    display: flex;
    align-items: center;
  }
  #printThis header img {
    height: 50px;
  }
  #printThis header .content {
    text-align: right;
    flex: 1;
  }
  #printThis header .content > div {
    color: rgba(0, 0, 0, 0.8);
    font-weight: bold;
  }
  #printThis .image {
    margin-top: 26px;
    text-align: center;
  }
  #printThis .image img {
    width: 100%;
  }
  #printThis footer {
    position: absolute;
    bottom: 34px;
    left: 0;
    width: 100%;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: rgb(0 0 0 / 30%);
  }
}

#toggle {
  margin-right: 32px;
  opacity: 0.7;
  cursor: pointer;
}

@media screen and (max-width: 981px) {
  #toggle,
  #settings,
  #printscreen,
  .tooltip {
    display: none;
  }
  #cesiumContainer {
    margin-left: 0;
  }
  #toolbar {
    background-color: transparent;
    pointer-events: none;
  }
  #toolbar > div {
    pointer-events: auto;
  }
  #toolbar > div > button > .icon {
    background-color: rgb(var(--background) / 50%);
  }
  #toolbar > div > button:hover > .icon,
  #toolbar > div.legend-open > button > .icon {
    background-color: rgb(var(--background));
  }
  #toolbar .legend {
    top: 25px;
    bottom: unset;
    left: var(--toolbar-width);
    border-radius: 6px;
    width: 300px;
  }
  #toolbar .legend > div {
    position: relative;
    top: 0;
    height: unset;
  }

  .ctrl.top-right {
    right: 10px;
  }

  #toggle {
    margin-right: 22px;
  }
}

#infoBox {
  overflow: hidden;
  border-radius: 4px;
  padding: 4px 8px;
  position: absolute;
  z-index: 999999999;
  background-color: rgb(var(--background) / 90%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#infoBox.active {
  opacity: 1;
}
#infoBox .type {
  font-size: 0.8em;
}
