/* === Global Reset === */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* Prevent scrollbars */
  font-family: Arial, sans-serif;
}

/* === Map === */
#map {
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 1;
}
#mapLogoContainer {
  position: absolute;
  top: 2px;       /* Adjust as needed */
  left: 1px;      /* Adjust as needed */
  transform: none; /* Remove centering transform */
  z-index: 999999;
  width: 150px;  /* Set as needed */
  height: auto;
  pointer-events: auto;
}
#mapLogoContainer img {
  width: 100%;
  height: auto;
}

#mapLogo {
  max-height: 42px;
  opacity: 0.4; /* fairly transparent */
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));
}

#searchToggleBtn {
  position: absolute;
  top: 40px;
  left: 10px;
  z-index: 6;
  width: 58px;
  height: 58px;
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2); /* frosted white glass */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* for Safari */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#searchToggleBtn:hover {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

#searchToggleBtn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}



#searchPanel {
  position: absolute;
  top: 40px;
  left: 10px;
  z-index: 7;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  border-radius: 10px;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#mapboxgl-ctrl-geocoder mapboxgl-ctrl {
    min-width: 200px;
    width: 200px;
    }
#geocoder-container .mapboxgl-ctrl-geocoder {
  width: 100%;
  font-size: 14px;
  border-radius: 6px;
}

#searchPanel .mapboxgl-ctrl-geocoder input[type="text"],
#searchPanel input[type="number"] {
  transition: all 0.3s ease;
  outline: none;
  width: 100%;
  padding: 8px;
  font-size: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

#searchPanel .mapboxgl-ctrl-geocoder input[type="text"]:focus,
#searchPanel input[type="number"]:focus {
  transform: scale(1.03);
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.4);
  border-color: #007bff;
}
#clearHistoryBtn {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  text-align: right;
  cursor: pointer;
  padding: 4px;
  margin-bottom: 6px;
  margin-left: auto;
  display: block;
}
#clearHistoryBtn:hover {
  color: red;
}

/* Fix overlapping search icon in Mapbox Geocoder */
.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon-search {
  top: 50% !important;
  transform: translateY(-50%) !important;
  left: 10px !important;
  pointer-events: none;
}

.mapboxgl-ctrl-geocoder input[type="text"] {
  padding-left: 34px !important; /* Space for the icon */
}


#historyToggle {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.47)
  colour: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.mapboxgl-ctrl-geocoder {
    min-width: 200px;
}
#historyList {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  max-height: 150px;
  overflow-y: auto;
  font-size: 13px;
}

#historyList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 14px;
  border-bottom: 1px solid #444;
}

#historyList li span {
  flex: 1;
  cursor: pointer;
}

#historyList li:hover {
  background-color: #333;
}

.delete-entry {
  background: none;
  border: none;
  color: red;
  font-size: 18px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* === Thermal Forecast Box === */
#thermalBox {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  max-width: 500px;

  /* Glassmorphism */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);

  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: max-height 0.3s ease, border-radius 0.3s ease;
  overflow: hidden;
  max-height: 36px;
}

#thermalBox.expanded {
  max-height: 75vh;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  display: block;
  flex-direction: column;
  z-index: 10;
}
#thermalBox.collapsed {
  display: none;
}
/* Header (Top Clickable Strip) */
#thermalHeader {
  height: 36px;
  line-height: 36px;
  font-size: 15px; /* slightly larger for readability */
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  user-select: none;

  color: #ffffff;
  background-color: rgba(30, 30, 30, 0.25); /* more contrast, reliable fallback */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  will-change: backdrop-filter;
  transform: translateZ(0); /* force GPU acceleration on Safari */

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}


/* Image Scroll Area */
#thermalImageScroll {
  flex: 1 1 auto;
  max-height: 100%;
  overflow-y: auto;
  padding: 10px;
  background: rgba(222, 222, 222, 1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

/* Forecast Image */
#thermalImage {
  display: none;
  width: 100%;
  height: auto;
  max-height: 50vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
  position: relative;
}

/* Placeholder Text */
#thermalPlaceholder {
  z-index: 2;
  text-align: center;
  padding: 10px;
  color: rgba(0, 0, 0, 0.65);
  font-size: 17px;
  display: block;
  font-style: normal;
}

