/*
 * Modal Overlay Styles
 */

/* Hide hamburger and sound toggle when modal is open */
body:has(#modal-overlay) .hamburger,
body:has(#modal-overlay) .sound-toggle {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999999;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
  transition: opacity 0.5s ease;
  overflow: hidden;
}

.modal-overlay.modal-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Blur background */
.modal-blur-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(var(--modal-blur, 20px));
  -webkit-backdrop-filter: blur(var(--modal-blur, 20px));
  background-color: var(--modal-bg-color, rgba(0, 0, 0, 0.95));
  z-index: 999999990;
}

/* Close button - top right */
.modal-close {
  position: fixed !important;
  top: 40px !important;
  right: 40px !important;
  background: none !important;
  border: none !important;
  color: #fff !important;
  cursor: pointer !important;
  z-index: 999999999 !important;
  padding: 8px !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 48px !important;
  height: 48px !important;
}

.modal-close:hover {
  opacity: 0.7 !important;
  transform: rotate(90deg) !important;
}

.modal-close svg {
  display: block !important;
  width: 32px !important;
  height: 32px !important;
  pointer-events: none !important;
}

/* Modal content container */
.modal-content {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999999998 !important;
  max-width: 1200px !important;
  max-height: 90vh !important;
  width: 90% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 0, 1) !important; /* DEBUG: BRIGHT YELLOW */
  padding: 40px !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow-y: auto !important;
  min-height: 600px !important;
}

/* Title */
.modal-title {
  font-family: 'PPSupplyMono', monospace;
  font-size: 48px;
  font-weight: 400;
  color: #fff;
  margin: 0 0 20px 0;
  text-align: center;
  line-height: 1.2;
  position: relative;
  z-index: 10;
  display: block;
  visibility: visible;
  opacity: 1;
  flex-shrink: 0;
}

/* Video container */
.modal-video-container {
  position: relative !important;
  width: 100% !important;
  max-width: 900px !important;
  aspect-ratio: 16 / 9 !important;
  background: #00ff00 !important; /* DEBUG: GREEN so we can see it */
  overflow: hidden !important;
  z-index: 10 !important;
  display: block !important;
  visibility: visible !important;
  flex-shrink: 0 !important;
  min-height: 400px !important;
}

/* Video canvas for shader effects */
.modal-video-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-video-canvas.active {
  opacity: 1;
}

/* Actual video element */
.modal-video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 1 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Play button - centered */
.modal-play-btn {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: none !important;
  border: none !important;
  color: #fff !important;
  cursor: pointer !important;
  z-index: 3 !important;
  padding: 0 !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.modal-play-btn:hover {
  opacity: 0.7;
  transform: translate(-50%, -50%) scale(1.1);
}

.modal-play-btn.hidden {
  display: none;
}

.modal-play-btn svg {
  display: block;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* Sound toggle - bottom right of video */
.modal-sound-toggle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  z-index: 3;
  padding: 8px;
  transition: opacity 0.3s ease, background 0.3s ease;
  display: none;
}

.modal-sound-toggle.visible {
  display: block;
}

.modal-sound-toggle:hover {
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.7);
}

.modal-sound-toggle svg {
  display: block;
}

/* Paragraph */
.modal-paragraph {
  font-family: 'PPSupplyMono', monospace;
  font-size: 14px;
  color: #ccc;
  margin: 20px 0 0 0;
  text-align: center;
  line-height: 1.6;
  max-width: 600px;
  position: relative;
  z-index: 10;
  display: block;
  visibility: visible;
  opacity: 1;
  flex-shrink: 0;
}

/* Animation variants - DISABLED FOR DEBUG */
/*
.modal-overlay[data-animation="scale"] .modal-content {
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.modal-overlay[data-animation="scale"].modal-hidden .modal-content {
  transform: scale(0.8);
  opacity: 0;
}

.modal-overlay[data-animation="slide-up"] .modal-content {
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.modal-overlay[data-animation="slide-up"].modal-hidden .modal-content {
  transform: translateY(50px);
  opacity: 0;
}
*/

/* Responsive */
@media (max-width: 768px) {
  .modal-title {
    font-size: 32px;
    margin-bottom: 16px;
  }

  .modal-close {
    top: 20px;
    right: 20px;
  }

  .modal-paragraph {
    font-size: 12px;
    margin-top: 16px;
  }

  .modal-play-btn svg {
    width: 60px;
    height: 60px;
  }
}
