:root {
  --base-size: 16px;

  /* Default Theme Colors */
  --color-delivered: #2c423f;
  --color-upcoming: #17a2b7;
  --color-ongoing: #4bb384;
}

html {
  /* Dynamic scale: (16px / 1920) * 100vw */
  font-size: calc(min(20px, (var(--base-size) * (100vw / 1680px))));
}

@media (max-width: 1024px) {
  html {
    /* Scale up slightly on smaller screens to keep text readable */
    font-size: calc(min(20px, (var(--base-size) * (100vw / 1400px))));
  }
}

@media (max-width: 768px) {
  html {
    /* Fixed minimum scaling for mobile-ish sizes */
    font-size: 16px;
  }
}

/* 
 * Always set the map height explicitly to define the size of the div element
 * that contains the map. 
 */
#map {
  height: 100%;
}

#marker {
  height: 6.25rem;
  display: flex;
}

/* 
   * Optional: Makes the sample page fill the window. 
   */
html {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  /* font: 400 0.6875rem Roboto, Arial, sans-serif; */
  font-weight: 400;
  font-family: Roboto, Arial, sans-serif;
}

h3 {
  color: #5d3c28;
  font-size: 1rem;
  margin: 0;
  padding: 0;
  font-weight: 700;
  text-align: center;
}




/* HTML marker styles */
.element-container {
  /* background-color: #93939335; */
  /* border-radius: 0.5rem; */
  color: #FFFFFF;
  font-size: 0.875rem;

  /* height: 12.5rem; */
  /* margin: 0.9375rem; */
  width: 6.25rem;
  /* width: auto; */

  display: flex;

  gap: 0.625rem;
  justify-content: center;
  align-items: center;
  border-radius: 12.5rem;
}

.element-container.bottom {
  flex-direction: column;
  justify-content: flex-start;
}

.element-container.top {
  flex-direction: column-reverse;
  justify-content: flex-start;
}



/* themed marker state colours, replace with theme variables */
.origin {
  /* height: 34px !important; */
}



.below-text {
  position: absolute;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  /* align-items: center; */
  opacity: 0.8;
  top: 50%;
  left: 50%;
  color: #ffffff;
  max-width: 16rem;
  min-width: 5rem;
  /* background-color: #00000056 !important; */
}

.below-text .origin-category {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 0.125rem;
  font-weight: 500;
  max-width: 100%;
  width: max-content;
}


.below-text.bottom {
  transform: translateX(-50%);
  margin-top: 3.375rem;
}

.below-text.top {
  transform: translateY(-100%) translateX(-50%);
  margin-top: -3.375rem;
}

.below-text.left {
  transform: translateY(-50%) translateX(-100%);
  margin-left: -2.2rem;
}

.below-text.right {
  transform: translateY(-50%);
  margin-left: 2.2rem;
}



.element-item.hovered #subtitle {
  opacity: 0;
}

.element-item.clicked #subtitle {
  opacity: 1;
}


.element-item {
  /* Shared Unified Color Logic removed from here, moving to specific classes */
  /* --bg-normal: ...; */

  /* background-color: var(--bg-normal); */
  /* border-color: var(--border-normal); */
  /* color: #FFFFFF; */

  text-align: center;
  border-width: 0.125rem;
  border-style: solid;
  font-size: 0.875rem;
  font-weight: 500;
  height: 100%;
  padding: 0.625rem 0.9375rem;

  display: flex;

  gap: 0.625rem;
  justify-content: center;
  align-items: center;
  border-radius: 12.5rem;

  /* box-shadow: 0 0 0.8125rem 0.125rem #2a2a2a2e; */

}

.element-item.hovered {
  /* background-color: var(--bg-hover); */
  /* border-color: var(--border-hover); */
  /* color: #2b5194; */

  border-width: 0.125rem;
  border-style: solid;
  font-size: 0.875rem;
  font-weight: 500;
  height: 100%;
  padding: 0.625rem 0.9375rem;

  display: flex;

  gap: 0.625rem;
  justify-content: center;
  align-items: center;
  border-radius: 12.5rem;
}

.element-item.deactivated {
  opacity: 0.3;
}

.below-text.deactivated {
  opacity: 0.3;
}

.element-item.hovered.deactivated {
  opacity: 0.6 !important;
}

#icon.element-item {
  /* small */
  /* font-size: 1.5rem; */

  /* big */
  font-size: 1.75rem;
  padding: 0.625rem 0.625rem;
}

#text.element-item {
  pointer-events: none;
  opacity: 0;
  /* Initially hidden */
  transform: translateX(20%);
  /* Slide in from the right */
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.element-item#text.hovered {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

