:root {
  --black: #000000 !important;
  --black_hover: #999999 !important;
  --white: #FFFFFF !important;
  --grey: #515151 !important;

  --calcite-color-foreground-1: #ffffff !important;
  --calcite-action-text-color-pressed: #1a1a1a !important;
  --calcite-action-background-color-hover: #999999 !important;
  --calcite-color-foreground-2: #2E2E2E !important;
}

calcite-action {
  --calcite-action-background-color-hover: var(--white);
  --calcite-action-background-color-press: var(--white);
  --calcite-action-background-color: var(--white);
  --calcite-action-background-color-hover:var(--black_hover);
  --calcite-action-background-color-press:var(--black);
  --calcite-action-indicator-color: var(--black_hover);
  --calcite-action-text-color-press: var(--black);
  --calcite-action-text-color: var(--black);
  
}

calcite-action-bar {
  --calcite-action-bar-background-color: var(--white);
  --calcite-action-text-color: var(--black);
  --calcite-icon-color: #1a1a1a;
}

calcite-action-group {
  --calcite-action-background-color: var(--white);
  --calcite-action-group-border-color: var(--black);
}

calcite-button {
  --calcite-button-background-color: var(--white);
  --calcite-button-border-color: var(--black_hover);
  --calcite-button-corner-radius: 0px;
  --calcite-button-icon-color: var(--black);
  --calcite-button-loader-color: var(--black);
  --calcite-button-shadow-color: var(--white);
  --calcite-button-text-color: var(--black);
}

calcite-icon {
  --calcite-icon-color: var(--black);
}

calcite-shell-panel {
  --calcite-shell-panel-background-color: #515151!important;
  --calcite-shell-panel-border-color: var(--white);
  --calcite-shell-panel-resize-icon-color: var(--black);
  --calcite-shell-panel-text-color: var(--black);
  --calcite-shell-panel-width: 200px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

calcite-panel {
  --calcite-color-background: #ffffff !important;
  --calcite-color-text-1: #151515 !important;
  --calcite-color-text-2: #151515 !important;
  --calcite-color-text-3: #666666 !important;
  --calcite-color-foreground-1: #ffffff !important;
}

calcite-sheet {
  --calcite-color-background: #ffffff !important;
  --calcite-color-foreground-1: #ffffff !important;
  --calcite-color-text-1: #151515 !important;
  --calcite-color-text-2: #151515 !important;
  --calcite-color-text-3: #666666 !important;
  position: absolute !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  right: auto !important;
  width: 100% !important;
  max-width: 400px !important;
}

#mobileSheet {
  position: absolute !important;
  max-width: 400px !important;
}

/* Ensure sheet stays within map boundaries */
#map_shell calcite-sheet {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  max-width: 400px !important;
}

/* Override sheet's internal positioning */
#mobileSheet::part(scrim),
#mobileSheet::part(container) {
  position: absolute !important;
}

/* Ensure any calcite overlays stay within map shell */
#map_shell .calcite-scrim {
  position: absolute !important;
  inset: 0 !important;
}

calcite-panel::part(content) {
  color: #1a1a1a !important;
  background: #ffffff !important;
}

calcite-panel::part(header) {
  color: #1a1a1a !important;
  background: #ffffff !important;
}

calcite-panel::part(heading) {
  color: #1a1a1a !important;
}

arcgis-features {
  height: 100%;
}

arcgis-map {
  height: 100%;
}

arcgis-legend,
.esri-legend {
  max-height:240px !important;
  max-width:240px !important;
}

#map_shell {
  position: relative;
  display: grid;
  grid-template: "content" 100% / auto;
  height: 50vh;
  margin-bottom: 1rem;
  border: 1px solid #cdcdcd;
  transition: height 0.3s ease-in-out;
  overflow: hidden;
  isolation: isolate;
  contain: layout style;
  transform: translate3d(0, 0, 0);
}

.arcgis-search__form {
  margin: 0 0 0;
}

.esri-widget__heading {
  color: #1a1a1a !important;
}

.esri-features__container{
  padding:0px !important;
}

.hide {
  display: none !important;
  visibility: hidden !important;
}

.info-item {
  padding: 16px;
  background-color: transparent;
  border-bottom: 2px solid #e5e5e5
  ;
}

.info-label {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: capitalize;
  letter-spacing: 0.25px;
}

.info-value {
  color: #1a1a1a;
  font-size: 12px;
  line-height: 1.3;
  text-transform: capitalize !important;
  margin-left:1rem;
}