/* Modal Image Styles */
.modal {
  display: none; /* this is hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal:not(.hidden) {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 10px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
}

/* === Map Controls === */
.mapboxgl-ctrl-top-right .mapboxgl-ctrl {
  margin: 10px;
  position: relative; /* or absolute */
  top: 30px !important;
}

.mapboxgl-ctrl-geolocate,
.mapboxgl-ctrl-compass {
  width: 38px !important;
  height: 38px !important;
}

.mapboxgl-ctrl-zoom-in,
.mapboxgl-ctrl-zoom-out {
  display: none !important;
}
/* button for 3d */

.mapboxgl-ctrl-group .map-style-toggle {
  width: 38px;
  height: 38px;
  font-weight: bold;
  font-size: 13px;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mapboxgl-ctrl-group .map-style-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}
/* Prevent zooming on iOS */
#searchPanel input[type="text"],
#searchPanel input[type="number"],
.mapboxgl-ctrl-geocoder input {
  font-size: 16px !important;
}

/* ai toggle button */
#aiPanel {
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%);
  height: 100%;
  width: 320px;
  max-width: 100%;
  padding: 20px;
  z-index: 9999;

  /* Glassy, frosted look */
  background: rgb(0 0 0 / 48%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);

  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;

  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
  will-change: transform;
  color: black;
  line-height: 1.6;
  font-size: 16px;
  -webkit-overflow-scrolling: touch;
}
#aiPanel.active {
  transform: translateX(0);
}

#aiToggleBtn {
  position: fixed;
  top: 181px;
  left: 53px;
  transform: translateX(-50%);
  z-index: 1;
  padding: 10px 16px;

  color: white;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  cursor: pointer;

  background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(59, 130, 246, 0.25));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

  animation: bounce 1s infinite;
  display: none;
  transition: all 0.3s ease;
}

#aiToggleBtn:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}


@keyframes bounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(7px); }
}
#aiCloseBtn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 38px;
  color: #fff;
  cursor: pointer;
}
#aiPanel.active {
  transform: translateX(0);
}
.ai-panel-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #ffffff;
  border-bottom: 1px solid #ccc;
  padding-bottom: 6px;
}

#aiOutput {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-top: 12px;
  padding-bottom: 60px; /* so long text doesn’t get cut off */
  color: white;
}
.ai-output-text {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #111827;
  white-space: pre-wrap;
}

/* footer */

#verticalFooter {
  position: fixed;
  bottom: 265px; /* Move it up from the absolute bottom */
  right: 2px;
  transform: rotate(-90deg);
  transform-origin: bottom right;
  background: rgba(255, 255, 255, 0);
  font-size: 10px;
  padding: 6px 10px;
  z-index: 2;
  white-space: nowrap;
}

#verticalFooter a {
  color: #333;
  text-decoration: none;
  font-weight: bold;
}

#verticalFooter a:hover {
  text-decoration: underline;
}



/* ai */
.hour-pill {
  background: #f1f5f9;
  border-radius: 10px;
  margin: 6px 0;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #cbd5e1;
}

.pill-header {
  padding: 10px 14px;
  font-weight: 600;
  background-color: #e2e8f0;
  cursor: pointer;
}

.pill-body {
  max-height: 0;
  padding: 0 14px;
  font-size: 14px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.hour-pill.expanded .pill-body {
  max-height: 500px;
  padding: 10px 14px;
}
#aiOutput {
  font-family: 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}
#aiOutput h2 {
  font-size: 16px;
  font-weight: bold;
  margin: 16px 0 8px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
}

#aiOutput strong {
  font-weight: bold;
  color: #ffffff;
}
#settingsBtn {
  position: absolute;
  top: 105px;
  left: 10px;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.2); /* semi-transparent glassy layer */
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#settingsBtn:hover {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

#settingsBtn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

/* style.css (example - adjust as needed for your design) */
.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px; /* Or whatever width you prefer */
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    backdrop-filter: blur(8px); /* Glassmorphism effect */
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    transform: translateX(100%); /* Start off-screen to the right */
    transition: transform 0.3s ease-out; /* Smooth slide-in/out */
    z-index: 1000; /* Ensure it's above other elements */
    padding: 20px;
    box-sizing: border-box; /* Include padding in the width/height */
    overflow-y: auto; /* For scrollable content if it gets long */
}

