/* Preview Page Stylesheet */

.preview-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 2rem;
  z-index: 2;
}

/* Header style for board preview */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  z-index: 10;
}

.board-title-container {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.board-logo {
  height: 85px;
  width: 85px;
  border-radius: 50%;
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 15px var(--color-gold-glow);
  background: white;
}

.board-title h1 {
  font-size: 2.2rem;
  margin-bottom: 0.2rem;
  background: linear-gradient(135deg, var(--color-gold) 30%, var(--color-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.board-title p {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Interstitial Gate Screen for Autoplay permission */
.gate-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, #0c2016 0%, #030805 100%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.gate-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.gate-title {
  font-size: 3rem;
  text-align: center;
  max-width: 800px;
  padding: 0 1rem;
}

.gate-btn {
  font-size: 1.2rem;
  padding: 1.2rem 2.5rem;
  border-radius: 6px;
  animation: pulseButton 2s infinite ease-in-out;
}

@keyframes pulseButton {
  0%, 100% {
    box-shadow: 0 0 15px var(--color-gold-glow);
  }
  50% {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4), 0 0 5px var(--color-emerald);
  }
}

/* Cinematic Slideshow Section */
.slideshow-container {
  flex-grow: 1;
  width: 100%;
  max-width: 1200px; /* Widened for roulette/adjacent view */
  margin: 2rem auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-bronze);
  background: radial-gradient(circle, rgba(12, 28, 20, 0.9) 0%, rgba(4, 13, 9, 0.95) 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.8),
    inset 0 0 50px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  perspective: 1200px; /* 3D depth field */
}

/* Corner highlights for the slideshow frame */
.slideshow-container::before,
.slideshow-container::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid var(--color-gold);
  pointer-events: none;
  z-index: 20; /* High z-index to overlay slides */
}
.slideshow-container::before {
  top: 15px;
  left: 15px;
  border-right: none;
  border-bottom: none;
}
.slideshow-container::after {
  bottom: 15px;
  right: 15px;
  border-left: none;
  border-top: none;
}

.slide {
  position: absolute;
  width: 50%; /* Slides take up half width, allowing adjacent ones to peek */
  height: 90%;
  left: 25%;  /* Centered */
  opacity: 0;
  transform: translateX(0) scale(0.4) rotateY(0);
  transition: 
    transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    z-index 0.8s step-end;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

/* Middle active photo */
.slide.active {
  opacity: 1;
  transform: translateX(0) scale(1.05) rotateY(0);
  z-index: 10;
  pointer-events: auto;
}

/* Left previous photo */
.slide.prev {
  opacity: 0.35;
  transform: translateX(-75%) scale(0.7) rotateY(25deg);
  z-index: 5;
  pointer-events: auto;
}

/* Right next photo */
.slide.next {
  opacity: 0.35;
  transform: translateX(75%) scale(0.7) rotateY(-25deg);
  z-index: 5;
  pointer-events: auto;
}

.slide-img {
  max-width: 95%; /* Enlarged from 82% */
  max-height: 95%;
  object-fit: contain;
  border: 10px solid #14110f; /* Carved dark wood frame */
  outline: 2px solid var(--color-gold); /* Brass plate outline */
  border-radius: 4px;
  box-shadow: 
    0 20px 45px rgba(0, 0, 0, 0.9),
    0 0 35px rgba(16, 185, 129, 0.15);
  transition: transform 1.5s cubic-bezier(0.1, 1, 0.1, 1);
}

.slide.active .slide-img {
  animation: jumanjiKenBurns 24s ease-in-out infinite alternate;
}

@keyframes jumanjiKenBurns {
  0% {
    transform: scale(0.98) translate(0, 0);
  }
  100% {
    transform: scale(1.04) translate(2px, -3px);
  }
}

/* Empty state message */
.empty-gallery {
  text-align: center;
  font-family: var(--font-title);
  color: var(--color-text-muted);
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  padding: 2rem;
  animation: hoverFloat 4s infinite ease-in-out;
}

@keyframes hoverFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Bottom thumbnails strip */
.thumbnails-strip {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  z-index: 10;
}

.thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid var(--color-bronze);
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition-quick);
}

