/* style.css — Eagle Advisory Partners theme */

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', sans-serif;
  background-color: #f8f9fa;
  color: #023a51;
}

/* Full-bleed map fills the frame; all controls float on top of it */
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Floating control card (top-left): year + address search */
.control-card {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  width: 250px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  padding: 14px;
  color: #023a51;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.control-row label {
  font-weight: 600;
  font-size: 14px;
}

.control-row select {
  font-size: 14px;
  padding: 5px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  color: #023a51;
  background: #ffffff;
}

/* Floating stack of hover-info cards (top-right) */
.right-stack {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 250px;
}

.legend {
  position: absolute; /* override Leaflet default */
  bottom: 30px;
  right: 24px;
  width: 150px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  padding: 14px;
  font-size: 17px;
  line-height: 1.6;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #023a51;
  z-index: 1000;
}

.legend .dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 3px;
}

.dot-tier1-lower40 { background: #004080; }
.dot-tier1 { background: #023a51; }
.dot-tier2 { background: #6c757d; }
.dot-tier3 { background: #f4c542; }
.dot-tier4 { background: #d9534f; }

.leaflet-popup-content {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  color: #023a51;
}

/* County fill colors by tier */
path.tier1-lower40 {
  fill: #3b7f4d; /* deep green */
}
path.tier1 {
  fill: #6fbf73; /* light green */
}
path.tier2 {
  fill: #4a6fa5; /* muted blue */
}
path.tier3 {
  fill: #5a8fc2; /* medium blue */
}
path.tier4 {
  fill: #7fb3e6; /* light blue */
}
path.tier-unknown {
  fill: #cccccc;
}

.county-popup {
  font-size: 16px;
  line-height: 1.6;
  max-width: 400px; /* default Leaflet is 200px */
  padding: 15px;
  color: #023a51;
}

.leaflet-popup-content {
  margin: 0;
}

/* Smooth fade for county polygons */
path.county-fade {
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

path.county-visible {
  opacity: 1;
  transition: opacity 0.4s ease-in;
}

.custom-popup .leaflet-popup-tip {
  display: none;
}

.info-panel {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  padding: 16px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #023a51;
}

.info-panel h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 600;
  color: #023a51;
}

.info-panel p {
  margin: 8px 0;
  font-size: 15px;
}

.info-panel hr {
  border: none;
  border-top: 2px solid #dee2e6;
  margin-bottom: 20px;
}

#investmentInfoPanel h3 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 600;
  color: #023a51;
}

#investmentInfoPanel p {
  margin: 8px 0;
  font-size: 15px;
}

/* Address search (stacked inside the control card) */
.search-bar {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.search-bar-row {
  display: flex;
  gap: 7px;
}

.search-bar input {
  padding: 7px 9px;
  font-size: 14px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #023a51;
  width: 100%;
  box-sizing: border-box;
}

.search-bar input:focus {
  outline: none;
  border-color: #023a51;
  box-shadow: 0 0 0 2px rgba(2, 58, 81, 0.15);
}

#searchStreet { width: 100%; }
#searchCity { flex: 1 1 auto; }
#searchZip { flex: 0 0 80px; }

.search-bar button {
  width: 100%;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.search-status {
  min-height: 18px;
  font-size: 13px;
  color: #6c757d;
  margin-top: 6px;
}

/* County detail modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 58, 81, 0.55);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  position: relative;
  background: #ffffff;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 10px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.3);
  padding: 30px 28px 24px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #023a51;
  animation: modalIn 0.2s ease-out;
}

.modal-body {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.modal-shape {
  flex: 0 0 190px;
  align-self: center;
  height: 220px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.modal-shape svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Keep county borders a constant width regardless of the locator's zoom level */
.modal-shape svg path {
  vector-effect: non-scaling-stroke;
}

.modal-details {
  flex: 1 1 auto;
  min-width: 0;
}

/* Special designations (address-search results) */
.modal-tract {
  font-size: 13px;
  color: #6c757d;
  margin: -2px 0 10px;
}

.modal-desig-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.desig-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.desig-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.desig-row.on .desig-icon { background: #e3f3e7; color: #2e7d43; }
.desig-row.off .desig-icon { background: #f1f3f5; color: #adb5bd; }

.desig-label {
  flex: 1 1 auto;
  color: #023a51;
}

.desig-label em {
  color: #6c757d;
  font-style: normal;
  font-size: 12px;
}

.desig-row.off .desig-label { color: #868e96; }

.desig-val {
  font-weight: 700;
  font-size: 13px;
}

.desig-row.on .desig-val { color: #2e7d43; }
.desig-row.off .desig-val { color: #adb5bd; }

.desig-loading,
.desig-error {
  font-size: 13px;
  color: #6c757d;
}

.desig-error { color: #d9534f; }

/* Industry (Business Enterprise) eligibility */
.elig-summary {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 10px;
  color: #023a51;
}

.elig-yes {
  font-weight: 700;
  color: #2e7d43;
}

.elig-toggle {
  display: flex;
  width: 100%;
  margin-top: 16px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: #ffffff;
  color: #023a51;
  border: 1px solid #023a51;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.elig-toggle .elig-caret {
  font-size: 17px;
}

.elig-toggle:hover { background: #eef2f6; }

.elig-toggle[aria-expanded="true"] .elig-caret { transform: rotate(180deg); }

.elig-caret {
  display: inline-block;
  font-size: 11px;
  transition: transform 0.15s ease;
}

.elig-list {
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 6px;
}

.elig-sector + .elig-sector { border-top: 1px solid #e9ecef; }

.elig-sector-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: none;
  cursor: pointer;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #023a51;
  text-align: left;
}

.elig-sector-head:hover { background: #eef2f6; }

.elig-sector-head .elig-caret { transition: transform 0.15s ease; }
.elig-sector-head.open .elig-caret { transform: rotate(90deg); }

.elig-sector-name { flex: 1 1 auto; }

.elig-count {
  flex: 0 0 auto;
  background: #023a51;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  padding: 1px 8px;
}

.elig-sector-body {
  padding: 4px 12px 8px;
  background: #ffffff;
}

.elig-item {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.4;
  border-top: 1px solid #f1f3f5;
}

.elig-item:first-child { border-top: none; }

.elig-code {
  flex: 0 0 62px;
  font-weight: 700;
  color: #023a51;
  font-variant-numeric: tabular-nums;
}

.elig-desc { flex: 1 1 auto; color: #495057; }

/* Slide-out "Qualifying Industries" side panel — emerges from behind the modal */
.modal-shell {
  position: relative;
  display: flex;
  transition: transform 0.32s ease;
}

.modal-card {
  z-index: 2; /* sits above the industries panel */
}

.industries-panel {
  position: absolute;
  top: 20px;
  bottom: 20px;          /* a touch shorter than the modal */
  left: 100%;            /* left edge meets the modal's right edge */
  z-index: 1;            /* behind the modal */
  width: 450px;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.28);
  padding: 20px 18px 16px 33px;  /* wider left padding for breathing room */
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);   /* tucked fully behind the modal */
  pointer-events: none;
  transition: transform 0.32s ease;
}

.industries-panel.open {
  transform: translateX(-4px);   /* flush beside the modal (4px tucked to hide the seam) */
  pointer-events: auto;
}

.industries-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #adb5bd;
  cursor: pointer;
  transition: color 0.15s ease;
}

.industries-close:hover { color: #023a51; }

.industries-title {
  margin: 0 0 12px;
  padding-right: 22px;
  font-size: 17px;
  font-weight: 600;
  color: #023a51;
}

.industries-panel .elig-list {
  margin-top: 0;
  max-height: none;
  flex: 1 1 auto;
}

/* On small screens the panel becomes a sheet sliding in from the screen's right edge */
@media (max-width: 820px) {
  .industries-panel {
    position: fixed;
    top: 6vh;
    bottom: 6vh;
    left: auto;
    right: 0;
    width: 88vw;
    max-width: 340px;
    border-radius: 10px 0 0 10px;
    transform: translateX(105%);
  }

  .industries-panel.open {
    transform: translateX(0);
  }
}

@media (max-width: 600px) {
  .modal-body {
    flex-direction: column;
    gap: 16px;
  }

  .modal-shape {
    flex-basis: auto;
    max-height: 160px;
  }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 10px 10px 0 0;
  background: #6c757d;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: #adb5bd;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: #023a51;
}

.modal-year {
  margin: 4px 0 2px;
  font-size: 13px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.modal-card h2 {
  margin: 2px 0 12px;
  font-size: 27px;
  font-weight: 700;
  color: #023a51;
}

.modal-address {
  font-size: 14px;
  color: #495057;
  margin: 0 0 12px;
  line-height: 1.4;
}

.modal-tier-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 20px;
  background: #6c757d;
  color: #ffffff;
}

.modal-section {
  border-top: 1px solid #e9ecef;
  padding-top: 14px;
  margin-top: 4px;
}

.modal-section h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: #023a51;
}

.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 9px 0;
  font-size: 15px;
}

.modal-row span {
  color: #495057;
}

.modal-row strong {
  font-size: 16px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.modal-note {
  font-size: 13px;
  color: #868e96;
  font-style: italic;
  margin: -4px 0 6px;
}

.modal-basis {
  font-size: 12px;
  font-weight: 600;
  color: #2e7d43;
  margin: 4px 0 0;
}

/* On small screens keep just the map + search card (hover cards/legend crowd it) */
@media (max-width: 768px) {
  .right-stack,
  .legend {
    display: none;
  }

  .control-card {
    width: auto;
    left: 10px;
    right: 10px;
    top: 10px;
    max-width: 320px;
  }
}

/* --- Site-matched theme (Eagle Advisory Partners) --- */
/* Serif display headings, like the main site */
.modal-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
}

/* Buttons match the site's light style (light fill, brand-navy text) */
.search-bar button,
.elig-toggle {
  background-color: #e0ecf0;
  color: #023a51;
  border: none;
}

.search-bar button:hover,
.elig-toggle:hover {
  background-color: #cfe1ea;
}