.settings-panel.active {
    transform: translateX(0); /* Slide into view */
}

.settings-panel .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

.settings-panel h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.setting-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}
/*altitude*/

.altitude-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.altitude-modal.hidden {
  display: none;
}

.altitude-box {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  text-align: center;
  width: 280px;
  color: #fff;
}

.altitude-box input {
  width: 180px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  margin: 10px 0;
  text-align: center;
  font-size: 16px;
}

.altitude-buttons button {
  margin: 0 10px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.8);
  color: #000;
  font-weight: bold;
}


/* hotspots button */

#hotspotToggleContainer {
  position: absolute;
  top: 210px;
  right: 8px;
  z-index: 1;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  font-family: Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
}

.hotspot-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: white;

}

.hotspot-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  background-color: white;
  border-radius: 4px;
  margin-right: 8px;
  position: relative;
}

.checkmark::after {
  content: "✔︎";
  color: black;
  font-weight: bold;
  position: absolute;
  left: 3px;
  top: -1px;
  font-size: 16px;
  display: none;
}

.hotspot-checkbox input[type="checkbox"]:checked + .checkmark::after {
  display: block;
}

.label-text {
  font-size: 12px;
  font-weight: 500;
}

/* Basic map button styling */
#statsButton {
  position: absolute;
  top: 170px; /* Placed right below the 58px tall search/settings button + margin */
  left: 10px;
  z-index: 6;
  width: 58px;
  height: 58px;
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2); /* frosted white glass */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#statsButton:hover {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Optional: Glow effect when area is selected */
.statsIcon.glow {
  box-shadow: 0 0 10px 3px rgba(0, 200, 255, 0.8);
  background: rgba(255, 255, 255, 0.25);
}

#statsButton img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}

.map-toggle-group {
  position: absolute;
  top: 250px; /* adjust based on your layout */
  right: 8px;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
}

.map-radio {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  cursor: pointer;
}

.map-radio:last-child {
  margin-bottom: 0;
}

.map-radio input[type="radio"] {
  margin-right: 6px;
}

.radio-label {
  font-size: 13px;
  color: white;
}

/* Basic Navigation Styling */
.main-nav {
    background-color: rgba(0, 0, 0, 0.7); /* Dark semi-transparent background */
    padding: 10px 20px;
    display: flex;
    justify-content: flex-end; /* Align to the right */
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; /* Ensure it's above the map */
    color: white;
}

.main-nav a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #4CAF50; /* Example hover color */
}

.main-nav {
    margin-right: auto; /* Pushes other links to the right */
    font-size: 0.9em;
    color: #eee;
}
.user-info {
  font-size: 0.9em;
  top: 40px;
  color: #fff; /* White text */
  background-color: #5a5a5a; /* A darker, more prominent background */
  padding: 6px 14px; /* More padding */
  border-radius: 20px; /* Makes it pill-shaped */
  white-space: nowrap;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* Subtle shadow for depth */
}

.user-info .username {
  font-weight: bold;
  color: #e0e0e0;
}

.user-info .credits {
  font-size: 1em;
  color: #c0c0c0;
}
/* Flash Messages Styling */
/* Container positioning */
#flash-messages-container {
    position: fixed;
    top: 68px; /* 5px lower than your previous 60px */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers the message box */
    width: 100%; /* container spans width, but children fit content */
    pointer-events: none; /* Allows clicking through the empty space around the message */
}

/* The Dark Glassy Bubble */
.flash-message {
    pointer-events: auto; /* Re-enable clicking on the message itself */
    width: fit-content; /* Shrinks to fit text exactly */
    max-width: 70%;     /* Prevents it from getting too wide on mobile */
    padding: 12px 30px;
    margin-bottom: 10px;

    /* Typography */
    color: #ffffff;     /* Bright white text */
    font-family: sans-serif;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.5px;

    /* Liquid Glass Effect */
    background: rgba(20, 20, 20, 0.75); /* Dark semi-transparent background */
    backdrop-filter: blur(12px);        /* The "frosted" blur effect */
    -webkit-backdrop-filter: blur(12px); /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.15); /* Subtle white glass edge */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); /* Deep shadow for depth */

    border-radius: 50px; /* Fully rounded "pill" shape */

    /* Animation settings */
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
    animation: floatIn 0.5s ease-out;
}

