/* #region ===== BASE STYLES ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100svh;
  width: 100vw;
  display: flex;
  overflow: hidden;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  gap: 1rem;

  --s: 70px;
  --c1: #2d5a7d;
  --c2: #54aac3;
  --_g: radial-gradient(calc(var(--s) / 2), var(--c1) 97%, #0000);
  background: var(--_g), var(--_g) calc(2 * var(--s)) calc(2 * var(--s)), repeating-conic-gradient(from 45deg, #0000 0 25%, var(--c2) 0 50%) calc(-0.707 * var(--s)) calc(-0.707 * var(--s)),
    repeating-linear-gradient(135deg, var(--c1) calc(var(--s) / -2) calc(var(--s) / 2), var(--c2) 0 calc(2.328 * var(--s)));
  background-size: calc(4 * var(--s)) calc(4 * var(--s));
}

.header {
  background: #fff8;
  backdrop-filter: blur(2px);
  border-bottom: 3px solid white;
  padding: 0rem 2.5rem;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: absolute;
  margin-left: calc(50% - 74px);
  top: 0;
  left: 0;
  z-index: 1000;
  border-radius: 0% 0% 50vw 50vw;
}

.logo {
  height: 12vh;
  filter: drop-shadow(0 0 5px white) drop-shadow(0 0 5px white) drop-shadow(0 0 5px white);
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.floating-buttons {
  position: absolute;
  bottom: 30px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1000;
}

.fab {
  background: #fff8;
  backdrop-filter: blur(2px);
  border: none;
  border-top: 3px solid white;
  border-bottom: 3px solid white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.7rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.fab-add,
.fab-focus {
  display: none;
}

.fab-filter {
  position: relative;
}

#search-incentive {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#incentive-text {
  font-size: 1rem;
  font-weight: bold;
  position: absolute;
  top: 56%;
  right: 180%;
  text-shadow: 0 4px 20px #0007;
}

#incentive-img {
  height: 30px;
  width: 80px;
  position: absolute;
  top: -9%;
  right: 110%;
  filter: drop-shadow(0 4px 20px #0007);
}

#search-icon-tip {
  display: none;
  position: absolute;
  bottom: 0;
  right: 0;
  translate: 40% 50%;
  font-size: 1.5rem;
  padding: 0.2rem;
  background: #000000ba;
  border-radius: 50%;
  cursor: pointer;
  aspect-ratio: 1;
}

#refresh-btn {
  display: none;
  position: absolute;
  background: transparent;
  top: 0%;
  right: 100%;
  border: none;
  height: 60px;
  font-size: 2rem;
  cursor: pointer;
}

.main-container {
  height: 100%;
  width: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
}

.crosshair {
  width: 20px;
  height: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 400;
  display: none;
  filter: brightness(0);
  opacity: 0.5;
}

.status-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff8;
  backdrop-filter: blur(2px);
  border: none;
  border-top: 3px solid white;
  border-bottom: 3px solid white;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  text-align: center;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
}

/* #endregion */

/* #region ===== ADS         ===== */

.ad-panel {
  position: relative;
  flex: 1;
  height: 100svh;
  border: 3px solid rgb(0, 45, 92);
  max-width: 20%;
}

.ad-panel::before {
  content: "publicité";
  position: absolute;
  left: 5px;
  top: 0;
  color: rgb(0, 45, 92);
  font-weight: bold;
  z-index: 200;
}

.ad-panel::after {
  content: "publicité";
  position: absolute;
  right: 5px;
  bottom: 0;
  color: rgb(0, 45, 92);
  font-weight: bold;
}

/* #endregion */

/* #region ===== MAP         ===== */

.map-container {
  flex: 1;
  position: relative;
  background: #f7fafc;
}

