/* ============= MOVIE PAGE WRAPPER ============= */

.movie-page-wrapper {
  min-height: 100vh;
  position: relative;
}

/* Fondo con poster difuminado */
.movie-page-wrapper[data-has-poster="true"]::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--poster-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(20px);
  transform: scale(1.1);
  z-index: -2;
}

/* Overlay oscuro para el poster */
.movie-page-wrapper[data-has-poster="true"]::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: -1;
}

/* Fallback: textura de celuloide cuando no hay poster */
.movie-page-wrapper[data-has-poster="false"] {
  background: url("/images/old_celluloid.png") repeat;
  background-size: 400px 400px;
}

.movie-page-wrapper[data-has-poster="false"]::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: -1;
}

/* ============= MOVIE HEADER ============= */

.movie-header {
  background-color: #1a54fa;
  filter: brightness(0.8) contrast(0.9);
  animation: flicker 3s infinite;
  padding: 2rem 1rem;
  background-image:
    linear-gradient(to right, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to bottom, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to left, rgba(107, 63, 47, 0.8) 6px, transparent 6px),
    linear-gradient(to top, rgba(107, 63, 47, 0.8) 6px, transparent 6px);
  background-position:
    0 0,
    0 0,
    100% 0,
    0 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-bottom: 2rem;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
}

.movie-info h1 {
  font-family: "Special Elite", cursive;
  color: #f5d742;
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.viewing-count {
  font-family: "Special Elite", cursive;
  color: #c9be9c;
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.navigation-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.navigation-links a {
  font-family: "Special Elite", cursive;
  color: #f5d742;
  text-decoration: none;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.navigation-links a:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
}

.no-reviews {
  font-family: "Special Elite", cursive;
  color: #f5d742;
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-style: italic;
}

/* ============= NO REVIEWS MESSAGE ============= */

.no-reviews-message {
  background: url("/images/old_celluloid.png") repeat;
  background-size: cover;
  border: 4px solid rgba(107, 63, 47, 0.8);
  border-radius: 8px;
  padding: 3rem 2rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.no-reviews-message::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  z-index: 0;
}

.no-reviews-message p:first-child {
  font-size: 2rem;
  color: #f5d742;
  margin-bottom: 1.5rem;
  font-family: "Special Elite", cursive;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.movie-overview {
  font-family: "Special Elite", cursive;
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

/* ============= REVIEWS TIMELINE ============= */

.reviews-timeline {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.review-card {
  background: url("/images/old_celluloid.png") repeat;
  background-size: cover;
  border: 4px solid rgba(107, 63, 47, 0.8);
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
  animation: fadeIn 0.5s ease-in;
}

.review-header {
  margin-bottom: 1rem;
}

.review-header h2 {
  font-family: "Special Elite", cursive;
  color: #1a54fa;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.watch-date {
  font-family: "Special Elite", cursive;
  color: #6b3f2f;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.selector {
  font-family: "Special Elite", cursive;
  color: #1a54fa;
  font-size: 0.9rem;
}

.selector strong {
  color: #6b3f2f;
}

/* ============= VIDEO PREVIEW ============= */

.video-preview {
  position: relative;
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 400px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

lite-youtube {
  background-color: #000;
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  contain: content;
  background-position: center center;
  background-size: cover;
  cursor: pointer;
  z-index: 1;
}

lite-youtube::before {
  content: "";
  display: block;
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
}

lite-youtube.lyt-activated {
  z-index: 2;
}

lite-youtube iframe {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border: 0;
  z-index: 2;
}

.video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: "Special Elite", cursive;
  font-size: 1.2rem;
  pointer-events: none;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  z-index: 3;
  transition: opacity 0.3s ease;
}

lite-youtube.lyt-activated + .video-overlay {
  opacity: 0;
  pointer-events: none;
}

/* ============= MOOD COMPARISON ============= */

.mood-comparison {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

.mood-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.mood-label {
  font-family: "Special Elite", cursive;
  font-size: 0.8rem;
  color: #6b3f2f;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mood-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: rgba(26, 84, 250, 0.2);
  border: 2px solid #1a54fa;
  border-radius: 8px;
  padding: 1rem;
  min-width: 100px;
}

.mood-badge.final {
  background: rgba(201, 190, 156, 0.2);
  border-color: #c9be9c;
}

.mood-emoji {
  font-size: 2rem;
  line-height: 1;
}

.mood-name {
  font-family: "Special Elite", cursive;
  font-size: 0.75rem;
  color: #1a54fa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mood-badge.final .mood-name {
  color: #6b3f2f;
}

/* ============= TEXT PREVIEW ============= */

.text-preview {
  font-family: "Special Elite", cursive;
  color: #000;
  line-height: 1.6;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  margin: 1rem 0;
}

/* ============= REVIEW FOOTER ============= */

.review-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.view-full-review {
  font-family: "Special Elite", cursive;
  display: inline-block;
  background: #1a54fa;
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.view-full-review:hover {
  background: #c9be9c;
  color: #000;
  border-color: #6b3f2f;
  transform: scale(1.05);
}

/* ============= ANIMATIONS ============= */

@keyframes flicker {
  0%,
  100% {
    filter: brightness(0.8) contrast(0.9);
  }
  50% {
    filter: brightness(0.9) contrast(1);
  }
  75% {
    filter: brightness(0.85) contrast(1.05);
  }
}

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

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

@media screen and (max-width: 768px) {
  .movie-info h1 {
    font-size: 1.5rem;
  }

  .viewing-count {
    font-size: 1rem;
  }

  .review-card {
    padding: 1rem;
  }

  .review-header h2 {
    font-size: 1.2rem;
  }

  .mood-comparison {
    gap: 1rem;
  }

  .mood-badge {
    min-width: 80px;
    padding: 0.75rem;
  }

  .mood-emoji {
    font-size: 1.5rem;
  }

  .video-overlay {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
}

@media screen and (max-width: 480px) {
  .movie-header {
    padding: 1rem 0.5rem;
  }

  .movie-info h1 {
    font-size: 1.2rem;
  }

  .viewing-count {
    font-size: 0.9rem;
  }

  .navigation-links a {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .mood-comparison {
    flex-direction: column;
    gap: 0.75rem;
  }

  .video-preview {
    max-height: 250px;
  }

  .video-overlay {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Fallback para navegadores que no soportan aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .video-preview {
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
  }

  .video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}
