.fhp-map {
  --primary-color: #002d72;
}

/* Map container */
.fhp-map #map {
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Mapbox overrides (scoped) */
.fhp-map .mapboxgl-map {
  font: inherit;
}

.fhp-map .mapboxgl-ctrl-bottom-right {
  display: none !important;
}

/* City popup styles */
.fhp-map .mapboxgl-popup {
  --popup-transition-delay: 0.15s;
  visibility: hidden !important;
}

.fhp-map .city-popup,
.fhp-map .hub-popup,
.fhp-map .building-popup {
  visibility: visible !important;
  z-index: 1501 !important;
  transition: visibility 0s var(--popup-transition-delay) !important;
}

.fhp-map .city-popup .mapboxgl-popup-content {
  padding: 0;
  border-radius: 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  max-width: 100%;
  cursor: default;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Hub city popup specific width */
.fhp-map .hub-popup {
  max-width: min(640px, 60vw) !important;
}

.fhp-map .hub-popup .mapboxgl-popup-content {
  max-width: none;
}

.fhp-map .city-popup .mapboxgl-popup-tip {
  display: none !important;
}

.fhp-map .city-info {
  background: #ffffff;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.fhp-map .hub-info {
  min-width: 312px;
}

.fhp-map .views-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.fhp-map .view {
  transition: opacity 0.3s ease;
  grid-column: 1;
  grid-row: 1;
}

.fhp-map .view.hidden {
  opacity: 0;
  pointer-events: none;
}

.fhp-map .view.visible {
  opacity: 1;
}

.fhp-map .terminal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fhp-map .terminal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-top: 1px solid #dfe4ea;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.fhp-map .terminal-item:first-child {
  border-top: none;
}

.fhp-map .terminal-item:hover {
  background: #f8f9fb;
}

.fhp-map .terminal-item i {
  color: var(--primary-color);
}

.fhp-map .hub-info .tooltip-card__header {
  padding: 30px 24px 20px;
  text-align: center;
}

.fhp-map .hub-info .tooltip-card__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #071125;
  letter-spacing: 1px;
}

.fhp-map .hub-info .tooltip-card__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.fhp-map .data-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #dfe4ea;
}

.fhp-map .data-row:is(:nth-child(1), :nth-child(2)) {
  border-top: none;
}

.fhp-map .data-item {
  padding: 8px 16px;
  flex: 1 0 100px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.fhp-map .data-item:hover {
  background: #f5f5f5;
  border-color: #e0e0e0;
}

.fhp-map .data-row.single {
  grid-template-columns: 1fr;
}

.fhp-map .data-row.single .data-item {
  max-width: none;
  width: 100%;
}

.fhp-map .data-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f1f2f6;
  color: var(--primary-color);
  font-size: 20px;
}

.fhp-map .data-value {
  font-size: 20px;
  font-weight: 700;
  color: #071125;
  line-height: 1.1;
  white-space: nowrap;
}

.fhp-map .data-label {
  font-size: 14px;
  font-weight: 600;
  color: #45505b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.4;
}

.fhp-map .data-percentage {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-color);
  background: lch(from var(--primary-color) calc(l + 70) c h);
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.fhp-map .hub-info .tooltip-card__footer {
  position: relative;
  background: var(--primary-color);
  text-align: center;
  padding: 16px 0;
  cursor: pointer;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  user-select: none;
  transition: background 0.25s ease;
}

.fhp-map .hub-info .tooltip-card__footer::after {
  content: "";
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 18px solid var(--primary-color);
}

.fhp-map .hub-info .take-me-there-btn {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
  letter-spacing: 0;
}

.fhp-map .hub-info .take-me-there-btn:hover {
  background: color-mix(in srgb, var(--primary-color) 85%, black);
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 45, 114, 0.25);
}

.fhp-map .building-popup .mapboxgl-popup-content {
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  min-width: 400px;
}

.fhp-map .building-popup .mapboxgl-popup-tip {
  border-top-color: #ffffff;
}