.map {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

.leaflet-popup-tip-container,
.leaflet-container a.leaflet-popup-close-button {
  display: none !important;
}

.leaflet-popup-content {
  margin: 0 !important;
}

/* #endregion */

/* #region ===== MENUS       ===== */

.overlay {
  transition: all 0.3s ease-in-out;
  translate: 120% 0;
}

.overlay.active {
  translate: 0 0;
}

.filter-menu,
.add-menu,
.report-menu {
  padding: 2rem 1rem;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff8;
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  flex-direction: column;
}

#addInstructions {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
}

#addInstructionsText {
  flex: 1;
  text-align: center;
  width: 70%;

  & b {
    color: #ff5400;
    font-size: 1.5rem;
  }
}

#addInstructionsBtn {
  background: #fff8;
  border: none;
  border-top: 3px solid white;
  border-bottom: 3px solid white;
  border-radius: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 1rem 3rem;
  font-weight: bold;
}

.report-menu {
  gap: 1rem;
}

.pick-reason-text {
  text-align: center;
  font-weight: 600;
}

.reason-founded-text {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  text-align: center;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.filter-header,
.add-header,
.report-header {
  display: flex;
  width: 100%;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #242629;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
}

.close-btn,
.clear-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.clear-btn {
  display: none;
}

/* Categories list */
.categories-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  padding-right: 1rem;
  padding-top: 2rem;
}

#addCategoriesList {
  display: none;
}

.category-section {
  display: flex;
  border-radius: 15px;
  transition: all 0.3s ease;
  position: relative;
  background: #f7fafc;
}

.category-header {
  background: var(--bg-color);
  border-radius: 15px 0 0 15px;
  border-right: 2px solid black;
  width: 2rem;
  position: relative;
  overflow: hidden;
}

.category-icon {
  position: absolute;
  bottom: 4px;
  font-size: 2.5rem;
  left: 54%;
  translate: -50% 0;
}

.category-name {
  position: absolute;
  writing-mode: vertical-rl;
  top: 1rem;
  left: 50%;
  translate: -50% 0%;
  font-weight: 600;
  rotate: 180deg;
  color: white;
  opacity: 0.9;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  background: white;
  padding: 0.5rem;
  flex: 1;
  height: 100%;
  border-radius: 0 15px 15px 0;
}

.report-grid {
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  grid-template-columns: repeat(2, 1fr);
}

.item-tile {
  background: white;
  border: 2px dotted var(--bg-color);
  border-radius: 10px;
  padding: 0.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  isolation: isolate;
  aspect-ratio: 1.3;
}

.favorite-tile {
  border: 2px dotted var(--bg-color);
}

.item-db {
  position: absolute;
  right: 4px;
  top: 4px;
  font-size: 0.5rem;
  font-weight: bold;
}

.item-icon {
  position: absolute;
  left: 50%;
  top: -4px;
  translate: -50% -50%;
  font-size: 2rem;
  z-index: -1;
  transition: all 0.3s ease;
  --os: 2px;
  text-shadow: 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK,
    0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK,
    0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK, 0 0 var(--os) BLACK;
}

.item-icon::before {
  content: "";
  position: absolute;
  height: 5px;
  bottom: 0;
  left: 18%;
  width: 66%;
  background-color: var(--bg-color);
  filter: blur(5px) brightness(0.7);
  z-index: -1;
}

.item-name {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 95%;
  translate: -50% -50%;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
  word-break: break-word;
}

.item-name.bigger {
  font-size: 1rem;
}

.item-tile.filtered .item-name {
  text-shadow: 0 0 10px #7c4926, 0 0 10px #7c4926, 0 0 20px #7c4926, 0 0 20px #7c4926, 0 0 20px #7c4926;
}

.favorite-star {
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  filter: brightness(0);
  opacity: 0.2;
}

.favorite-star.favorited {
  filter: brightness(1);
  opacity: 1;
}

.item-tile {
  position: relative;
}

.items-favorites {
  margin-bottom: 2rem;
  border-radius: 15px;
}

/* #endregion */

/* #region ===== MARKERS     ===== */
.custom-marker-container {
  background: transparent !important;
  border: none !important;
}

