/**
 * Marmiro Stones - Representatives & Network Finder Styles
 * Custom CSS for interactive Map & Rep Directory
 */

:root {
  --marmiro-navy: #0e2a47;
  --marmiro-navy-dark: #091a2c;
  --marmiro-navy-light: #1a426e;
  --marmiro-green: #059669;
  --marmiro-green-light: #10b981;
}

.bg-navy {
  background-color: var(--marmiro-navy) !important;
}

.text-navy {
  color: var(--marmiro-navy) !important;
}

/* Page Layout */
.representatives-page-wrapper {
  background-color: #f8fafc;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

.network-tag {
  color: #2563eb;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.network-main-title {
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 2.2rem;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.network-subtitle {
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 520px;
}

/* Feature Header Badges */
.network-feature-card {
  transition: all 0.2s ease-in-out;
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

.network-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature-icon-circle {
  width: 44px;
  height: 44px;
}

/* Finder Two Columns Layout */
.network-finder-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.finder-main-row {
  flex-grow: 1;
  min-height: 720px;
}

.finder-list-column {
  max-height: calc(100vh - 200px);
  min-height: 600px;
  overflow: hidden;
}

.finder-results-scroll {
  overflow-y: auto;
  scroll-behavior: smooth;
}

.finder-results-scroll::-webkit-scrollbar {
  width: 6px;
}

.finder-results-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Search input */
.finder-search-group {
  border-radius: 9999px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.finder-search-group:focus-within {
  border-color: var(--marmiro-navy);
  box-shadow: 0 0 0 3px rgba(14, 42, 71, 0.12) !important;
}

.finder-search-group .form-control {
  font-size: 0.92rem;
  border: none !important;
}

.finder-search-group .form-control:focus {
  box-shadow: none !important;
}

/* Filter Pill Tabs */
.filter-pill-btn {
  border-radius: 9999px;
  padding: 0.45rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  background-color: #f8fafc;
  color: #475569;
  transition: all 0.2s ease;
}

.filter-pill-btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.filter-pill-btn.active {
  background-color: var(--marmiro-navy);
  border-color: var(--marmiro-navy);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(14, 42, 71, 0.25);
}

/* Rep & DC Cards */
.rep-card {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  background-color: #ffffff;
  border-color: #e2e8f0 !important;
}

.rep-card:hover {
  transform: translateY(-2px);
  border-color: var(--marmiro-navy) !important;
  box-shadow: 0 6px 18px rgba(14, 42, 71, 0.08) !important;
}

.rep-card.active-selected-card {
  border-color: var(--marmiro-navy) !important;
  background-color: #f8faff;
  box-shadow: 0 0 0 2px rgba(14, 42, 71, 0.25) !important;
}

.rep-avatar {
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
}

.rep-name {
  font-size: 0.98rem;
}

.rep-title {
  font-size: 0.78rem;
  line-height: 1.2;
}

.btn-view-details {
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-view-details:hover {
  background-color: var(--marmiro-navy);
  border-color: var(--marmiro-navy);
  color: #ffffff;
}

/* Map Column & Overlays */
.finder-map-column {
  min-height: 600px;
  position: relative;
}

#repsGoogleMap {
  width: 100%;
  height: 100%;
  min-height: 600px;
}

.map-overlay-topright {
  top: 16px;
  right: 16px;
}

#stateDropdownBtn {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12) !important;
  font-size: 0.88rem;
}

.map-overlay-legend {
  bottom: 24px;
  left: 20px;
}

.map-overlay-legend > div {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
}

/* Custom Google Map InfoWindow */
.gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
  max-width: 260px !important;
  width: auto !important;
}

.gm-style .gm-style-iw-d {
  overflow: hidden !important;
  padding: 0 !important;
  max-width: 260px !important;
}

/* Eliminate excessive empty white header space introduced by Google Maps API */
.gm-style .gm-style-iw-chr {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  z-index: 10 !important;
}

/* Compact and sleek close button */
.gm-style .gm-ui-hover-effect {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0.6 !important;
  border-radius: 50% !important;
  transition: opacity 0.15s ease, background-color 0.15s ease !important;
}

.gm-style .gm-ui-hover-effect:hover {
  opacity: 1 !important;
  background-color: rgba(0, 0, 0, 0.08) !important;
}

.gm-style .gm-ui-hover-effect > span {
  margin: 0 !important;
}

.custom-map-infowindow {
  padding: 10px 24px 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 240px;
  max-width: 280px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.infowindow-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: bold;
  flex-shrink: 0;
}

.infowindow-content {
  flex-grow: 1;
  overflow: hidden;
}

.infowindow-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infowindow-sub {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.2;
}

/* Autocomplete suggestion item */
.rep-autocomplete-item {
  padding: 8px 16px;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rep-autocomplete-item:hover {
  background-color: #f1f5f9;
}

@media (max-width: 991.98px) {
  .finder-list-column {
    max-height: none;
    min-height: auto;
  }

  .finder-map-column {
    min-height: 480px;
    height: 480px;
  }

  #repsGoogleMap {
    min-height: 480px;
    height: 480px;
  }
}

/* Territory Scope Badge */
.territory-scope-badge {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.rep-card:hover .territory-scope-badge {
  background-color: #dcfce7;
  border-color: #86efac;
}

/* Embed Layout Overrides */
.embed-body {
  height: 100vh;
  overflow: hidden;
}

.embed-body .representatives-page-wrapper {
  min-height: 100vh;
  height: 100vh;
}

.embed-body .finder-main-row {
  height: calc(100vh - 54px);
  min-height: auto;
}

.embed-body .finder-list-column {
  max-height: calc(100vh - 54px);
  height: calc(100vh - 54px);
  min-height: auto;
}

.embed-body .finder-map-column,
.embed-body #repsGoogleMap {
  height: 100%;
  min-height: auto;
}

