/* ========== MOVIE PAGE STYLES ========== */

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

/* TMDB Notice Section */
.tmdb-notice-section {
  padding: 2rem 0;
  background: var(--color-background-alt, #f8f9fa);
  border-bottom: 1px solid var(--color-border, #e9ecef);
}

.tmdb-notice__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.tmdb-notice {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border-left: 4px solid var(--color-warning, #ffc107);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notice-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--color-warning-light, #fff3cd);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-warning, #856404);
}

.notice-icon .material-icons {
  font-size: 24px;
}

.notice-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text, #333);
}

.notice-content p {
  margin: 0;
  color: var(--color-text-secondary, #666);
  line-height: 1.5;
}

/* ========== ENHANCED HERO SECTION ========== */
.movie-hero {
  position: relative;
  min-height: 100dvh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 2rem;
}

.movie-hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.7) 40%,
    rgba(20, 20, 30, 0.9) 100%
  );
  z-index: 1;
}

.movie-hero__header {
  gap: 1rem;
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
}

.movie-hero__title-container {
  gap: 1rem;
  display: flex;
  flex-direction: column;
}

.movie-hero__content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 4rem;
  align-items: start;
}

/* Poster Section */
.movie-hero__poster {
  top: calc(var(--header-height) + 2rem);
  left: 0; 
  position: sticky;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(1px);
}

.movie-hero__poster:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

.movie-hero__poster-image {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 2/3;
  object-fit: cover;
}