.fhp-map .building-info {
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fhp-map .building-title {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}

.fhp-map .building-category {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fhp-map .building-description {
  margin: 0;
  font-size: 14px;
  color: #5a6c7d;
  line-height: 1.5;
  text-align: center;
}

.fhp-map .building-features h4 {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: #34495e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 6px;
}

.fhp-map .feature-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 13px;
  margin-inline: -12px;
}

.fhp-map .feature-item:nth-child(even) {
  background-color: lch(from var(--primary-color) l c h / 0.2);
}

.fhp-map .feature-item:last-child {
  border-bottom: none;
  padding-bottom: 6px;
}

.fhp-map .feature-value {
  font-weight: 500;
  text-align: right;
}

/* Popup animations */
.fhp-map .building-popup .mapboxgl-popup-content,
.fhp-map .city-popup .mapboxgl-popup-content {
  animation: popupFadeIn 0.2s ease-out var(--popup-transition-delay) both;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Detail View Info Box */
.fhp-map .detail-info-box {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40%;
  height: calc(100% - 48px);
  background: white;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(100%, 0, 0);
  transition: all 0.8s ease-out;
  box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  will-change: transform, opacity;
  backface-visibility: hidden;
  contain: layout paint style size;
  content-visibility: auto;
  contain-intrinsic-size: 100vh 40vw;
  border-radius: 20px;
  scrollbar-width: thin;
}

.fhp-map .detail-info-box.visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
}

.fhp-map .detail-info-box.closed {
  width: 68px;
  height: 85px;
  overflow: clip;
}

@media (max-width: 768px) {
  .fhp-map .detail-info-box.closed {
    width: 56px;
    height: 72px;
  }
}

.fhp-map .detail-info-header {
  background: var(--primary-color);
  color: white;
  padding: 30px;
  text-align: left;
  flex-shrink: 0;
  aspect-ratio: 3 /1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.fhp-map :is(.detail-info-title, .detail-info-subtitle, .detail-info-content) {
  transition: all 0.3s ease;
  transition-property: opacity;
}

.fhp-map .detail-info-box.closed :is(.detail-info-exit, .detail-info-title, .detail-info-subtitle, .detail-info-content, #detail-button) {
  opacity: 0;
}

.fhp-map .detail-info-title {
  font-size: 3rem;
  font-weight: 400;
  margin: 0.25em 0 0;
  letter-spacing: 1px;
  color: inherit
}

.fhp-map .detail-info-subtitle {
  opacity: 0.7;
  font-size: 1.5rem;
  margin: 0 0 1em;
  font-weight: 400;
}

.fhp-map .detail-info-content {
  padding: 30px;
  flex-grow: 1;
}

.fhp-map .detail-info-description {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  border-left: 4px solid var(--primary-color);
}

.fhp-map .detail-info-description p {
  font-size: 1rem;
  line-height: 1.6;
  color: #495057;
  margin: 0;
  font-style: italic;
}

.fhp-map .detail-info-section {
  margin-bottom: 30px;
}

.fhp-map .detail-info-section h3 {
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 1em;
}

.fhp-map .detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.fhp-map .detail-info-item {
  background: rgb(0 45 114 / 20%);
  padding: 15px;
  border-radius: 8px;
  display: flex;
  gap: 15px;
}

.fhp-map .detail-info-item .item-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.fhp-map .detail-info-item .item-content {
  flex-grow: 1;
}

.fhp-map .detail-info-item .label {
  font-size: 0.85rem;
  font-weight: 400;
  margin-bottom: 5px;
}

.fhp-map .detail-info-item .value {
  font-size: 2rem;
  color: #212529;
  font-weight: 500;
  line-height: 1;
}

.fhp-map .detail-info-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.2s ease;
  z-index: 1;
}

.fhp-map .detail-info-close:hover {
  transform: scale(1.1);
}

.fhp-map .detail-info-box.closed .detail-info-close {
  transform: rotate(45deg);
}

.fhp-map .detail-info-actions {
  padding: 20px 30px;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0;
}

.fhp-map .detail-info-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fhp-map .detail-info-button:hover {
  background: color-mix(in srgb, var(--primary-color) 85%, black);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 45, 114, 0.3);
}

/* Accordion */
.fhp-map .accordion-container {
  border-radius: 8px;
  padding-inline: 10px;
  margin-inline: -10px;
  overflow: hidden;
}

.fhp-map .accordion-item {
  border-bottom: 1px solid #e9ecef;
}

.fhp-map .accordion-item:last-child {
  border-bottom: none;
}

.fhp-map .accordion-header {
  width: 100%;
  background: #ffffff;
  border: 0px solid #e9ecef;
  padding: 18px 0;
  text-align: left;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.fhp-map .accordion-header:hover {
  background: #f8f9fa;
}

.fhp-map .accordion-header.active {
  border-bottom: 1px solid #e9ecef !important;
}

.fhp-map .accordion-header i {
  transition: transform 0.3s ease;
  font-size: 0.9rem;
}

.fhp-map .accordion-header.active i {
  transform: rotate(90deg);
}

.fhp-map .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #ffffff;
}

.fhp-map .accordion-content.active {
  max-height: 2000px;
}

.fhp-map .accordion-content>div,
.fhp-map .accordion-content>ul,
.fhp-map .accordion-content>p {
  padding: 0;
  margin: 0;
}

.fhp-map .service-list {
  list-style: none;
  padding: 20px;
  margin: 0;
}

.fhp-map .service-list li {
  padding: 12px 0;
  border-bottom: 1px solid #f1f3f4;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #495057;
  position: relative;
  padding-left: 0;
}

.fhp-map .service-list li:last-child {
  border-bottom: none;
}

.fhp-map .service-list li::before {
  content: "";
  width: 0.4em;
  height: 0.4em;
  background: var(--primary-color);
  border-radius: 1em;
  font-weight: bold;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5em;
}