/* Optional: Slight color tints for Success/Error via Border/Glow
   (Keeps background dark to maintain the glass look) */
.flash-message.success {
    border-color: transparent; /* Removes the border line */
    box-shadow: none;          /* Removes the glow */
}

.flash-message.danger {
    border-color: rgba(231, 76, 60, 0.5); /* Reddish tint on edge */
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.2); /* Red glow */
}

/* The Close 'X' Button */
.close-btn {
    margin-left: 15px;
    cursor: pointer;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s;
}

.close-btn:hover {
    color: #fff;
}

/* Animation for entering */
@keyframes floatIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Authentication Modal Styles */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Darker overlay */
    backdrop-filter: blur(8px); /* Glass effect */
    -webkit-backdrop-filter: blur(8px); /* For Safari support */
    z-index: 1000; /* Ensure it's on top of everything */
    display: flex; /* Use flexbox for centering */
    justify-content: center;
    align-items: center;
    opacity: 0; /* Start hidden */
    visibility: hidden; /* Start hidden for accessibility/pointer events */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    background-color: rgba(255, 255, 255, 0.2); /* Semi-transparent white background for content box */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Light border */
    border-radius: 15px;
    padding: 30px 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    text-align: center;
    max-width: 450px;
    width: 90%;
    color: white; /* Text color for modal content */
    backdrop-filter: blur(5px); /* Extra blur for content box */
    -webkit-backdrop-filter: blur(5px);
}

.auth-modal-content h2 {
    font-size: 2.2em;
    margin-bottom: 25px;
    color: #fff; /* White heading */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.auth-modal-content p {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #e0e0e0;
}

.auth-modal-content .form-group {
    margin-bottom: 18px;
    text-align: left;
}

.auth-modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.auth-modal-content input[type="text"],
.auth-modal-content input[type="password"] {
    width: calc(100% - 24px); /* Full width minus padding */
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1); /* Slightly transparent input background */
    color: white;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.auth-modal-content input[type="text"]:focus,