/* Info Section */
.movie-hero__info {
  color: white;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Movie Information List */
.movie-info-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.movie-info-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

.movie-info-list {
  margin: 0;
  list-style: none;
}

.movie-actions {
  gap: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  position: relative;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.info-item:hover {
  transform: translateX(4px);
}

.info-item--synopsis {
  flex-direction: column;
  align-items: flex-start;
}

.info-icon {
  font-size: 1.5rem;
  color: var(--color-primary, #ff4757);
  opacity: 0.8;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.info-label {
  font-weight: 600;
  color: #e0e0e0;
  opacity: 0.8;
  flex: 0 0 120px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: #ffffff;
  flex: 1;
  text-align: right;
}

.info-item--synopsis .info-label {
  color: var(--color-white);
  opacity: 1;
  font-size: 1.25rem;
  text-transform: capitalize;
}

.info-item--synopsis .info-value {
  text-align: left;
  font-size: 1.05rem;
  line-height: 1.1;
}

.info-item__header {
  gap: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.movie-title {
  color: var(--color-white);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.movie-tagline {
  width: 100%;
  color: #e0e0e0;
  opacity: 0.9;
  font-size: 1.25rem;
  font-style: italic;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 300;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.1), rgba(255, 56, 56, 0.05));
  border-left: 4px solid var(--color-primary, #ff4757);
  border-radius: 0 0.75rem 0.75rem 0;
}

.movie-rating {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.75rem;
  background: linear-gradient(135deg, #ff4757, #ff3838);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.movie-rating .material-icons {
  font-size: 1.2rem;
}

.rating-score {
  font-size: 1rem;
  font-weight: 700;
}

.rating-label {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* ========== MAIN CONTENT SECTION ========== */
.movie-content {
  padding: 2rem 0;
}

/* ========== CAST SECTION ========== */
.movie-cast-section {
  padding: 2rem 0;
  background: linear-gradient(to bottom, transparent, rgba(248, 249, 250, 0.3));
}

.movie-cast__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Section Title Styles */
.section-title {
  position: relative;
  margin-bottom: 2rem;
  text-align: center;
}

.section-title__text {
  display: inline-block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-text, #333);
  margin: 0;
  position: relative;
  z-index: 2;
}

.section-title--tertiary .section-title__text {
  color: var(--color-text, #333);
}

.section-title__decoration {
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary, #ff4757), var(--color-primary-alt, #ff4545));
  border-radius: 2px;
}

.movie-cast__description {
  text-align: center;
  margin-bottom: 3rem;
}

.cast-description__text {
  font-size: 1.125rem;
  color: var(--color-text-secondary, #666);
  margin: 0;
  line-height: 1.6;
}

.movie-cast__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
  max-height: none;
  overflow: visible;
}

.movie-cast__grid.cast-expanded {
  max-height: none;
}

/* ========== CAST CARD UNIQUE STYLES ========== */

/* Cast Card Actions */
.cast-card__actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.article-card--person-movie:hover .cast-card__actions {
  opacity: 1;
  transform: translateY(0);
}

.cast-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--color-text, #333);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.cast-action-btn .material-icons {
  font-size: 20px;
}

.cast-action-btn:hover {
  background: var(--color-primary, #ff4757);
  color: white;
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
  text-decoration: none !important;
}

.cast-action-btn--info:hover {
  transform: scale(1.15) rotate(-5deg);
}

/* Cast Card Character Info */

.cast-card__character {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary, #666);
}

.character__label {
  opacity: 0.7;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.character__name {
  font-weight: 600;
  color: var(--color-text, #333);
  font-size: 0.875rem;
}

.cast-card__popularity {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border, #e9ecef);
}

.popularity__indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-warning, #ffc107);
  font-weight: 600;
}

.popularity__indicator .material-icons {
  font-size: 1.125rem;
  animation: flame 2s ease-in-out infinite;
}

@keyframes flame {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.popularity__value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-warning, #ffc107);
}


/* Cast Section Footer */
.cast-section__footer {
  margin-top: 3rem;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border, #e9ecef);
}

.cast-show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--color-primary, #ff4757), var(--color-primary-alt, #ff4545));
  color: white;
  border: none;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
  position: relative;
  overflow: hidden;
}

.cast-show-more-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.cast-show-more-btn:hover::before {
  width: 300px;
  height: 300px;
}

.cast-show-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

.cast-show-more-btn:active {
  transform: translateY(0);
}

.cast-show-more-btn .material-icons {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.cast-show-more-btn:hover .material-icons {
  transform: rotate(180deg);
}

.btn-text {
  position: relative;
  z-index: 1;
}

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

@media (max-width: 1200px) {
  .movie-title {
    font-size: 3rem;
  }

  .movie-rating {
    padding: 0.5rem 1rem;
  }

  .movie-info-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .movie-cast__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .movie-hero__header {
    align-items: normal;
    flex-direction: column-reverse;
  }
  
  .movie-hero__content {
    gap: 2rem;
  }

  .movie-title {
    font-size: 2.5rem;
  }

  .movie-tagline {
    font-size: 1rem;
    padding: 1rem 1.25rem;
  }

  .movie-rating {
    align-self: flex-end;
  }

  .movie-cast__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .movie-hero__content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .movie-hero__poster {
    top: 0;
    position: static;
  }

  .movie-rating {
    top: 1rem;
    right: 2rem;
    position: absolute;
  }

  .movie-hero__poster-image {
    aspect-ratio: 3/4;
  }

  .movie-info-wrapper {
    gap: 1rem;
  }

  /* Cast Section Responsive */
  .movie-cast-section {
    padding: 2rem 0;
  }

  .movie-cast__container {
    padding: 0 1rem;
  }

  .section-title__text {
    font-size: 2rem;
  }

  .movie-cast__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .article-card--person-movie .article-card__content {
    padding: 1.25rem;
  }

  .article-card--person-movie .article-card__title {
    font-size: 1rem;
  }

  .cast-show-more-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .movie-cast__grid {
    gap: 1rem;
  }
}

/* ========== ANIMATIONS ========== */
.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-on-scroll {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* ========== TRAILER MODAL ========== */
.trailer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.trailer-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.trailer-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.3s ease;
}

.trailer-modal.active .trailer-modal__overlay {
  background: rgba(0, 0, 0, 0.95);
}

.trailer-modal__content {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: #000;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.trailer-modal.active .trailer-modal__content {
  transform: scale(1) translateY(0);
}

.trailer-modal__header {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 1rem;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.1), rgba(0, 0, 0, 0.3));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trailer-modal__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.trailer-modal__close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.trailer-modal__close:hover {
  background: var(--color-primary, #ff4757);
  border-color: var(--color-primary, #ff4757);
  transform: rotate(90deg) scale(1.1);
}

.trailer-modal__close .material-icons {
  font-size: 24px;
}

.trailer-modal__body {
  position: relative;
  width: 100%;
  height: calc(100% - 4rem);
  overflow: hidden;
  background: #000;
}

.trailer-modal__body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive Trailer Modal */
@media (max-width: 768px) {
  .trailer-modal__content {
    width: 95%;
    max-height: 85vh;
    border-radius: 0.5rem;
  }

  .trailer-modal__header {
    height: 3rem;
  }

  .trailer-modal__title {
    font-size: 1.125rem;
  }

  .trailer-modal__close {
    width: 36px;
    height: 36px;
  }

  .trailer-modal__close .material-icons {
    font-size: 20px;
  }

  .trailer-modal__body {
    height: calc(100% - 3rem);
  }
}

/* ========== SIMILAR MOVIES SECTION ========== */
.movie-similar-section {
  padding: 2rem 0;
  background: linear-gradient(to bottom, rgba(248, 249, 250, 0.3), transparent);
}

.movie-similar__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.movie-similar__description {
  text-align: center;
  margin-bottom: 3rem;
}

.similar-description__text {
  font-size: 1.125rem;
  color: var(--color-text-secondary, #666);
  margin: 0;
  line-height: 1.6;
}

.movie-similar__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
}

/* ========== SIMILAR CARD UNIQUE STYLES ========== */

.similar-card__external-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #ff4757);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.similar-card__external-badge .material-icons {
  font-size: 18px;
}

/* Similar Card Title - override for line-clamp (only for similar movies) */
.movie-similar__grid .article-card--person-movie .article-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.similar-card__year {
  font-size: 0.875rem;
  color: var(--color-text-secondary, #666);
  margin: 0 0 0.75rem 0;
}

.similar-card__rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-warning, #ffc107);
  font-weight: 600;
}

.similar-card__rating .material-icons {
  font-size: 1.125rem;
}

.similar-card__rating .rating-value {
  font-weight: 700;
}


/* Responsive Similar Movies */

@media (max-width: 1200px) {
  .movie-similar__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .movie-similar__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .movie-similar-section {
    padding: 2rem 0;
  }

  .movie-similar__container {
    padding: 0 1rem;
  }

  .movie-similar__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .movie-similar__grid {
    gap: 1rem;
  }
}
