/* Custom styles for Moncosta */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-feature-settings: normal;
    font-variation-settings: normal;
    -webkit-tap-highlight-color: transparent;
}

  
#map {
  height: 100vh;
  width: 100vw;
}

#control-panel {
  position: absolute;
  top: 0.1rem;
  left: 1rem;
  background-color: rgba(255,255,255,1);
  color: #1f2937; /* dark gray/black font */
  border-radius: 0.5rem; /* rounded corners */
  padding: 1rem;
  z-index: 1000;
  max-width: 250px;
  min-width: 250px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#control-panel.collapsed {
  opacity: 0;
  pointer-events: none;
}

  /* When hidden, slide control panel to the left */
#control-panel.hidden {
  transform: translateX(-260px); /* slide off-screen */
  opacity: 0;
}

#toggle-help {
  position: absolute;
  top: 5rem;
  right: 1rem;
}
#toggle-control {
  position: absolute;
  top: 8rem;
  right: 1rem;
}


#reset-view {
  position: absolute;
  top: 11rem;
  right: 1rem;
}

#toggle-panel {
  position: absolute;
  top: 14rem;
  right: 1rem;
}

#toggle-legend {
  position: absolute;
  top: 17rem;
  right: 1rem;
}
#toggle-info {
  position: absolute;
  top: 20rem;
  right: 1rem;
}


.toggle-button {
    width: 44px;
    height: 44px;
    background-color: #FFF;
    color: #1f2937;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 1.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.1s;
    z-index: 1100;
  }
  
  .toggle-button:hover {
    background-color: #bae6fd;
  }
  
  .toggle-button:active {
    transform: scale(0.95);
  }
  
  .leaflet-control-zoom {
    right: 1rem !important;
    left: auto !important;
  }

  .dd-selector{
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #1f2937;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .dd-selector:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  }

  .common-selector2 {
    /* width: 100%; */
    padding: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #1f2937;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .common-selector {
    width: 80%;
    padding: 0.3rem;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #1f2937;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
  
  .common-selector:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  }

  .icon-link {
    color: #1d4ed8; /* Light blue */
    text-decoration: none;
    transition: color 0.3s ease;
  }
  
  .icon-link:hover {
    color: #3b82f6; /* Medium blue on hover */
  }
  
  .icon-link:active {
    color: #60a5fa; /* Dark blue on click */
  }
  
  .legend-box {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.95);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 1100;
    font-size: 0.85rem;
    color: #1f2937;
  }
  
  .legend-box .legend-color {
    width: 20px;
    height: 10px;
    display: inline-block;      /* Makes it sit beside text */
    margin-right: 6px;
    border: 1px solid #aaa;
    flex-shrink: 0;
  }
  
  
  .legend-box.hidden {
    display: none;
  }
  
  .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background-color: #d1d5db;
    transition: 0.4s;
    border-radius: 24px;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
  }
  
  .switch input:checked + .slider {
    background-color: #3b82f6;
  }
  
  .switch input:checked + .slider:before {
    transform: translateX(20px);
  }
  #logo-container {
    background-color: #3b82f6; 
    border-radius: 0.5rem;
    text-align: center;
}

#logo-container img {
    /* height: 40px; */
    width: auto;
}

#basemap-picker {
  display: none;
  margin-top: 0.5rem;
}

.basemap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.basemap-thumb {
  cursor: pointer;
  text-align: center;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  padding: 0.25rem;
  transition: border-color 0.3s;
  background: #f9fafb;
}

.basemap-thumb img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 0.25rem;
}

.basemap-thumb span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #1f2937;
}

.basemap-thumb:hover {
  border-color: #3b82f6;
}

.basemap-thumb.active {
  border-color: #1d4ed8;
}
.info-box {
  position: absolute;
  top: 2rem;
  left: 0; /* will be set via JS */
  background-color: rgba(255, 255, 255, 1);
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 280px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  transition: opacity 0.3s ease-in-out;
}

.info-box.hidden {
  display: none;
}





#info-panel {
  position: absolute;
  top: 0.1rem;
  left: 300px; /* slightly more than the max-width of control-panel */
  background-color: rgba(255, 255, 255, 0.95);
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  width: auto;
  max-width: 90vw;
  transition: width 0.3s ease;
}

#info-panel.expanded {
  width: 600px; /* or whatever max width you need for the chart */
}

#info-panel.hidden {
  display: none;
}

/* Adjust position of info panel when control panel is hidden */
#info-panel.shift-left {
  left: 1rem; /* or 10px — aligns near the left edge */
  transition: left 0.3s ease;
}

#info-panel #close-info {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s ease;
}

#info-panel #close-info:hover {
  color: #dc2626;
}

.panel-title {
  margin-top: 0;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner.hidden {
  display: none;
}

/* About / Partners modal */

.about-modal-overlay {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;              /* center modal */
  align-items: center;
  justify-content: center;
}

.about-modal {
  background: #ffffff;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 24px 24px 28px;
  position: relative;
  box-sizing: border-box;
}

.about-modal-title {
  font-size: 1.25rem;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.about-modal-text {
  font-size: 0.9rem;
  color: #4b5563; /* soft gray */
  margin: 0 0 16px 0;
}

.about-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}

.about-modal-close:hover {
  color: #111827;
}

/* Logos layout */

.about-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.about-logo-slot {
  flex: 0 0 20%;       /* 5 columns on wide screens */
  max-width: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;    /* height of slot */
  box-sizing: border-box;
}

.about-logo-slot img {
  max-width: 100%;
  max-height: 80px;    /* logo size */
  object-fit: contain;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .about-logo-slot {
    flex: 0 0 33.333%; /* 3 per row on tablets/phones */
    max-width: 33.333%;
  }
}

@media (max-width: 480px) {
  .about-logo-slot {
    flex: 0 0 50%;     /* 2 per row on small phones */
    max-width: 50%;
  }
}