.custom-marker {
  background: #2c5a7c;
  padding: 1rem;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-content: center;
  font-size: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  text-shadow: 0 0 10px #213645, 0 0 10px #263a49;
}

.marker-content {
  position: relative;
  margin: 0;
  min-width: 120px;
  max-width: 170px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 3px;
  background: #2c5a7c;
}

.marker-background {
  padding: 0.5rem;
  border-radius: 10px;
  background-color: #79c2df;
}

.marker-icon {
  position: absolute;
  translate: -50% -50%;
  font-size: 1.5rem;
  left: 50%;
  top: 50%;
  background: #2c5a7c;
  display: grid;
  place-content: center;
  border-radius: 50%;
  padding: 1rem;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  place-content: center;
  font-size: 1.5rem;
  text-shadow: 0 0 10px #213645, 0 0 10px #263a49;
  transition: all 0.3s ease;
}

.marker-icon.shown {
  left: 0;
  top: 0;
}

.marker-title {
  text-align: center;
  text-shadow: 0 0 10px black;
  color: white;
  font-size: 1rem;
  font-weight: 600;
}

.marker-direction-btn {
  position: absolute;
  right: -65px;
  top: 50%;
  translate: 0.5rem -50%;
}

.marker-report-btn {
  position: absolute;
  right: -135px;
  top: 50%;
  translate: 0.5rem -50%;
}

.marker-delete-btn {
  position: absolute;
  right: -135px;
  top: 50%;
  translate: 0.5rem -50%;
}

.user-marker-container {
  background: transparent !important;
  border: none !important;
}

.leaflet-popup-content-wrapper {
  padding: 0 !important;
  background: none;
  box-shadow: none;
}

.user-marker {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
}

.custom-cluster-icon {
  background: transparent !important;
  border: none !important;
}

.cluster-icon {
  background: #78c1df;
  border: 3px solid #2c5a7c;
  border-radius: 50%;
  padding: 1rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.cluster-small {
  width: 30px;
  height: 30px;
  font-size: 1rem;
}

.cluster-medium {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.cluster-large {
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
}

/* Override default MarkerCluster styles */
.marker-cluster-small {
  background: transparent !important;
}

.marker-cluster-small div {
  background: transparent !important;
}

.marker-cluster-medium {
  background: transparent !important;
}

.marker-cluster-medium div {
  background: transparent !important;
}

.marker-cluster-large {
  background: transparent !important;
}

.marker-cluster-large div {
  background: transparent !important;
}

/* #endregion */

/* #region ===== RESPONSIVE  ===== */

/* Mobile stuff */
@media (max-width: 768px) {
  body {
    gap: 0;
  }

  .ad-panel {
    display: none;
  }
}

/* Browser stuff */
@media (min-width: 768px) {
  body {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .main-container {
    height: 97vh;
    width: 140vh;
    overflow: hidden;
    box-shadow: 0 0 20px #0006;
    border-radius: 15px;
  }

  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
  }

  .close-btn:hover,
  .clear-btn:hover {
    background: #f7fafc;
  }

  .item-tile:hover .item-icon {
    scale: 1.2;
    translate: -50% -60%;
  }

  .floating-buttons {
    bottom: auto;
    top: 20px;
  }

  .filter-menu,
  .add-menu,
  .report-menu {
    left: auto;
    right: 0;
    width: 500px;
    padding: 1rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  }

  .item-tile:hover {
    transform: translateY(-3px);
    border-color: black;
    border-style: solid;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    background-color: var(--bg-color);
    color: white;
  }

  .item-icon {
    font-size: 2rem;
  }

  .items-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .favorite-star:hover {
    filter: brightness(1);
    transform: scale(1.2);
    opacity: 1;
  }

  .favorite-star.favorited:hover {
    transform: scale(1.2);
    filter: brightness(0);
  }

  .custom-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  }

  .cluster-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
}

/* #endregion */
