.ai-data-center-controls {
  position: absolute;
  --distance-from-edge: 1rem;
  z-index: 8;
  display: flex;
}

.ai-data-center-zoom-controls {
  display: none;
}

.ai-data-center-controls.ai-data-center-zoom-controls {
  top: var(--distance-from-edge);
  right: var(--distance-from-edge);
}

/* Globe action buttons (download & fullscreen) */
.ai-data-center-controls.ai-data-center-action-controls {
  bottom: var(--distance-from-edge);
  right: var(--distance-from-edge);
}

.ai-data-center-controls button {
  transition: background-color 0.2s ease;
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.08) !important;
}

.ai-data-center-controls button:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

#ai-data-center-fullscreen-icon-exit {
  width: 1rem;
}

/* Fullscreen mode for globe layout */

.ai-data-center-globe-layout.fullscreen-overlay .ai-data-center-globe-card {
  width: 100%;
  height: 100%;
  border-radius: 0 !important;
}

.ai-data-center-globe-layout.fullscreen-overlay
  .ai-data-center-globe-container {
  aspect-ratio: unset;
  height: 100%;
}

/* Globe container: sky slightly lighter than globe (black); same in light/dark mode */
.ai-data-center-globe-container {
  position: relative;
  display: block;
  background: rgb(28, 28, 30);
  overflow: hidden;
  /* Safari clipping fix for border-radius + overflow:hidden */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  isolation: isolate;
  z-index: 1;
}

#ai-data-center-globe-container-placeholder,
.ai-data-center-globe-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 1;
}

#ai-data-center-info-card-lg .ai-data-center-info-btns-container > div,
.ai-data-center-mobile-card .ai-data-center-info-btns-container > div {
  width: calc(50% - 4px);
}

#ai-data-center-info-card-lg .ai-data-center-source-link button,
.ai-data-center-mobile-card .ai-data-center-source-link button {
  width: calc(100% - 4px);
  height: 36.5px;
}

#ai-data-center-info-card-lg .ai-data-center-gmap-link button img,
.ai-data-center-mobile-card .ai-data-center-gmap-link button img {
  filter: brightness(0) invert(1);
}

/* Remove any forceful sizing on the canvas itself */
.ai-data-center-globe-container canvas {
  display: block; /* Removes bottom spacing */
  outline: none;
  position: relative;
  z-index: 1;
}

.ai-data-center-pin {
  pointer-events: auto;
  cursor: pointer;
  width: 8px;
  height: 8px;
  background: var(--gradient-primary);
  position: relative;
  z-index: 2;
}

.ai-data-center-location-icon-card {
  position: absolute;
  left: 50%;
  bottom: 100%; /* Position relative to the pin bottom */
  margin-bottom: 4px; /* Space from pin */
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  padding: 2px;
  pointer-events: auto;
  border-radius: 50%;
}

.text-operation,
.tooltip.text-operation .tooltip-inner {
  color: rgb(55, 145, 36);
}

.text-under-development,
.tooltip.text-under-development .tooltip-inner {
  color: #ee6c45;
}

.text-pipeline,
.tooltip.text-pipeline .tooltip-inner {
  color: #b1b1b1;
}

.tooltip .tooltip-inner {
  font-weight: 600;
}

.pin-ripple {
  position: absolute;
  inset: -10px;
  pointer-events: none;
}

.pin-ripple .ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(154, 98, 230, 0.6);
  animation: ripple-wave 3s linear infinite;
}

.pin-ripple .r1 {
  animation-delay: 0s;
}
.pin-ripple .r2 {
  animation-delay: -1s;
}
.pin-ripple .r3 {
  animation-delay: -2s;
}

@keyframes ripple-wave {
  0% {
    transform: scale(0.35);
    opacity: 0.6;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Mobile Carousel Cards (< 992px) */
.ai-data-center-mobile-card {
  width: 320px !important;
}

/* Active state – matches the lg info-card glow */
.ai-data-center-mobile-card.active {
  border: solid 2px #aeb3b7;
}

.chart-legend {
  width: 1rem;
  aspect-ratio: 1;
  border-radius: 2px;
}

@media (min-width: 576px) {
  #ai-data-center-info-card-lg .ai-data-center-info-btns-container > div,
  .ai-data-center-mobile-card .ai-data-center-info-btns-container > div {
    width: calc(50% - 8px);
  }

  .ai-data-center-mobile-card {
    width: 350px !important;
  }

  .chart-legend {
    width: 18px;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  #ai-data-center-globe-container-placeholder,
  .ai-data-center-globe-container {
    aspect-ratio: 16/9;
  }
}

@media (max-width: 991.98px) {
  /* Large-screen info card must never show on mobile */
  #ai-data-center-info-card-lg {
    display: none !important;
  }

  .ai-data-center-globe-layout.fullscreen-overlay {
    gap: 0 !important;
  }

  .ai-data-center-globe-layout.fullscreen-overlay #ai-data-center-info-card-lg {
    display: none !important;
  }
}

@media (min-width: 992px) and (max-width: 1399.98px) {
  #ai-data-center-globe-container-placeholder,
  .ai-data-center-globe-container {
    aspect-ratio: 4/3;
  }
}

@media (min-width: 992px) {
  .ai-data-center-controls {
    --distance-from-edge: 2rem;
  }

  .ai-data-center-zoom-controls {
    display: flex;
  }

  #ai-data-center-key-figures-overview-card {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(1, 1fr);
  }

  #ai-data-center-info-card-lg {
    position: absolute !important;
    left: 2rem;
    bottom: 2rem;
    right: auto;
    top: auto;
    width: 400px;
    z-index: 5; /* higher than globe card */
    cursor: grab;
    box-shadow: 0 0 8px #aeb3b7;
  }

  #ai-data-center-info-card-lg:active {
    cursor: grabbing;
  }

  .ai-data-center-location-icon-card {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
  }

  .ai-data-center-zoom-controls {
    display: flex;
  }
}

@media (min-width: 1400px) {
  #ai-data-center-globe-container-placeholder,
  .ai-data-center-globe-container {
    aspect-ratio: 2;
  }
}
