/* ==================== WATCH PORTAL - CINEMATIC VIDEO VIEWER ==================== */

/* Portal overlay */
.watch-portal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.watch-portal.active {
  display: flex;
  opacity: 1;
}

.watch-portal-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Close button */
.watch-portal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 16, 14, 0.6);
  color: rgba(245, 241, 234, 0.9);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.watch-portal-close:hover {
  border-color: rgba(245, 210, 170, 0.5);
  background: rgba(20, 16, 14, 0.8);
  transform: rotate(90deg) scale(1.1);
}

/* Video player area */
.watch-player-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.watch-player-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.watch-player-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.watch-player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 14, 0.4);
  color: rgba(245, 241, 234, 0.7);
  font-size: 1rem;
  backdrop-filter: blur(8px);
}

.watch-player-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(20, 16, 14, 0.6);
  color: rgba(245, 241, 234, 0.8);
  padding: 2rem;
  text-align: center;
  backdrop-filter: blur(10px);
}

.watch-player-error-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #f5f1ea;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.watch-player-error-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(245, 210, 170, 0.4);
}

/* Thumbnail carousel */
.watch-thumbnails {
  position: relative;
  padding: 1.5rem 0 2rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.watch-thumbnails-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 2rem;
  -webkit-overflow-scrolling: touch;
}

.watch-thumbnails-track::-webkit-scrollbar {
  height: 4px;
}

.watch-thumbnails-track::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.watch-thumbnails-track::-webkit-scrollbar-thumb {
  background: rgba(245, 210, 170, 0.3);
  border-radius: 2px;
}

.watch-thumbnail {
  flex: 0 0 auto;
  width: 200px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: all 0.3s ease;
}

.watch-thumbnail:hover {
  transform: translateY(-4px);
}

.watch-thumbnail.active {
  transform: translateY(-6px);
}

.watch-thumbnail-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(20, 16, 14, 0.4);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.watch-thumbnail.active .watch-thumbnail-image {
  border-color: rgba(245, 210, 170, 0.6);
  box-shadow: 0 8px 24px rgba(245, 210, 170, 0.2);
}

.watch-thumbnail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.watch-thumbnail:hover .watch-thumbnail-image img {
  opacity: 0.8;
}

.watch-thumbnail-title {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(245, 241, 234, 0.7);
  text-align: center;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.watch-thumbnail.active .watch-thumbnail-title {
  color: rgba(245, 210, 170, 0.9);
  font-weight: 600;
}

/* Navigation arrows */
.watch-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 16, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(245, 241, 234, 0.9);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.watch-nav-arrow:hover {
  background: rgba(20, 16, 14, 0.8);
  border-color: rgba(245, 210, 170, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.watch-nav-arrow.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.watch-nav-prev {
  left: 0.5rem;
}

.watch-nav-next {
  right: 0.5rem;
}

/* Loading skeleton */
.watch-thumbnails-skeleton {
  display: flex;
  gap: 1rem;
  padding: 0 2rem;
}

.watch-thumbnail-skeleton {
  flex: 0 0 auto;
  width: 200px;
}

.watch-thumbnail-skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.6; }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .watch-portal-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  .watch-player-area {
    padding: 1rem;
  }

  .watch-thumbnail {
    width: 160px;
  }

  .watch-thumbnails-track {
    padding: 0 1rem;
  }

  .watch-nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .watch-thumbnail {
    width: 140px;
  }

  .watch-thumbnail-title {
    font-size: 0.75rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .watch-portal,
  .watch-thumbnail,
  .watch-nav-arrow,
  .watch-portal-close {
    transition: none !important;
  }

  .watch-thumbnails-track {
    scroll-behavior: auto;
  }
}
