/**
 * Video Hotspot Styles v2.0
 * Glass morphism theme with mobile-safe minimum sizing
 * Channel switcher UI included
 */

/* ==================== BASE STYLES ==================== */
.video-hotspot {
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
}

.video-hotspot-container {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.video-hotspot-container:hover {
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(100, 150, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(100, 150, 255, 0.5);
}

/* Video/iframe fills container */
.video-hotspot-container video,
.video-hotspot-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  pointer-events: auto;
  background: #000;
}

/* ==================== TITLE OVERLAY ==================== */
.video-hotspot-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.5) 60%,
    transparent 100%
  );
  color: white;
  font-family: 'Barlow Semi Condensed', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
  border-radius: 0 0 8px 8px;
  letter-spacing: 0.3px;
}

/* ==================== CHANNEL SWITCHER ==================== */
.video-hotspot-channels {
  position: absolute;
  bottom: -110px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(210, 180, 140, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  z-index: 10;
}

.video-hotspot-channels .channel-btn {
  width: 70px;
  height: 70px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #333;
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 26px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.1),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.video-hotspot-channels .channel-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.08);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.video-hotspot-channels .channel-btn.active {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 100, 150, 0.6);
  color: #222;
  box-shadow: 
    0 4px 20px rgba(255, 100, 150, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

/* Control buttons (play/pause, focus) */
.video-hotspot-channels .control-btn {
  width: 70px;
  height: 70px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #333;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.1),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.video-hotspot-channels .control-btn svg {
  width: 32px;
  height: 32px;
}

.video-hotspot-channels .control-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.08);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.video-hotspot-channels .control-btn.active {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(100, 150, 255, 0.6);
  box-shadow: 
    0 4px 20px rgba(100, 150, 255, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

/* Separator between button groups */
.video-hotspot-channels .control-separator {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 4px;
  align-self: center;
}

/* Mute toggle button */
.video-hotspot-channels .mute-btn svg {
  width: 32px;
  height: 32px;
}

.video-hotspot-channels .mute-btn.unmuted {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(100, 200, 120, 0.6);
  box-shadow: 
    0 4px 20px rgba(100, 200, 120, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

/* ==================== LOADING STATE ==================== */
.video-hotspot-container.loading {
  background: rgba(0, 0, 0, 0.6);
}

.video-hotspot-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: videoHotspotSpin 0.8s linear infinite;
}

@keyframes videoHotspotSpin {
  to { transform: rotate(360deg); }
}

/* ==================== PLAY BUTTON OVERLAY ==================== */
.video-hotspot-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

.video-hotspot-play-button:hover {
  opacity: 1;
  background: #fff;
}

.video-hotspot-play-button::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 20px solid #333;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 4px;
}

.video-hotspot-container.playing .video-hotspot-play-button {
  display: none;
}

/* ==================== MOBILE STYLES ==================== */

/* Tablet */
@media (max-width: 1024px) {
  .video-hotspot-container {
    /* Ensure minimum readable size on tablets */
    min-width: 320px;
    min-height: 180px;
  }
  
  .video-hotspot-title {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .video-hotspot-channels {
    bottom: -95px;
    padding: 12px 20px;
    gap: 10px;
  }
  
  .video-hotspot-channels .channel-btn,
  .video-hotspot-channels .control-btn {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }
  
  .video-hotspot-channels .control-btn svg,
  .video-hotspot-channels .mute-btn svg {
    width: 28px;
    height: 28px;
  }
  
  .video-hotspot-channels .control-separator {
    height: 32px;
  }
}

/* Mobile landscape and small tablets */
@media (max-width: 768px) {
  .video-hotspot-container {
    /* Force minimum size to prevent player collapse */
    min-width: 300px !important;
    min-height: 169px !important;
  }
  
  .video-hotspot-title {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .video-hotspot-play-button {
    width: 56px;
    height: 56px;
  }
  
  .video-hotspot-play-button::after {
    border-left-width: 16px;
    border-top-width: 10px;
    border-bottom-width: 10px;
  }
}

/* Mobile portrait */
@media (max-width: 500px), (max-height: 500px) {
  .video-hotspot-title {
    font-size: 10px;
    padding: 5px 8px;
  }
  
  .video-hotspot-channels {
    bottom: -85px;
    padding: 10px 16px;
    gap: 8px;
  }
  
  .video-hotspot-channels .channel-btn,
  .video-hotspot-channels .control-btn {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
  
  .video-hotspot-channels .control-btn svg,
  .video-hotspot-channels .mute-btn svg {
    width: 24px;
    height: 24px;
  }
  
  .video-hotspot-channels .control-separator {
    height: 28px;
  }
  
  .video-hotspot-play-button {
    width: 48px;
    height: 48px;
  }
  
  .video-hotspot-play-button::after {
    border-left-width: 14px;
    border-top-width: 8px;
    border-bottom-width: 8px;
  }
}

/* Very small screens (older phones, small viewports) */
@media (max-width: 360px) {
  .video-hotspot-container {
    min-width: 260px !important;
    min-height: 146px !important;
  }
}

/* ==================== HIGH DPI / RETINA ==================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .video-hotspot-container {
    /* Crisp borders on retina */
    border-width: 0.5px;
  }
}

/* ==================== DARK MODE PREFERENCE ==================== */
@media (prefers-color-scheme: dark) {
  .video-hotspot-container {
    background: rgba(0, 0, 0, 0.5);
  }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
  .video-hotspot-container,
  .video-hotspot-channels .channel-btn,
  .video-hotspot-play-button {
    transition: none;
  }
  
  .video-hotspot-container.loading::after {
    animation: none;
  }
}

/* ==================== PRINT ==================== */
@media print {
  .video-hotspot {
    display: none;
  }
}