/* ==================== CINEMATIC TRAILER MODAL ==================== */

.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.trailer-modal--open {
  display: flex;
  opacity: 1;
}

/* Close button */
.trailer-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10010;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.3s;
}
.trailer-close:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

/* ==================== STAGE ==================== */

.trailer-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ==================== IFRAME AUTO-SCROLL ==================== */

.trailer-iframe-wrap {
  position: absolute;
  inset: 7% 5%;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1s ease;
  box-shadow: 0 0 80px rgba(0,0,0,0.5), 0 0 200px rgba(59,130,246,0.08);
}

.trailer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  transform-origin: top center;
}

/* ==================== OVERLAYS ==================== */

.trailer-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%);
}

.trailer-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 256px;
  animation: grainShift 0.4s steps(4) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0,0); }
  25% { transform: translate(-2px,2px); }
  50% { transform: translate(2px,-2px); }
  75% { transform: translate(-1px,-1px); }
}

.trailer-letterbox {
  position: absolute;
  left: 0; right: 0;
  height: 7%;
  background: #000;
  z-index: 4;
}
.trailer-letterbox--top { top: 0; }
.trailer-letterbox--bottom { bottom: 0; }

/* ==================== PROGRESS BAR ==================== */

.trailer-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
  z-index: 10;
}
.trailer-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #e50914, #ff6b6b);
  width: 0%;
  transition: width 0.1s linear;
}

/* ==================== TITLE CARD ==================== */

.trailer-title-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.trailer-title-card--active {
  animation: titleCardPulse 1.5s ease-out forwards;
}

@keyframes titleCardPulse {
  0% { opacity: 0; }
  20% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.trailer-title-card__name {
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  color: #fff;
  text-align: center;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 4px 40px rgba(0,0,0,0.6);
  animation: titleZoomIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes titleZoomIn {
  0% { transform: scale(0.6); opacity: 0; filter: blur(20px); }
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

.trailer-title-card__sub {
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  color: rgba(255,255,255,0.5);
  margin-top: 20px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  animation: titleSubIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

@keyframes titleSubIn {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0.6; }
}

/* ==================== END CARD ==================== */

.trailer-end-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  gap: 28px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}

.trailer-end-card--active {
  opacity: 1;
  pointer-events: auto;
  animation: endFadeIn 1s ease-out forwards;
}

@keyframes endFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.trailer-end-card__title {
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  text-align: center;
}

.trailer-end-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  background: #e50914;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s;
}

.trailer-end-card__cta:hover {
  background: #ff1a25;
  transform: scale(1.05);
}

.trailer-end-card__cta svg {
  width: 20px;
  height: 20px;
}

/* ==================== VIEW TRAILER BUTTON ==================== */

.onf-btn--trailer {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  gap: 8px;
  transition: all 0.3s ease;
}

.onf-btn--trailer:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
}

.onf-btn--trailer svg {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .onf-btn--trailer {
  border-color: rgba(0,0,0,0.3);
  color: #1a1a2e;
}
[data-theme="light"] .onf-btn--trailer:hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.5);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 810px) {
  .trailer-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .trailer-iframe-wrap {
    inset: 5% 2%;
    border-radius: 10px;
  }
  .trailer-letterbox { height: 4%; }
}