.thumb:hover, .thumb.active {
  opacity: 1;
  border-color: var(--color-emerald);
  box-shadow: 0 0 12px var(--color-emerald-glow);
  transform: scale(1.05);
}

/* ---------------------------------------------------- */
/* DRAMATIC NEW PHOTO EVENT LAYER */
/* ---------------------------------------------------- */

.overlay-event-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 13, 9, 0.95);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-out;
}

.overlay-event-screen.active {
  opacity: 1;
  pointer-events: all;
}

.glow-ambient-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease-out;
}

.overlay-event-screen.active .glow-ambient-bg {
  opacity: 1;
}

.event-banner {
  font-family: var(--font-title);
  color: var(--color-gold);
  font-size: 2rem;
  letter-spacing: 0.2em;
  margin-bottom: 2.5rem;
  text-shadow: 0 0 15px var(--color-gold-glow);
  opacity: 0;
  transform: translateY(-20px);
  z-index: 105;
}

.overlay-event-screen.active .event-banner {
  animation: bannerEnter 0.8s 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bannerEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Image container that holds the popup image */
.event-photo-wrapper {
  position: relative;
  max-width: 80%;
  max-height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 105;
}

.event-photo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
}

/* 1. Vortex Entrance */
.anim-vortex {
  animation: vortexIn 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  box-shadow: 
    0 0 40px var(--color-emerald-glow),
    0 0 80px rgba(16, 185, 129, 0.2),
    0 0 0 4px var(--color-emerald);
}

@keyframes vortexIn {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-720deg);
    filter: blur(20px);
  }
  70% {
    opacity: 0.9;
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0);
  }
}

/* 2. Tremor (Earthquake Drop) Entrance */
.anim-tremor {
  animation: tremorIn 1.4s ease-out forwards;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.9),
    0 0 0 4px var(--color-bronze);
}

@keyframes tremorIn {
  0% {
    opacity: 0;
    transform: translateY(-800px) scaleY(2) scaleX(0.5);
  }
  40% {
    opacity: 1;
    transform: translateY(0) scaleY(0.9) scaleX(1.1);
  }
  50% { transform: translateY(-20px) scale(1); }
  60% { transform: translateY(0) rotate(1.5deg); }
  65% { transform: translate(-3px, 3px) rotate(-1.5deg); }
  70% { transform: translate(3px, -2px) rotate(1deg); }
  75% { transform: translate(-2px, -3px) rotate(-1deg); }
  80% { transform: translate(2px, 2px) rotate(0.5deg); }
  85% { transform: translate(-1px, 1px) rotate(-0.5deg); }
  90% { transform: translate(0) rotate(0); }
  100% {
    opacity: 1;
    transform: translate(0) rotate(0);
  }
}

/* Screenshake applied to the container background during tremor */
.shake-screen {
  animation: screenShake 0.6s 0.4s ease-out;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-8px, 6px); }
  20% { transform: translate(8px, -6px); }
  30% { transform: translate(-6px, -4px); }
  40% { transform: translate(6px, 4px); }
  50% { transform: translate(-4px, 2px); }
  60% { transform: translate(4px, -2px); }
  70% { transform: translate(-2px, -1px); }
  80% { transform: translate(2px, 1px); }
  90% { transform: translate(-1px, 0); }
}

/* 3. Mystic Reveal (Foggy Expand) Entrance */
.anim-reveal {
  animation: revealIn 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 
    0 0 50px rgba(197, 168, 128, 0.3),
    0 0 0 4px var(--color-gold);
}

@keyframes revealIn {
  0% {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(30px) contrast(150%);
  }
  50% {
    opacity: 0.6;
    filter: blur(10px) contrast(120%);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) contrast(100%);
  }
}

/* Exit fade (applied to image before closing) */
.event-photo.fade-out {
  animation: exitFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes exitFade {
  to {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    filter: blur(10px);
  }
}
