/* Fullscreen Media Modal - Cinematic Zoom Experience */

:root {
  --modal-backdrop: rgba(0, 0, 0, 0.96);
  --modal-timing: cubic-bezier(0.4, 0.0, 0.2, 1);
  --modal-duration: 600ms;
  --close-btn-size: 56px;
}

/* Modal Backdrop */
.fullscreen-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--modal-backdrop);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--modal-duration) var(--modal-timing);
  backdrop-filter: blur(0px);
}

.fullscreen-modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
  backdrop-filter: blur(8px);
}

/* Modal Container */
.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--modal-duration) var(--modal-timing);
}

.fullscreen-modal.active {
  opacity: 1;
  pointer-events: all;
}

/* Media Content Wrapper */
.fullscreen-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  transform: scale(0.85);
  opacity: 0;
  transition: all var(--modal-duration) var(--modal-timing);
  box-shadow:
    0 50px 100px -20px rgba(0, 0, 0, 0.8),
    0 30px 60px -30px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.fullscreen-modal.active .fullscreen-modal-content {
  transform: scale(1);
  opacity: 1;
  transition-delay: 50ms;
}

/* Video & Image Styling */
.fullscreen-modal-content video,
.fullscreen-modal-content img {
  display: block;
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

/* Close Button - Refined & Minimal */
.fullscreen-modal-close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: var(--close-btn-size);
  height: var(--close-btn-size);
  border: none;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 250ms cubic-bezier(0.4, 0.0, 0.2, 1);
  opacity: 0;
  transform: scale(0.8) translateY(-10px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.fullscreen-modal.active .fullscreen-modal-close {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition-delay: 150ms;
}

.fullscreen-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.fullscreen-modal-close:active {
  transform: scale(0.95);
}

/* Close Icon - Custom SVG */
.fullscreen-modal-close svg {
  width: 24px;
  height: 24px;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke 200ms ease;
}

.fullscreen-modal-close:hover svg {
  stroke: #ffffff;
}

/* Loading State */
.fullscreen-modal-content::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: modal-spin 0.8s linear infinite;
  opacity: 0;
  pointer-events: none;
}

.fullscreen-modal-content.loading::before {
  opacity: 1;
}

@keyframes modal-spin {
  to { transform: rotate(360deg); }
}

/* Cursor Hint */
.fullscreen-modal-backdrop {
  cursor: zoom-out;
}

.step2-video,
.step2-image {
  cursor: zoom-in;
  transition: transform 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.step2-video-container:hover .step2-video,
.step2-video-container:hover .step2-image {
  transform: scale(1.02);
}

/* Zoom Icon Indicator */
.step2-video-container {
  position: relative;
}

/* Only show zoom icon on video containers, not image containers */
.step2-video-container:not(.image-container)::after {
  content: '';
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  border-radius: 50%;
  pointer-events: none;
  opacity: 1;
  transform: scale(1);
  transition: all 350ms cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.95)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

.step2-video-container:not(.image-container):hover::after {
  transform: scale(1.08);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  :root {
    --close-btn-size: 48px;
  }

  .fullscreen-modal-close {
    top: 1rem;
    right: 1rem;
  }

  .fullscreen-modal {
    padding: 1rem;
  }

  .fullscreen-modal-content video,
  .fullscreen-modal-content img {
    max-width: 100vw;
    max-height: 100vh;
  }

  /* Smaller zoom icon on mobile */
  .step2-video-container::after {
    width: 40px;
    height: 40px;
    bottom: 1rem;
    left: 1rem;
    background-size: 20px 20px;
  }
}

/* Prevent scroll when modal is open */
body.modal-open {
  overflow: hidden;
  height: 100vh;
}

/* Accessibility - Focus States */
.fullscreen-modal-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
}

/* Performance Optimization */
.fullscreen-modal,
.fullscreen-modal-backdrop,
.fullscreen-modal-content {
  will-change: opacity, transform;
}

.fullscreen-modal.active,
.fullscreen-modal-backdrop.active {
  will-change: auto;
}