.fhp-map .infrastructure-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.fhp-map .infrastructure-section h4:not(:first-child) {
  margin-top: 25px;
}

.fhp-map .contact-section h4 {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 1em 0;
}

.fhp-map .contact-section p {
  margin: 0 0 15px 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.fhp-map .contact-item {
  background: #CCD5E3;
  padding: 2rem;
  border-radius: 8px;
  margin-block: 15px;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.fhp-map .contact-item>br {
  display: none;
}

.fhp-map .contact-logo {
  max-width: 150px;
  display: block;
  margin-bottom: 1em;
}

.fhp-map .contact-item strong {
  font-size: 1.1em;
  font-weight: 500;
}

.fhp-map .contact-item a {
  color: var(--primary-color);
  text-decoration: none;
}

.fhp-map .contact-item a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
  .fhp-map .detail-info-box {
    width: 50%;
  }

  .fhp-map .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .fhp-map .detail-info-item .item-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .fhp-map .accordion-header {
    padding: 15px 18px;
    font-size: 0.95rem;
  }

  .fhp-map .service-list li {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .fhp-map .detail-info-box {
    width: 90vw;
    height: calc(36vh - 24px);
    top: auto;
    bottom: 5vw;
    left: 5vw;
    transform: translateY(100%);
  }

  .fhp-map .detail-info-box.visible {
    transform: translateY(0);
  }

  .fhp-map .detail-info-header {
    padding: 20px;
  }

  .fhp-map .detail-info-title {
    font-size: 1.5rem;
  }

  .fhp-map .detail-info-subtitle {
    font-size: 1.2rem;
    margin: 0 0 0.2em;
  }

  .fhp-map .detail-info-header .btn {
    transform: scale(0.8);
    transform-origin: bottom left;
  }

  .fhp-map .detail-info-close {
    top: 15px;
    right: 15px;
    font-size: 1.3rem;
  }

  .fhp-map .detail-info-content {
    padding: 20px;
  }

  .fhp-map .detail-info-description {
    padding: 15px;
    margin-bottom: 20px;
  }

  .fhp-map .detail-info-description p {
    font-size: 0.9rem;
  }

  .fhp-map .detail-info-section {
    margin-bottom: 20px;
  }

  .fhp-map .detail-info-section h3 {
    font-size: 1rem;
  }

  .fhp-map .detail-info-item {
    padding: 12px;
    gap: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .fhp-map .detail-info-item .item-icon {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .fhp-map .accordion-header {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .fhp-map .accordion-content>div,
  .fhp-map .accordion-content>ul,
  .fhp-map .accordion-content>p {
    padding: 15px;
  }

  .fhp-map .service-list {
    padding: 15px;
  }

  .fhp-map .service-list li {
    padding: 8px 0;
    font-size: 0.85rem;
    padding-left: 15px;
  }

  .fhp-map .infrastructure-section h4 {
    font-size: 0.9rem;
  }

  .fhp-map .contact-section {
    padding: 15px;
  }

  .fhp-map .contact-item {
    padding: 12px;
  }

  .fhp-map .contact-item strong {
    font-size: 0.85rem;
  }

  .fhp-map .building-popup .mapboxgl-popup-content {
    min-width: 0 !important;
    max-width: 90vw !important;
    width: auto !important;
  }
}

/* Popup card */

.popupCard {
  display: flex;
  cursor: pointer;
}

.popupCard__header {
  flex: 0 0 40%;
  display: grid;
  grid-template-rows: 1em 1fr auto 1em;
  grid-template-columns: 1em 1fr 1em;
  color: white;
  position: relative;
  background: black;
}

.popupCard__header img {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  object-fit: cover;
  opacity: 0.666;
}

.popupCard__info {
  grid-column: 2 / -2;
  grid-row: 3;
  z-index: 1;
display: flex;
flex-direction: column;
}

.popupCard__info h2 {
  color: inherit;
  font-size: 1.5em;
}

.popupCard__button {
transform: translate3d(0,0,0) scale(0.8) !important;
transform-origin: bottom left;
white-space: nowrap;
}

.popupCard__body {
  flex: 0 0 60%;
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-columns: 1fr 1fr;
  padding: .666em;
  gap: 0.5em;
}

@media (max-width: 767px) {
.popupCard__header {
  flex-grow: 1;
}
.popupCard__body {
  display: none;
}
}

.popupCard__keyPoint {
  background: rgb(0 45 114 / 20%);
  padding: .666em;
  border-radius: 1em;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.popupCard__keyPoint--full {
  grid-column-end: span 2;
}

.popupCard__keyPointKicker {
  font-weight: 600;
  font-size: 0.666em;
  white-space: nowrap;
}

.popupCard__keyPointTitle {
  font-weight: 600;
  font-size: 1.2em;
  white-space: nowrap;
}

.popupCard__keyPointTitle :is(small) {
  font-weight: 400;
  font-size: 0.666em;
}