.element-item#text.clicked {
  outline-width: 0 !important;
}

#text.element-item.right {
  display: none;
  /* Start non-interactive */
  opacity: 0;
  /* Initially hidden */
  transform: translateX(20%);
  /* Slide in from the right */
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;

}

.element-item#text.right.hovered {
  opacity: 1;
  transform: translateX(0);
}

#text.element-item.left {
  display: none;
  opacity: 0;
  /* Initially hidden */
  transform: translateX(-20%);
  /* Slide in from the right */
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.element-item#text.left.hovered {
  opacity: 1;
  transform: translateX(0);
}

.element-item.clicked {
  /* background-color: var(--bg-hover); */
  /* border-color: var(--border-hover); */
  color: #FFFFFF;

  border-width: 0.125rem;
  border-style: solid;
  /* outline-width: 0.3125rem;
  outline-style: solid; */
  /* border-radius: 0.5rem; */
  font-size: 0.875rem;
  font-weight: 500;
  height: 100%;
  /* margin: 0.625rem; */
  padding: 0.625rem 0.9375rem;

  display: flex;

  gap: 0.625rem;
  justify-content: center;
  align-items: center;

  box-shadow: 0 0 0.8125rem 0.125rem #2a2a2a2e;

  /* Set a size for your container */
  /* width: 2.5rem; */
  /* height: 2.5rem; */

  /* Optionally add a border or background */
  border-radius: 12.5rem;
  /* Round corners for a nice effect */
  /* background-color: #ccc; Subtle light gray background */
}



.element-item .element-item-hovered .element-item-clicked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 0);
  width: 0;
  height: 0;
  border-left: 0.5rem solid transparent;
  border-right: 0.5rem solid transparent;
  border-top: 0.5rem solid #000;
}



/* additional marker colour variants, only use for testing, refrain from using for final version */


/* Base Color Definitions */
/* Base Color Definitions & Mixin Application */
/* The user wants the properties (bg, border) applied here so they are reusable */

.delivered {
  --base-color: var(--color-delivered);

  --bg-normal: color-mix(in srgb, var(--base-color), transparent 15%);
  --border-normal: var(--base-color);
  --bg-hover: var(--base-color);
  --border-hover: color-mix(in srgb, var(--base-color), black 30%);

  background-color: var(--bg-normal);
  border-color: var(--border-normal);
  color: #FFFFFF;
}

.upcoming {
  --base-color: var(--color-upcoming);

  --bg-normal: color-mix(in srgb, var(--base-color), transparent 15%);
  --border-normal: var(--base-color);
  --bg-hover: var(--base-color);
  --border-hover: color-mix(in srgb, var(--base-color), black 30%);

  background-color: var(--bg-normal);
  border-color: var(--border-normal);
  color: #FFFFFF;
}

.ongoing {
  --base-color: var(--color-ongoing);

  --bg-normal: color-mix(in srgb, var(--base-color), transparent 15%);
  --border-normal: var(--base-color);
  --bg-hover: var(--base-color);
  --border-hover: color-mix(in srgb, var(--base-color), black 30%);

  background-color: var(--bg-normal);
  border-color: var(--border-normal);
  color: #FFFFFF;
}

/* Hover/Active States */
.delivered.hovered,
.delivered.clicked,
.delivered.active,
.upcoming.hovered,
.upcoming.clicked,
.upcoming.active,
.ongoing.hovered,
.ongoing.clicked,
.ongoing.active {
  background-color: var(--bg-hover);
  border-color: var(--border-hover);
  outline-width: 0.3125rem;
  outline-style: solid;
  outline-color: #ffffff;
  /* Keeping original outline logic if needed, but centering on color updates */
}

/* Remove old specific styles as they are now handled by variables in .element-item etc */
/* Keeping only bare minimum if needed, but the unified logic above covers BG/Border */

/* styles for below text - assuming they inherit or use similar logic if needed, 
   but original CSS had them transparent/white mostly. 
   Let's keep text color white as per original. */
.below-text.delivered,
.below-text.upcoming,
.below-text.ongoing {
  color: #ffffff;
}

.below-text.delivered.hovered,
.below-text.upcoming.hovered,
.below-text.ongoing.hovered {
  color: #ffffff;
  outline-width: 0 !important;
}

.below-text.delivered.clicked,
.below-text.upcoming.clicked,
.below-text.ongoing.clicked {
  color: #ffffff;
}

.active {
  animation: pulse 0.1s infinite;
  /* Example animation */
}


/* variants new names */



#project-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.3125rem;
}

/* Custom scrollbar for project list */
#project-list::-webkit-scrollbar {
  width: 0.25rem;
}

