/* =====================================================
   Ported from deprecated/assets/css/styles.css
   Image paths updated: ../img/ → ../images/
   ===================================================== */

/* This file is being deprecated as we migrate to Tailwind CSS */
/* Do not add new styles here */
/* Refactor existing styles to Tailwind CSS, when possible, remove old styles from here */
   
/* Removed dead CSS (April 2026 — Tier 1):
   - Tippy.js styles (was lines 29–52, 1894–1896): Tippy.js not loaded
   - Slider/histogram styles (was lines 827–940): slider_controller is a stub
   - #filter-list-container styles (was lines 1716–1751): element always display:none
   - Choropleth legend styles (was lines 1840–1895): feature not built

   Removed DataTables CSS (April 2026 — Tier 2):
   - #results-table and DataTables column-class styles: DataTables removed, replaced by Turbo Frame table
   - #data-table, .first-col, .dt-scroll-body: replaced by Tailwind in _table.html.erb

   Removed dataset card inner CSS (May 2026 — Tier 3, T3-C):
   - .grid-item .dataset-inner, .ds-content, a.expand, .expanded, h2, .ds-source a,
     .ds-callout, .ds-callout p, ul (was lines 1373–1431): migrated to UI::DatasetCardComponent (Tailwind)

   Removed report section CSS (May 2026 — Tier 3, T3-B):
   - .detail-section, .detail-table, .detail-na, .detail-flag, .detail-footnote were orphaned
     (no CSS defined) and are now replaced by UI::DetailSectionComponent (Tailwind)

   Removed legacy-only CSS (May 2026 — Tier 4, chore-remove-more-dead-css):
   - Map hover popup (.map-hover-*), green-bar, bwn-content-wrapper, filters-desktop-display,
     legacy filter menu footer / .btn-*-filters, category/column shells (.container-category-header,
     .container-filter, .btn-filter-options), water/sewer bill grid (.wsb-*, .container-water-sewer-bill-filter-grid),
     orphaned PWS report header rules, .slider-subhead, .hide-this, unused mobile hooks
     (.container-region-nav-mobile, #mobile-btn-*, .btn-close-map-info, .filter-menu-mobile, …).

   Removed dead layout hooks (May 2026 — Tier 5):
   - #wrapper-ui, #wrapper-map-ui (no matching elements in Rails app).
   - #container-zoom-to-loc and nested rules (element not in DOM; display:none shell).
   - Redundant first .mapboxgl-ctrl-geolocate block (superseded by later Mapbox overrides).
   - .mobile-header img.logo / img.nav (markup uses icon() SVGs, no matching elements).
*/

/*
Blue - 1054A8
Green - 4EA324
Light grey border - bfbfbf
*/

body{
  margin:0px;
  padding:0px;
  font-family: "Public Sans", Arial, Helvetica, sans-serif;
  font-style: normal;
}

.clear,
.clearfix{
  clear: both;
  display: block;
  overflow: hidden;
  visibility: hidden;
  width: 0;
  height: 0;
}


.hide-for-desktop{
  display:none;
}


#container-mobile-menu{
  display:none;
}

#container-mobile-menu ul{
  list-style: none;
  margin: 0px;
  margin-top: 0px;
  padding: 0px;
}



/* Main Content */


.container-main-content h3.placeholder{
  text-align: center;
  margin-top: 30%;
}

/* Map */
#container-map{
  background-color:#ccc;
  position:absolute;
  top:0;
  bottom:0;
  right:0;
  width:auto;
}

#map {
  width:100%;
  height:100%;
}

/* MAP UI */

/* map info tooltip */

.mapboxgl-popup-close-button{
  right: 15px;
  top: 10px;
  font-size: 2em;
}

.mapboxgl-popup-close-button:hover{
  background-color:#ececec;
}

.mapboxgl-popup-content{
  padding:0px;
  border-radius:20px;
}

.mapboxgl-popup-content .map-detail-header{
  padding:15px 55px 15px 30px;
  border-radius: 20px 20px 0px 0px;
  background-color:#ececec;
}

.mapboxgl-popup-content .map-detail-body{
  padding:10px 30px;
}

.mapboxgl-popup-content .map-detail-body p,
.mapboxgl-popup-content .map-detail-header p{
  font-size:1.2em;
  line-height:1.4;
  font-weight:400;
  margin: 0px 0px 2px 0px;
  padding: 0px;
}

.mapboxgl-popup-content .map-detail-body p strong,
.mapboxgl-popup-content .map-detail-header p strong{
  font-weight:500;
}

.mapboxgl-popup-content .map-detail-body p a{
  color:#333;
}

