/* public/styles/style.css */
/* Global styles for the main map page (index.ejs) */
/* Covers the bottom drawer, filter drawer, info popup, tutorial popup,
   floating UI buttons, and easter egg animations */

body {
  background: #000;
}

/* Bottom drawer - slides up from the bottom when .open is added */
#drawer,
#filter-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 300px;
  background: var(--theme);
  color: var(--theme-text);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#drawer.open,
#filter-drawer.open {
  transform: translateY(0);
}

/* Scrollable drawer content area with max height */
#drawer-content.drawer-scroll {
  overflow-y: auto;
  min-height: 0;
  max-height: 28vh;
}

/* Crowd check-in count row inside the drawer */
.drawer-crowd-checkins {
  border-radius: 8px;
  border: 1px solid gray;
  background: var(--theme-light);
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  align-self: center;
  max-width: 450px;
  width: 100%;
}

.drawer-crowding-label {
  font-weight: 500;
  color: var(--theme-text-dark);
}

.drawer-crowding-value {
  margin-left: 0.25rem;
  font-weight: 600;
  color: var(--theme-text);
}

/* Crowd panel - contains average busyness and recent reports */
.drawer-crowd-panel {
  display: flex;
  flex-direction: column;
  max-height: 32vh;
  overflow-y: auto;
}

.drawer-crowd-section-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--theme-text-dark);
  margin: 0.25rem 0 0;
}

/* Average busyness indicator with colour-coded background */
.drawer-crowd-average {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 8px;
  padding: 0.75rem;
}

.drawer-crowd-average-text {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
}

#drawer-crowd-average-icon {
  filter: var(--theme-filter);
  width: 30px;
  height: 30px;
}

.drawer-crowd-meta {
  font-size: 0.8rem;
  color: var(--theme-text-dark);
  margin: 0;
}

/* Individual crowd report row */
.drawer-crowd-report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--theme-light);
  border: 1px solid gray;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.drawer-crowd-report-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-crowd-report-label {
  font-weight: 500;
}

.drawer-crowd-report-time {
  font-size: 0.75rem;
  color: var(--theme-text-dark);
}

/* Drawer action buttons */
#drawer-actions {
  width: 100%;
  justify-content: center;
  align-items: center;
}

#drawer-close {
  position: absolute;
  right: 0%;
  margin: 20px;
  width: 35px;
  height: 35px;
  color: #fff;
  background: linear-gradient(31deg, #cb0000, #ff1f71);
  font-weight: bolder;
  cursor: pointer;
  transition: all 200ms ease-in-out;
}
#drawer-close:hover {
  box-shadow: 0 0 10px rgb(255, 0, 98);
  transform: scale(1.15);
}

.drawer-btn-primary {
  background: linear-gradient(350deg, #0050c7, #0077ff);
  color: #fff;
  font-weight: bold;
  transition: all 200ms ease-in-out;
  width: 100%;
  max-width: 450px;
  letter-spacing: 2.5px;
}
.drawer-btn-primary:hover {
  box-shadow: 0 0 10px #0077ff;
  letter-spacing: 4px;
  filter: hue-rotate(-30deg);
}

.chat-btn {
  filter: hue-rotate(50deg);
}
.chat-btn:hover {
  filter: hue-rotate(65deg);
}

/* Floating UI buttons - temperature box, settings, and filter */
div.current-temp-box,
#settings-btn,
#filter-btn {
  transition: bottom 0.3s ease;
  background: var(--theme);
  color: var(--theme-text);
  box-shadow: gray 0 3px 5px;
}

/* Invert button icons to match current theme */
#settings-btn img,
#filter-btn img {
  filter: var(--theme-filter);
}

#info-btn {
  background-color: #fff;
  filter: var(--theme-filter);
}

/* Slide filter button up when the filter drawer is open */
#filter-drawer.open ~ #filter-btn {
  bottom: 300px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

#nav-filter {
  width: 90%;
}

.filter-item label {
  background: var(--theme-light);
  color: var(--theme-text);
  border-radius: 12px;
  border: 2px solid gray;
  width: stretch;
  text-align: center;
  margin: 0 5px;
  top: 0px;
  transition: all 200ms ease-in-out;
}
.filter-item label:hover {
  top: -3px;
  position: relative;
  box-shadow: 0 0 10px gray;
}

.filter-item input:checked + label {
  filter: sepia(2) hue-rotate(170deg) saturate(4);
}

/* UV info popup - shown when the info button is clicked */
#info-popup {
  position: absolute;
  right: 0;
  background: var(--theme);
  color: var(--theme-text);
  border-radius: 12px;
  padding: 12px;
  z-index: 9998;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
}

#info-popup.open {
  display: block;
}

/* Vertically center the MapLibre navigation controls */
.maplibregl-ctrl-top-right {
  top: 50% !important;
  transform: translateY(-50%) !important;
  right: 16px !important;
}

/* Floating temperature display padding using Tailwind spacing scale */
#floating-temp {
  padding: calc(var(--spacing) * 4) calc(var(--spacing) * 8);
}

/* Standard size for map UI icon buttons */
img.btn-icon {
  width: 50px;
  height: 50px;
}

/* Search Bar */
#map-search-bar {
  background: var(--theme);
  box-shadow: gray 0 3px 5px;
  border: none;
}
#map-search {
  color: var(--theme-text);
}
#map-search::placeholder {
  color: var(--theme-text-dark);
  opacity: 1;
}

.search-select {
  color: var(--theme-text-dark);
}
#search-sort-by,
#search-sort-order {
  background: var(--theme-light);
  color: var(--theme-text);
  border-color: gray;
}

.result-item {
  background: linear-gradient(45deg, var(--theme-light), var(--theme));
  color: var(--theme-text);
  margin: 10px 0;
  padding: 10px;
  transition: all 200ms ease-in-out;
}
.result-item:hover {
  filter: sepia(2) saturate(4) hue-rotate(180deg);
}
.result-site {
  font-weight: bold;
  width: stretch;
  text-align: right;
}

/* Easter egg - winter mode popup fade-in animation */
@keyframes winterFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Easter egg - snowflake falling animation with horizontal drift */
@keyframes snowfall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(var(--drift)) rotate(360deg);
    opacity: 0;
  }
}