.kv {
  margin-bottom: 10px;
  background: transparent;
  border-left: 4px solid #ffffff;
  padding: 10px;
  border-radius: 6px;
}

.kv .k {
  font-weight: 700;
  margin-bottom: 4px;
  color: #1a1a1a;
}

.kv div:not(.k) {
  text-transform: capitalize;
}

.muted {
  color: #cccccc;
}

/* Positioning for Calcite cards */
.summary-card {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  max-width: 260px;
}

.legend-card {
  position: absolute;
  bottom: 24px;
  left: 12px;
  z-index: 100;
  min-width: 200px;
}

/* Styling for desktop cards - override global dark theme with light theme defaults */
calcite-card.summary-card,
calcite-card.legend-card {
  --calcite-color-background: #ffffff !important;
  --calcite-color-foreground-1: #ffffff !important;
  --calcite-color-text-1: #151515 !important;
  --calcite-color-text-2: #151515 !important;
  --calcite-color-text-3: #666666 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Style legend item text */
calcite-card.legend-card .legend-item span {
  font-weight: 500;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  transition: opacity 0.2s;
}

.legend-item:hover {
  opacity: 0.8;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-symbol {
  width: 16px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}



.legend-symbol.full {
  background: #EA663F;
  height: 4px;
  width: 16px;
  transition: background-color 0.2s, opacity 0.2s;
}


.legend-symbol.schools{
  background: #269913;
  height: 4px;
  width: 16px;
  transition: background-color 0.2s, opacity 0.2s;
}

.legend-symbol.limited{
  background: #01AEF0;
  height: 4px;
  width: 16px;
  transition: background-color 0.2s, opacity 0.2s;
}



.legend-item.hidden .legend-symbol.intersection {
  background: #cccccc;
  opacity: 0.5;
}

.legend-item.hidden .legend-symbol.full,
.legend-item.hidden .legend-symbol.school,
.legend-item.hidden .legend-symbol.limited {
  background: #cccccc;
  opacity: 0.5;
}

.legend-item.hidden .legend-label {
  opacity: 0.5;
  color: #999999;
}

.legend-label {
  flex: 1;
  color: #151515 !important;
}

.legend-toggle {
  background: none;
  border: 1px solid #999999;
  color: #151515;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.legend-toggle:hover {
  background: #e0e0e0;
  border-color: #666666;
}

.legend-toggle.hidden {
  background: #e0e0e0;
  color: #666666;
  border-color: #cccccc;
}

.pill {
  display: inline-block;
  background: #e0e0e0;
  color: #151515;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  margin-right: 4px;
  margin-bottom: 2px;
}

/* Mobile button to open sheet - positioned within map shell */
.mobile-info-button {
  display: none;
  position: absolute;
  bottom: 27px;
  left: 12px;
  z-index: 200;
}

/* Mobile sheet content styles */
.mobile-sheet-content {
  padding: 20px;
}

.mobile-sheet-content .summary-card {
  position: relative;
  top: 0;
  left: 0;
  max-width: 100%;
  margin-bottom: 24px;
}

.mobile-sheet-content .legend-card {
  position: relative;
  bottom: 0;
  left: 0;
  min-width: auto;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .mobile-info-button {
    display: block;
  }

  /* Hide desktop summary and legend panels on mobile */
  .summary-card,
  .legend-card {
    display: none !important;
  }

  /* Keep mobile sheet content visible */
  .mobile-sheet-content .summary-card,
  .mobile-sheet-content .legend-card {
    display: block !important;
  }

  #map_shell {
    /* height: 100vh; */
    margin-bottom: 0;
  }
}

/* Desktop: Hide mobile button */
@media (min-width: 769px) {
  .mobile-info-button {
    display: none !important;
  }
}

/* Popup styling for mobile - dark theme */
.esri-popup {
  --calcite-color-background: #ffffff !important;
  --calcite-color-text-1: #1a1a1a !important;
  --calcite-color-text-2: #1a1a1a !important;
  --calcite-color-text-3: #1a1a1a !important;
}

/* Hide popup on desktop - only show side panel */
@media (min-width: 769px) {
  .esri-popup {
    display: none !important;
    visibility: hidden !important;
  }
}

.esri-popup__header {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
}

.esri-popup__header-title {
  color: #1a1a1a !important;
}

.esri-popup__content {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
}

.esri-popup__button {
  color: #ffffff !important;
}

.esri-popup__action {
  color: #ffffff !important;
}

.esri-popup__action:hover {
  background-color: #2E2E2E !important;
}