#project-list::-webkit-scrollbar-thumb {
  background: #e9ecef;
  border-radius: 0.25rem;
}

.project-list-item {
  position: relative;
  padding: 0.625rem;
  border-radius: 0.5rem;
  background-color: #f8f9fa;
  background-size: cover;
  background-position: center;
  cursor: default;
  transition: all 0.2s ease;
  border: 0.0625rem solid #e9ecef;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 3.125rem;
  overflow: hidden;
  color: white;
  /* Default text to white for background images */
}

.mobile-item {
  min-height: 4rem;
}

.project-list-item.mobile-item.large-card {
  min-height: 4rem;
}

.project-list-item.large-card {
  min-height: 4.2rem;
}

.mobile-header {
  font-size: 0.8rem !important;
}

/* Dark gradient overlay for readability */
.project-list-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
  z-index: 0;
  transition: background 0.2s ease;
}

.project-list-item:hover::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.169) 0%, rgba(0, 0, 0, 0.921) 100%);
}

.project-text-container {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Light hover for non-clickable items (fallback context) */
.project-list-item:hover:not(.clickable) {
  border-color: #99aaa7;
}

/* Premium hover for clickable items */
.project-list-item.clickable {
  cursor: pointer;
}

.project-list-item.clickable:hover {
  /* transform: translateX(6px); */
  border-color: #ffffff;
}

.project-list-item .project-title {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.125rem;
  text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.8);
}

.project-list-item .project-developer {
  font-size: 0.6875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.03125rem;
  text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.8);
}


.project-list-group-header {
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #8c8c8c;
  letter-spacing: 0.0625rem;
  margin: 0.9375rem 0 0.3125rem 0.3125rem;
  padding-bottom: 0.25rem;
  border-bottom: 0.0625rem solid #eee;
}


/* Link indicator for markers and list items */
.link-indicator {
  font-size: 0.8125rem;
  opacity: 0.8;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
  text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.8);
}

.project-list-item:hover .link-indicator {
  opacity: 1;
}

.origin-title-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Migrated from index.html */
#overlay {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  width: 12.5rem;
  background: white;
  padding: 0.625rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

#brand-logo {
  display: none;
  width: 100%;
  border-radius: 0.25rem;
}

#brand-name {
  display: none;
  margin: 0.625rem 0 0 0;
  font-size: 1rem;
  text-align: center;
  color: #333;
}

#project-list {
  margin-top: 0.9375rem;
}

/* Mobile specific styling */
#mobile-overlay-logo,
#mobile-drawer {
  display: none;
}

@media (max-width: 768px) {
  #overlay {
    display: none !important;
  }

  #mobile-overlay-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 10rem;
    padding: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  #mobile-brand-logo {
    width: 100%;
    height: auto;
    border-radius: 0.25rem;
  }

  #mobile-brand-name {
    display: none;
    /* Hide name if logo exists, or use small text */
    font-size: 0.6rem;
    margin-top: 0.25rem;
  }

  #mobile-drawer {
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -0.25rem 0.625rem rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 20vh;
    /* Minimized state */
    padding: 1rem;
    padding-top: 0.5rem;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #mobile-drawer.maximized {
    max-height: 60vh;
  }

  .drawer-handle {
    width: 2.5rem;
    height: 0.25rem;
    background: #e9ecef;
    border-radius: 0.125rem;
    margin: 0 auto 0.75rem auto;
  }

  #mobile-project-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    overflow-y: hidden;
    /* Disable scroll when minimized */
    padding-bottom: 1rem;
  }

  #mobile-drawer.maximized #mobile-project-list {
    overflow-y: auto;
    /* Enable scroll when maximized */
  }

  #mobile-project-list .project-list-group-header {
    grid-column: span 2;
    margin: 0.5rem 0 0.25rem 0;
  }


  /* Custom scrollbar for mobile drawer */
  #mobile-project-list::-webkit-scrollbar {
    width: 0.25rem;
  }

  #mobile-project-list::-webkit-scrollbar-thumb {
    background: #f1f1f1;
    border-radius: 0.25rem;
  }
}

/* Hide UI elements initially until data is loaded */
body:not(.loaded) #overlay,
body:not(.loaded) #mobile-overlay-logo,
body:not(.loaded) #mobile-drawer {
  display: none !important;
}

/* Empty state overlay */
#empty-state-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 9999;
  /* Ensure it's on top of everything */
  color: #fff4ee;
  /* Match existing text color scheme */
  font-family: Roboto, Arial, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  /* text-shadow: 0 1px 2px rgba(139, 139, 139, 0.8); */
  pointer-events: auto;
  padding: 0rem;
  /* Block interactions behind it */
}