.auth-modal-content input[type="password"]:focus {
    border-color: rgba(255, 255, 255, 0.8);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.auth-modal-content input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.auth-modal-content .modal-login-btn {
    background-color: #007BFF; /* Blue button */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.auth-modal-content .modal-login-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.auth-modal-content .modal-register-text {
    margin-top: 25px;
    font-size: 0.95em;
    color: #e0e0e0;
}

.auth-modal-content .modal-register-text a {
    color: #87CEEB; /* Lighter blue for links */
    text-decoration: none;
    font-weight: 600;
}

.auth-modal-content .modal-register-text a:hover {
    text-decoration: underline;
}

.modal-overlay {
  display: none;
}
.modal-overlay:not(.hidden) {
  display: flex;
}
.confirmation-btn {
  margin: 10px 5px 0 5px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirmation-btn.confirm {
  background-color: #28a745;
  color: white;
}

.confirmation-btn.confirm:hover {
  background-color: #218838;
}

.confirmation-btn.cancel {
  background-color: #dc3545;
  color: white;
}

.confirmation-btn.cancel:hover {
  background-color: #c82333;
}
   #soundingBtn {
        position: absolute;
        top: 240px; /* Placed below statsButton (170px + 58px + 12px gap) */
        left: 10px;
        z-index: 6;
        width: 58px;
        height: 58px;
        padding: 10px;
        border: none;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px; /* Emoji size */
        cursor: pointer;
        transition: background 0.3s ease, box-shadow 0.3s ease;
    }

    #soundingBtn:hover {
        background: rgba(255, 255, 255, 0.3);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    }

    /* === Sounding Panel Styles === */
    .sounding-panel {
        position: fixed;
        top: 0;
        right: -700px; /* Hidden by default */
        width: 600px; /* Wider for chart */
        max-width: 95vw;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: -2px 0 15px rgba(0,0,0,0.2);
        z-index: 2000;
        transition: right 0.3s ease;
        padding: 20px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .sounding-panel.open {
        right: 0;
    }

    #soundingChartContainer {
        position: relative;
        height: 500px;
        width: 100%;
        margin-top: 20px;
        background: rgba(255,255,255,0.5);
        border-radius: 8px;
        padding: 10px;
    }

    .stat-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 15px;
        font-size: 0.9rem;
    }

    .stat-box {
        background: #f3f4f6;
        padding: 10px;
        border-radius: 6px;
        text-align: center;
    }

    .stat-label { font-size: 0.75rem; color: #666; text-transform: uppercase; }
    .stat-val { font-weight: bold; font-family: monospace; font-size: 1.1rem; }


/* Circular Progress Loader */
.ai-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.circular-progress {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(closest-side, white 79%, transparent 80% 100%),
                conic-gradient(#3b82f6 var(--progress, 0%), #e5e7eb 0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: --progress 0.1s linear; /* Smooth transition */
}

.circular-progress::before {
    content: attr(data-value) '%';
    font-size: 1.2rem;
    font-weight: bold;
    color: #374151;
}

.loading-text {
    font-size: 2rem;
    color: #ffff;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Game Container underneath */
#gameContainer {
    width: 100%;
    max-width: 350px;
    height: 200px; /* Smaller height for the mini-game */
    margin-top: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
/* =========================================
   SPOTAIR BUTTON POSITIONING
   ========================================= */
.glass-btn-container {
    position: fixed;
    /* DEFAULT STATE: User's requested position */
    top: 250px;
    right: 8px;

    z-index: 3000; /* Must be higher than overlay (2000) */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;

    /* Enable smooth movement animation */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ACTIVE STATE: Moves to top-right when map is open */
.glass-btn-container.active-pos {
    top: 20px;  /* Moves up to the corner */
    right: 20px;
}

/* =========================================
   LOGO ANIMATION STYLES
   ========================================= */
/* Target the existing ID from your HTML */
#mapLogoContainer {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy smooth transition */
}

/* The class we will add via JavaScript */
.centered-logo {
    position: fixed !important;
    top: 5% !important; /* Sits nicely in the upper-middle area */
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important; /* Centers it and makes it larger */

    z-index: 3001 !important; /* Above the overlay (2000) and button (3000) */
    pointer-events: none; /* Critical: allows clicking the map THOUGH the logo */

    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3)); /* Nice shadow for depth */
    opacity: 0.9;
}

/* =========================================
   WRAPPER: CONTROLS POSITION ON SCREEN
   ========================================= */
.floating-btn-wrapper {
    position: fixed;
    top: 250px;    /* Top Right Corner */
    right: 8px;
    z-index: 10;  /* Behind the overlay (2000) */

    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =========================================
   LIQUID GLASS BUTTONS
   ========================================= */
.liquid-button {
    width: 50px;
    height: 50px;
    padding: 0;
    margin: 0;
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.6);

    transform: translateZ(0);
    transition: all 0.2s ease-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), inset 0 1px 1px rgba(255,255,255,0.7);
    overflow: hidden;
    cursor: pointer;
}

.liquid-button::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), transparent);
    border-radius: 14px 14px 50% 50%;
    pointer-events: none;
}

.liquid-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15), inset 0 1px 1px #fff;
}

.liquid-button:active {
    transform: translateY(1px);
}

.liquid-button.active {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(255, 230, 230, 0.9);
}

/* =========================================
   TEXT & LABELS
   ========================================= */
#btnContent {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.btn-text-view { font-size: 9px; font-weight: 700; color: #374151; margin-bottom: 2px; }
.btn-text-live { font-size: 10px; font-weight: 900; color: #ef4444; }

.glass-btn-label {
    font-size: 9px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(255,255,255,1);
    background: rgba(255,255,255,0.6);
    padding: 2px 5px;
    border-radius: 4px;
    margin-top: 6px;
    backdrop-filter: blur(4px);
}

/* =========================================
   ANIMATIONS
   ========================================= */
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    position: absolute;
    top: 6px; right: 6px;
    box-shadow: 0 0 5px #ef4444;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); opacity: 1; }
    70% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

/* =========================================
   PANELS & OVERLAYS
   ========================================= */
.spotair-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    /* Z-Index Hierarchy: Button is 10, Overlay is 2000 */
    z-index: 2000;
    transform: translateY(100%);
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.spotair-overlay.visible {
    transform: translateY(0);
}