:root {
  --primary: #2b9b9f;
  --primary-light: #00868b;

  --border-light: #949494;
  --white-hover: #f5f5f5;
}

.leaflet-control-container > div:not(.leaflet-right) {
  display: none;
}

aside {
  width: 100%;
  min-width: 380px;
  max-width: 1176px;
  height: auto;
  transition: all 0.3s ease-in-out;
  container-type: inline-size;
  z-index: 1;
}

aside .input-group {
  max-width: 100%;
  width: 100%;
}
aside .input-group .input-group-text,
aside .input-group input {
  border: 1px solid #949494;
}

.sortBy.gap-1,
aside .gap-1 {
  gap: 6px;
}

aside .gap-4 {
  gap: 16px;
}

aside .theme-btn-primary {
  background-color: var(--primary);
}

aside .theme-btn-primary:hover {
  background-color: var(--primary-light);
}

aside .input-switch {
  display: flex;
  align-items: center;
  justify-content: center;
}

aside .search-center {
  background-color: #949494;
  border: 0px solid #949494;
}

aside .search-center:hover {
  background-color: #9f9f9f;
}

aside .switch-search {
  cursor: pointer;
  background-color: white;
}

aside .switch-search:hover {
  background-color: var(--white-hover);
}

.sortBy label,
aside .input-switch label {
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
  text-underline-offset: 3px;
}

.sortBy input,
aside .input-switch input {
  appearance: none;
}

aside .input-switch .button {
  height: 48px;
  border: 1px solid var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

aside .input-switch .button:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

aside .input-switch .button:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

aside .input-switch .button:has(input:checked) {
  background-color: var(--primary);
  color: white;
}

aside .input-switch .button:has(input:checked):hover {
  background-color: var(--primary-light);
}

aside .input-switch .button:has(input:not(:checked)):hover {
  border: 1px solid var(--primary);
  background-color: var(--white-hover);
}

aside button {
  height: 48px;
  border: var(--primary) 1px solid;
  background-color: var(--primary);
  color: white;
  border-radius: 4px;
  user-select: none;
}

aside .station-card {
  min-width: 300px;
  height: auto !important;
}

.sortBy label {
  color: #757575;
}

.sortBy .input-switch :not(label) {
  pointer-events: none;
}

.sortBy label {
  pointer-events: initial;
}

.sortBy[value="price"] .distance,
.sortBy[value="distance"] .price {
  color: #005E61;
  text-decoration: underline;
}

.sortBy[value="price"] .distance:hover,
.sortBy[value="distance"] .price:hover {
  color: var(--primary-light);
}

/**
 MODE = search | result
**/
aside:not([mode="search"]) [for="search"],
aside:not([mode="result"]) [for="result"] {
  display: none !important;
}

aside[mode="result"] .list-container {
  display: flex;
}

aside[mode="search"]{
  overflow-y: scroll;
  overflow-x: hidden;
}

aside[mode="search"] .btn-toggle,
aside[mode="search"] .list-container {
  display: none;
}

aside .ads-rect,
aside:not([mode="search"]) .ads-square{
  display: none;
}

aside[mode="search"] .ads-square{
  display: inline-block;
}

aside .list-container {
  border-top: 1px solid #949494;
  padding: 16px 20px;
  flex-grow: 1;
  transition: all 300ms ease-in-out;
}

aside .list {
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-evenly;
  overflow-y: auto;
}

aside .btn-toggle button {
  display: flex;
  white-space: nowrap;
  height: auto;
}

aside .btn-toggle svg {
  width: 14px;
  pointer-events: none;
  transition: all 0.3s ease-in-out;
}

aside:not([view="map"]) .btn-toggle .list-view,
aside:not([view="list"]) .btn-toggle .map-view {
  display: none;
}

aside[view="map"] .btn-toggle svg {
  transform: rotate(180deg);
}

aside[view="list"] .btn-toggle svg {
  transform: rotate(0deg);
}

aside .controls {
  display: flex;
  top: 0;
  right: 0;
  transform: translateX(calc(100% + 10px)) translateY(20px);
  justify-content: center;
  align-items: center;
}

aside .controls button.toggle-size {
  display: none;
  color: #2b9b9f;
  transition: all 0.3s ease-in-out;
}

aside[mode="result"] .controls button.toggle-size {
  display: flex;
}

aside[collapse="true"] .controls button.toggle-size {
  transform: rotate(180deg);
}

aside .controls .btn-group-vertical button {
  width: 30px;
}

aside .controls button {
  height: auto;
  background-color: white;
  color: #575757;
  border-color: #949494;
  width: 36px;
  height: 36px;
}

aside .controls button:first-child {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

aside .controls button:last-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

aside .controls svg {
  font-size: 13px;
}

.list .station-card.filler {
  display: none;
}

aside[mode="result"] {
  width: 100%;
  height: 100%;
}

aside[mode="result"][view="map"] {
  height: auto;
  height: fit-content;
}

aside[mode="result"] .input-group {
  display: none;
}

#page-content-wrapper {
  width: 100%;
}

/** MOBILE **/
@media (max-width: 575px) {
  .navbar {
    box-shadow: none;
  }
}

@media (max-width: 767px) {
  aside[mode="result"][view="map"] {
    height: auto;
    height: fit-content;
  }

  aside[mode="result"][view="map"] .list-container {
    max-height: 0;
    padding: 0 20px;
  }

  aside[loggedin="1"] .for-guest {
    display: none !important;
  }

  aside .ads-square{
    display: none!important;
  }
  aside .ads-rect{
    display: inline-block!important;
  }
}

/** SMALL **/
/* 2 columns */
@container (min-width: 756px) and (max-width: 1101.5px) {
  .list[two="1"] .station-card.filler:nth-last-child(2) {
    display: flex;
  }
}

/* 3 columns */
@container (min-width: 1101.5px) {
  .list[three="1"] .station-card.filler,
  .list[three="2"] .station-card.filler:nth-last-child(2) {
    display: flex;
  }
}

/** MEDIUM **/
@media (min-width: 768px) {
  aside[mode="result"][collapse="true"],
  aside[mode="search"] {
    max-width: 380px;
    width: 100%;
  }

  #page-content-wrapper {
    min-width: 70px;
    width: auto;
  }

  aside[mode="result"]:not([collapse="true"]) div[for="result"] .sortBy {
    display: flex !important;
  }

  aside[mode="result"]:not([collapse="true"]) form {
    flex-direction: row !important;
    align-items: center;
  }

  aside[mode="result"]:not([collapse="true"]) .list-container .sortBy,
  aside .btn-toggle {
    display: none !important;
  }

  aside[mode="result"] {
    height: 100%;
  }
}