.empty-state-message {
  background-color: rgb(75, 80, 85);
  padding: 2rem 3rem;
  border-radius: 0.7rem;
  margin: 5rem;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.3);
  font-size: 1.2rem;
  text-align: center;
}

/* Helper to hide elements */
.hidden {
  display: none !important;
}

/* Filter Styles */
.filter-container {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
  justify-content: space-between;
  padding: 0.5rem 0.25rem 0;
  border-top: 1px solid #eee;
}

.filter-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.4;
  /* Default inactive state */
  /* transform: scale(0.95); */
  box-shadow: none;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
  text-align: center;
  width: 6rem;
  outline-width: 0 !important;
  /* Unified Color Logic for Pills - Inherits from .delivered etc logic now if classes are applied */
  /* --bg-normal: ...; handled by class .upcoming etc attached to the pill */
  /* --bg-active: var(--base-color); */

  /* background-color: var(--bg-normal); */
  /* color: white; */
  /* border: 1px solid transparent; */
}

/* Active State - Full Body Style */
.filter-pill.active {
  /* opacity: 1; */
  /* transform: scale(1); */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 1;
  /* color: white; */
  /* background-color: var(--bg-active); */
  /* Ensure text is white for colored backgrounds */
}

/* Variant Specific Styles (using existing color variables/classes logic) */



/* Hover Effects */
.filter-pill:hover {
  opacity: 0.8 !important;
}

.filter-pill.active:hover {
  opacity: 1 !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Mobile Specific */
#mobile-drawer .filter-container {
  margin-top: auto;
  /* Push to bottom if flex container allows */
  border-top: 1px solid #f1f1f1;
  padding-bottom: 1rem;
  padding-top: 1rem;
  /* Extra padding for bottom safe area */
  background: white;
  display: none;
}

/* Floating Desktop Filters */
#desktop-filters {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 0.75rem;
  border-radius: 1.0rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-top: none;
  z-index: 1000;
  min-width: 20rem;
}

/* Reset Button Styles */
.filter-pill.reset-btn {
  flex: 0 0 auto;
  /* Don't grow */
  width: unset;
  /* padding: 0; */
  border-radius: 50%;
  /* Circle */
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #6c757d;
  opacity: 1;
  /* Always visible but styled subtly */
}

.filter-pill.reset-btn:hover {
  background-color: #e9ecef;
  color: #495057;
  transform: rotate(90deg);
  /* specific transformation for reset */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-pill.reset-btn i {
  font-size: 1.2rem;
}

/* Hide desktop filters on mobile */
@media (max-width: 768px) {
  #desktop-filters {
    display: none !important;
  }
}


/* Hide UI elements initially until data is loaded */
body:not(.loaded) #overlay,
body:not(.loaded) #mobile-overlay-logo,
body:not(.loaded) #mobile-drawer,
body:not(.loaded) #desktop-filters {
  display: none !important;
}

/* Cluster Marker Styles */
.cluster-marker {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 9rem;
  /* Match element-container width if desired, or smaller */
  height: 6.25rem;
}

.cluster-icon {
  /* Inherits color logic from .delivered class added in JS */
  /* --base-color: var(--color-delivered); */

  color: #ffffff93;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  /* font-weight: 700; */
  box-shadow: 0 0 0.8125rem 0.125rem #2a2a2a2e;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;

  /* Ensure border style is set so the color from .delivered applies */
  border-style: solid;
  border-width: 0.125rem;
}

.cluster-marker:hover .cluster-icon {
  /* transform: scale(1.1); */
  /* background-color and border-color handled by .delivered.hovered/active logic if applicable? */
  /* Wait, .delivered.hovered logic applies to .delivered elements when THEY are hovered. */
  /* The hover is on .cluster-marker (parent). */
  /* So we might still need explicit override here OR ensure .cluster-icon gets .hovered class. */

  /* In script.js line 460, we have an event listener on clusterElement that calls markerHovered(clusterDummy). */
  /* markerHovered adds .hovered to the element (which is the clusterDummy). */
  /* clusterDummy.elementIcon is iconDiv. */
  /* So iconDiv (.cluster-icon.delivered) WILL get .hovered class! */
  /* So .delivered.hovered styles will apply automatically! */

  outline: 0.3125rem solid #ffffff;
}

.cluster-count {
  pointer-events: none;
}

.cluster-icon.deactivated {
  opacity: 0.3;
}

.cluster-icon.with-label {
  width: auto;
  padding: 0 1rem;
  border-radius: 12.5rem;
  min-width: 3rem;
  gap: 0.5rem;
}

.cluster-label {
  /* font-size: 0.75rem; */
  font-weight: 700;
  white-space: nowrap;
  color: #ffffff;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
}