.infoBub {
  min-width: 280px;
}

.map-content-wrapper-desktop {
  position: absolute;
  right: 20px;
  bottom: 100px;
  z-index: 9;
  background-color: #fff;
  border: 1px solid #bfbfbf;
  border-radius: 20px;
  padding: 10px 20px;
  box-sizing: border-box;
}
turbo-frame#stats-bar:empty {
  display: none;
}

#container-map-content-bottom.has-stats {
  display: none;
}

.map-content-intro{
  max-width:310px;
  background-color:#fff;
}

.map-content-stats{
  max-width:420px;
  background-color: #7A7A7A;
}

ul.stats-list{
  list-style:none;
  padding: 0px;
  margin: 15px 5px;
}
ul.stats-list li{
  color:#fff;
  font-weight: bold;
  margin: 2px 0px;
}

#container-map-content-bottom h2{
  font-size:1.2em;
  line-height:1.4;
  margin:0px;
}

#container-map-content-bottom p{
  font-size:1em;
  line-height:1.4;
  margin: 10px 0px;
}


/* TABLE VIEW */

#container-table{
  background-color:#fff;
}

/* Styled scrollbars for the single table scroll container (handles both axes) */
.table-scroll {
  scrollbar-width: thin;
  scrollbar-color: #b0b0b0 #f1f1f1;
}
.table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.table-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: #b0b0b0;
  border-radius: 4px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: #888;
}
.table-scroll::-webkit-scrollbar-corner {
  background: #f1f1f1;
}



/* MAP MENUS — filter dropdown shell lives in Tailwind (`UI::FilterMenuComponent` / `.filter-dropdown`);
   content rules migrated to application.css. */

.hidden{
  display:none;
}

/* =====================================================================
   Table-mode: #container-table lives inside #container-map so the
   filter bar stays visible. Toggled via the .table-mode class on
   #container-map.
   ===================================================================== */

/* Table panel — hidden by default, fills the map container */
#container-map #container-table {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  z-index: 3; /* above map canvas, below filter bar (z-index: 5) */
}

/* table-mode: hide map canvas and map-only overlays */
#container-map.table-mode #map { display: none; }
#container-map.table-mode .hide-for-table { display: none; }
#container-map.table-mode .mapboxgl-ctrl-top-left { display: none; }

/* table-mode: show the table panel as a flex column so sticky headers and pinned footer work */
#container-map.table-mode #container-table {
  display: flex;
  flex-direction: column;
}

/* table-mode: hide stats bar (only relevant on the map view) */
#container-map.table-mode turbo-frame#stats-bar { display: none; }


/* REPORT */

.btn-report{
  background-color: #fff;
  border: 1px solid #bfbfbf;
  color: #444;
  border-radius: 50px;
  width:40px;
  height:40px;
  font-size: 1em;
  margin: 0;
  position: fixed;
  top: 20px;
  text-decoration: none;
  text-align: center;
  z-index:9;
}

.btn-report:hover{
  background-color: #f5f5f5;
}
.btn-print-report{
  right: 80px;
}

.btn-print-report img,
.btn-close-report img{
  width: 20px;
  height: auto;
  position: absolute;
  top: 10px;
  left: 10px;
}
.btn-close-report{
  right: 20px;
}

#container-report{
  width: 100%;
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 9999;
  background-color: #fff;
  height: 100vh;
  overflow-y: auto;
}

.container-report-section-inner{
  margin: 0 auto;
  max-width: 1200px;
  border: 1px solid #eee;
  padding: 40px;
  margin-top: 30px;
  background-color: #fff;
  margin-bottom:50px;
}

#container-report .container-report-body{
  margin-top:60px;
}
#container-report .container-report-body h2{
  font-size:1em;
  line-height:1.4;
  font-weight:500;
}

.container-section-inner{
  margin-top:40px;
}

.container-section-inner h3{
  margin:0px;
  font-size:16px;
}

#container-downloads .container-section-inner{
  margin: 40px 35px 0px 35px;
  overflow:auto;
  padding-bottom:50px;
}

#container-downloads .container-section-inner .container-content{
  max-width:600px;
}

#container-downloads .container-section-inner .container-content ul li{
  margin:8px 0px;
}

#container-downloads .container-section-inner .grid-conatiner{
  max-width:600px;
}

#container-downloads .container-section-inner .grid-conatiner .grid-row p{
  width:25%;
  height:auto;
  float:left;
}

#container-downloads .container-section-inner a,
#container-downloads .container-section-inner .grid-conatiner .grid-row p a{
  color:#000;
  font-weight:bold;
}

/****************/
/*** Datasets ***/
/****************/

