/* 
   custom-player.css - The Sanctuary Lightbox Modal
*/

.lightbox-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(5, 4, 3, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Fix Flexbox centering overflow bug */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-medium);
  overflow-y: auto; /* Enable scroll if height overflows */
  padding: 60px var(--space-sm) var(--space-lg); /* Safety scroll padding */
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.close-lightbox {
  position: fixed; /* Fixed position stays anchor-safe */
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.3);
  transition: all var(--trans-fast);
  z-index: 1010; /* Raise above iframe and overlays */
  background-color: rgba(5, 4, 3, 0.85); /* Solid backing on mobile overlays */
  backdrop-filter: blur(5px);
}

.close-lightbox svg {
  width: 24px; height: 24px;
  transition: transform var(--trans-fast);
}

.close-lightbox:hover {
  border-color: var(--color-gold);
  background: rgba(201, 168, 76, 0.1);
}

.close-lightbox:hover svg {
  transform: rotate(90deg);
}

.lightbox-content {
  width: 90%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: auto 0; /* Perfect vertical centering without top-cropping */
}

.hologram-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  /* Legacy browser aspect-ratio fallback */
  @supports not (aspect-ratio: 16/9) {
    height: 0;
    padding-bottom: 56.25%; /* 16:9 ratio */
  }
  background: #000;
  border: 1px solid var(--color-lapis);
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.1);
  overflow: hidden;
  border-radius: 4px;
}

/* Hologram visual effects */
.cyan-emitter {
  position: absolute;
  left: 0; width: 100%;
  height: 2px;
  background: var(--color-cyan);
  box-shadow: 0 0 10px var(--color-cyan);
  z-index: 2;
  opacity: 0.5;
}

.cyan-emitter.top { top: 0; }
.cyan-emitter.bottom { bottom: 0; }

.video-mock-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* For actual iframe or video injected via JS */
.video-mock-container iframe,
.video-mock-container video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  background: #000;
  display: block;
}

/* Restore default cursor over active lightbox to allow interaction with native controls */
body.lightbox-active,
body.lightbox-active a,
body.lightbox-active button,
body.lightbox-active video {
  cursor: auto !important;
}

/* Hide custom cursor when lightbox is active to avoid visual overlap */
body.lightbox-active .custom-cursor-dot,
body.lightbox-active .custom-cursor-ring {
  display: none !important;
}

/* Information Tabs */
.scribe-tabs {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  padding-bottom: var(--space-xs);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--color-sand);
  font-family: var(--font-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  padding: 0.5em 1em;
  cursor: pointer;
  opacity: 0.6;
  position: relative;
  transition: opacity var(--trans-fast);
}

.tab-btn:hover {
  opacity: 1;
}

.tab-btn.active {
  opacity: 1;
  color: var(--color-gold);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -9px; /* align with border */
  left: 0; width: 100%;
  height: 2px;
  background: var(--color-gold);
}

.tab-content {
  display: none;
  padding: var(--space-md) 0;
  text-align: center;
  color: var(--color-sand);
  animation: fadeIn var(--trans-fast);
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive tweaks for narrow displays and mobile landscapes */
@media (max-width: 900px) {
  .lightbox-content {
    width: 100%;
    gap: var(--space-sm);
    padding-top: var(--space-xl); /* Create spacing below the fixed close button */
  }
  .close-lightbox {
    width: 40px;
    height: 40px;
  }
}
