/* ==========================================================================
   Component: BioBoo.st Scientific Hotspots (Ultra-Lightweight)
   Aesthetic: Scientific Luxury 
   ========================================================================== */

.sci-hotspots {
  --bio-white: #F4F6F7; 
  --bio-grey: #2C333A; 
  --bio-green: #00FF41; 
  
  --font-heading: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  
  --transition-speed: 0.25s; 
  
  position: relative;
  width: 100%;
  max-width: 1000px; 
  margin: 0 auto;
  background-color: var(--bio-white);
  border-radius: 16px; 
}

.sci-hotspots__img {
  display: block;
  width: 100%;
  height: auto; 
  object-fit: contain;
  border-radius: 16px;
}

/* Base Hotspot Button */
.sci-hotspot {
  position: absolute;
  width: 32px; 
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  border-radius: 50%;
  border: 2px solid #FFFFFF; 
  background-color: #F4F6F7; 
  cursor: pointer;
  z-index: 10;
  padding: 0;
  outline: none;
  transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.sci-hotspot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background-color: var(--bio-white);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: background-color var(--transition-speed) ease;
}

.sci-hotspot:hover,
.sci-hotspot.is-active {
  background-color: #FFFFFF;
  border-color: var(--bio-green);
}

.sci-hotspot:hover::before,
.sci-hotspot.is-active::before {
  background-color: var(--bio-green);
}

/* Пульсация */
.sci-hotspot::after {
  content: '';
  position: absolute;
  inset: -2px; 
  border: 2px solid var(--bio-green);
  border-radius: inherit;
  will-change: transform, opacity;
  animation: sci-laser-pulse 2s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
  pointer-events: none;
}

@keyframes sci-laser-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}

/* Popup Panel (Desktop) */
.sci-panel {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  width: 320px;
  background-color: #F4F6F7;
  border: 1px solid rgba(44, 51, 58, 0.1);
  border-radius: 16px; 
  padding: 24px;
  color: var(--bio-grey);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
  box-shadow: 0 12px 32px rgba(5, 10, 24, 0.15); 
  box-sizing: border-box;
  will-change: transform, opacity;
}

.sci-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.sci-panel--left { left: 24px; }
.sci-panel--right { right: 24px; }

/* Typography */
.sci-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--bio-grey);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 4px;
  font-family: var(--font-body);
}

.sci-panel__close:hover { opacity: 1; }

.sci-panel__title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(44, 51, 58, 0.1);
  padding-bottom: 10px;
  color: var(--bio-grey);
}

.sci-panel__fact {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 8px 0;
  color: var(--bio-grey);
}

.sci-panel__desc {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 16px 0;
  color: rgba(44, 51, 58, 0.85);
}

.sci-panel__sources {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(44, 51, 58, 0.5);
  margin: 0;
}

.sci-panel__fact:empty,
.sci-panel__desc:empty,
.sci-panel__sources:empty {
  display: none;
}
.sci-panel__sources:not(:empty)::before { content: 'SOURCE: '; }

/* ==========================================================================
   Mobile Responsiveness (Железобетонная нижняя шторка)
   ========================================================================== */
@media (max-width: 600px) {
  .sci-panel {
    position: fixed !important; 
    top: auto !important; 
    bottom: 0 !important; 
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: auto !important;
    max-height: 75vh !important; /* Безопасная высота */
    max-height: 75dvh !important; /* Динамическая высота для iOS */
    overflow-y: auto !important; 
    transform: translateY(100%) !important; /* Уносим вниз за пределы экрана */
    border-radius: 24px 24px 0 0 !important;
    padding: 50px 24px 24px 24px !important; /* Увеличен верхний отступ под крестик */
    box-shadow: 0 -8px 40px rgba(5, 10, 24, 0.2) !important;
    z-index: 999999 !important;
    margin: 0 !important;
  }

  .sci-panel.is-visible {
    /* Жестко убиваем десктопный translateY(-50%) */
    transform: translateY(0) !important; 
  }

  .sci-panel__close {
    font-size: 26px !important; 
    top: 12px !important;
    right: 16px !important;
    opacity: 0.9 !important;
    background: rgba(244, 246, 247, 0.95) !important; /* Подложка под крестик */
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999 !important;
  }
}