/* Datasets section migrated to Tailwind (May 2026):
   _datasets.html.erb, dataset_card_component.html.erb
   is-checked utility moved to tailwind/application.css */

#container-datasets {
  right: 0;
  width: auto;
}

.datasets-header h3 {
  margin-bottom: 12px;
}

/* Loading mask */
#loading-mask {
  position: absolute;
  top: 0px;
  left: 0px;
  width:100%;
  height:100%;
  z-index: 1002;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
}
#loading-mask p{
  padding-top: 200px;
  font-size:1.4em;
  color:#fff;
}


/* Mapbox control overrides */
.mapboxgl-ctrl-geolocate {
  position: absolute;
  left: 250px;
  z-index: 1;
  top: -40px;
  border: 1px solid #ccc;
  border-radius: 20px;
}

.mapboxgl-ctrl-group button:only-child {
  border-radius: 20px;
  border: 1px solid #bfbfbf;
  background-color:#fff;
}


.mapboxgl-ctrl-top-left .mapboxgl-ctrl{
  background-color: transparent;
  box-shadow: none;
}

.mapboxgl-ctrl-group button:first-child,
.mapboxgl-ctrl-group button:last-child{
  border-radius: 20px;
  border: 1px solid #bfbfbf;
  background-color: #fff;
  width:31px;
  height:31px;
}

.mapboxgl-ctrl-group button:first-child:hover{
  background-color:#f5f5f5;
}

.mapboxgl-ctrl-group button + button{
  border-top:none;
  margin-top:5px;
}

/* Place autocomplete dropdown */
.place-autocomplete-results {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.place-autocomplete-results li a {
  display: block;
  padding: 6px 10px;
  text-decoration: none;
  color: #333;
  font-size: 0.95em;
}
.place-autocomplete-results li a:hover {
  background-color: #f0f0f0;
}


/* =====================================================
   Mobile styles (max-width: 640px), historically ported from legacy mobile.css.
   The deprecated/ snapshot may still contain that file for PHP; Rails uses this block only.
   ===================================================== */

@media all and (max-width: 640px) {


  .hide-for-mobile{
    display:none;
  }

  .hide-for-desktop{
    display:inherit;
  }

  .mobile-header{
    padding: 12px 12px 12px 12px;
    background-color: #fff;
    z-index: 9999;
    text-align: center;
    position: fixed;
    top: 0px;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-header h1{
    display: inline-block;
    font-size: 1.2em;
    margin: 0px;
    font-weight: 500;
    padding: 4px 0px 0px 0px;
    color:#25325b;
  }

  .mobile-header .m-header-left{
    float:left;
  }

  .mobile-header .m-header-right{
    float:right;
  }
  .mobile-header .m-header-right a{
    display: inline-block;
    padding: 6px 8px 6px 6px;
  }

  .mobile-footer{
    position:fixed;
    bottom:0px;
    width:100%;
    padding:0px 10px 10px 10px;
    background-color:#1054A8;
    z-index:99999;
    text-align:center;
  }

  .mobile-footer img{
    margin-top: -20px;
  }

  .mobile-footer p{
    color:#fff;
    margin:0px;
    font-size:.9em;
  }

  .container-main-content {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 50px;
    overflow-y: auto;
  }

  #container-map{
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 50px;
  }

  #container-map #map {
    width: 100%;
    height: 100%;
  }


  .map-content-wrapper-desktop {
    display: none;
  }

  #container-map-ui-bottom {
    display: none;
  }

  /* Mobile hamburger icon states */
  .mm-icon-bars { display: inline; }
  .mm-icon-x { display: none; }

  #container-map-content-bottom{
    max-width: inherit;
    top: 25%;
    bottom:inherit;
    margin: 0px 10%;
  }

  #container-mobile-menu{
    position: fixed;
    left: 0px;
    background-color: #fff;
    width: 100%;
    height: 100%;
    z-index: 999;
    overflow: scroll;
  }

  .container-mobile-menu-inner{
    padding: 60px 20px 60px 20px;
  }

  .container-section-inner {
    padding-bottom: 100px;
  }

  .map-content-stats {
    position: absolute;
    bottom: 50px;
    z-index: 9;
    border: 1px solid #bfbfbf;
    border-radius: 20px;
    box-sizing: border-box;
    left: 45px;
    right: 20px;
    max-width: inherit;
    padding: 20px 15px 10px 20px;
  }




  #container-downloads .container-section-inner {
    padding:60px 0px 100px 0px;
    overflow:auto;
  }

  #container-downloads .container-section-inner .grid-conatiner .grid-row p {
    width: 50%;
    height: auto;
    float: left;
  }

}
