/* Details View - Ultimate Premium Redesign (Cinematic Glass) */

#details-view {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: #050608;
  color: #fff;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
}

/* Immersive Backdrop */
.details-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  opacity: 0.6;
  /* Slightly higher visibility for impact */
  z-index: 0;
  transition: opacity 1s ease;
}

/* Cinematic Gradient Overlay */
.details-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, transparent 0%, #050608 90%),
    linear-gradient(to right, #050608 20%, rgba(5, 6, 8, 0.85) 50%, rgba(5, 6, 8, 0.6) 100%),
    linear-gradient(to top, #050608 0%, rgba(5, 6, 8, 0) 40%);
  z-index: 1;
}

/* Dynamic Particles (Optional visual flair - CSS only) */
.details-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.05)"/></svg>');
  opacity: 0.3;
  z-index: 1;
}

/* Top Bar Styling Override */
.details-top-bar {
  position: relative;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(5, 6, 8, 0.9), transparent);
  padding: 30px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(0px);
  /* Clean look */
}

/* Main Content Layout */
.details-content {
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  height: calc(100% - 100px);
  /* Adjust for header */
  padding: 20px 60px 60px 60px;
  box-sizing: border-box;
  gap: 60px;
  overflow: hidden;
}

/* ----------------------------------------------------
   Left Column: Poster & Actions
   ---------------------------------------------------- */
.details-left {
  width: 380px;
  /* Wider, punchier poster */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
  perspective: 1000px;
  animation: slideInLeft 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.poster-wrapper {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  background: #1a1d24;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.poster-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Action Buttons */
.details-actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.action-btn {
  background: rgba(20, 20, 25, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 18px 24px;
  border-radius: 50px;
  /* Pill shape for premium modern look */
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(15px);
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
}

.action-btn i {
  font-size: 1.4rem;
  transition: transform 0.3s ease;
}

/* Primary Play Button */
.action-btn.primary,
#btn-play {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #fff;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 242, 254, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#btn-play::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
}

#btn-play:hover::before,
#btn-play:focus::before {
  left: 150%;
}

.action-btn:hover,
.action-btn:focus,
.action-btn.focus-visible {
  transform: translateY(-5px);
  outline: none;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.4);
  z-index: 5;
}

.action-btn:hover i,
.action-btn:focus i {
  transform: scale(1.2);
}

.action-btn.primary:hover,
.action-btn.primary:focus,
#btn-play:hover,
#btn-play:focus {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 15px 40px rgba(0, 242, 254, 0.6), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transform: translateY(-5px) scale(1.05);
}

/* Secondary Back Button */
.action-btn.secondary,
#btn-back {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn.secondary:hover,
.action-btn.secondary:focus,
.action-btn.secondary.focus-visible,
#btn-back:hover,
#btn-back:focus,
#btn-back.focus-visible {
  background: #fff !important;
  border-color: #fff !important;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3) !important;
  color: #050608 !important;
}

.action-btn.secondary:hover i,
.action-btn.secondary:focus i,
.action-btn.secondary.focus-visible i,
#btn-back:hover i,
#btn-back:focus i,
#btn-back.focus-visible i {
  color: #050608 !important;
}

/* ----------------------------------------------------
   Right Area: 3-Column Layout Wrapper
   ---------------------------------------------------- */
.details-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  animation: fadeIn 1s ease forwards;
}

/* The Grid: Info | Player | Episodes */
.details-upper-section {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  min-height: 0;
  /* Important for flex child scrolling */
}

/* --- Column 1: Info (Metadata, Plot, Cast) --- */
.details-text-col {
  flex: 0 0 25%;
  /* Fixed width */
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  height: 100%;
  padding-right: 15px;
  padding-bottom: 20px;
  mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
  /* Soft fade scroll */
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 1rem;
  color: #a0a5b5;
  margin-top: 10px;
}

.meta-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.rating-box {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.genre-row {
  font-size: 1.1rem;
  color: #40c4ff;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.plot-text {
  font-family: 'Roboto', sans-serif;
  /* Clean reading font */
  font-size: 1.15rem;
  line-height: 1.7;
  color: #e0e6ed;
  opacity: 0.9;
  font-weight: 300;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cast-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cast-item {
  font-size: 0.9rem;
  color: #8a94a6;
  background: transparent;
  padding: 4px 0;
}

/* --- Column 2: Player (Center Stage) --- */
.details-player-col {
  flex: 1;
  /* Takes remaining space */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  position: relative;
}

.details-player-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 100%;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.details-player-container:focus,
.details-player-container.focus-visible {
  outline: 4px solid #fff;
  transform: scale(1.02);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 1);
  border-color: rgba(255, 255, 255, 0.5);
  z-index: 10;
}

.details-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Column 3: Series Episodes (Right Sidebar) --- */
.details-right-col {
  flex: 0 0 22%;
  /* Fixed width */
  min-width: 280px;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(20, 22, 28, 0.6);
  /* Glass pane */
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

#series-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.season-list-container {
  padding: 20px 25px;
  background: transparent;
  position: relative;
}

.season-list-container h3 {
  font-size: 0.9rem;
  color: #fff;
  text-transform: uppercase;
  margin: 0 0 15px 0;
  letter-spacing: 2px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.horizontal-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 15px;
  /* space for focus shadow */
  scrollbar-width: none;
  /* Hide scrollbar Firefox */
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.horizontal-list::-webkit-scrollbar {
  display: none;
}

.season-item {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  /* Darker gray for inactive */
  border-radius: 8px;
  /* Slightly less rounded than pill */
  cursor: pointer;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 500;
  color: #ccc;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.season-item.active {
  background: #ff6b00;
  /* Solid orange */
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
}

.season-item:focus,
.season-item.focus-visible {
  background: #e6e6e6;
  color: #111;
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.season-item.active:focus,
.season-item.active.focus-visible {
  background: #fff;
  color: #ff6b00;
}

.season-dot {
  font-size: 0.5em;
  opacity: 0.7;
}

.episode-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px 20px;
}

.episode-list-container h3 {
  font-size: 1.2rem;
  color: #fff;
  margin: 0 0 15px 0;
  font-weight: 600;
}

.episode-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.episode-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 18px;
  background: #18191c;
  /* Solid dark background matching mockup */
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.episode-card:hover {
  background: #25262a;
}

.episode-card:focus,
.episode-card.focus-visible {
  border: 1px solid rgba(255, 107, 0, 0.5) !important;
  background: #2a2a2e !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
  transform: scale(1.01);
}

.ep-num {
  font-size: 1rem;
  font-weight: 700;
  color: #6c757d;
  /* Subdued grey */
  min-width: 35px;
}

.episode-card:focus .ep-num {
  color: #ff6b00;
}

.ep-title {
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  color: #fff;
  font-weight: 500;
}

.episode-card:focus .ep-title {
  font-weight: 600;
}

/* ----------------------------------------------------
   Related Content (Bottom) - Professional Redesign
   ---------------------------------------------------- */
.related-section {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 25px;
  margin-top: auto;
  position: relative;
}

.related-section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, #ff6b00, transparent);
}

.related-section h3 {
  font-size: 1rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.related-section h3::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: #ff6b00;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
}

.related-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 15px 5px 35px 5px;
  /* More bottom padding for hover effects */
  mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
  scrollbar-width: none;
}

.related-grid::-webkit-scrollbar {
  display: none;
}

.related-card {
  width: 150px;
  /* Slightly larger */
  flex-shrink: 0;
  aspect-ratio: 2/3;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #1a1d24;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.related-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  filter: brightness(0.9);
}

/* Hover & Focus Effects */
.related-card:hover,
.related-card:focus,
.related-card.focus-visible {
  transform: translateY(-10px) scale(1.05);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.6),
    0 0 0 2px rgba(255, 107, 0, 0.7);
  /* Orange Glow Border */
  z-index: 10;
  border-color: transparent;
}

.related-card:hover img,
.related-card:focus img {
  transform: scale(1.15);
  filter: brightness(1.1);
}

/* Title Overlay Gradient */
.related-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 10%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
  padding: 40px 10px 15px 10px;
  /* Taller gradient area */
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateY(100%);
  /* Hidden by default */
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Show Title on Hover */
.related-card:hover .related-title,
.related-card:focus .related-title {
  transform: translateY(0);
  opacity: 1;
}

/* Play Icon Overlay */
.related-card::after {
  content: '\f04b';
  /* FontAwesome Play */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 2rem;
  color: #fff;
  background: rgba(255, 107, 0, 0.8);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px rgba(255, 107, 0, 0.5);
  backdrop-filter: blur(4px);
}

.related-card:hover::after,
.related-card:focus::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* Resume Modal */
.modal-overlay {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.modal-box {
  background: #15171e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

.modal-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-btn.primary {
  background: #ff6b00;
  border-color: #ff6b00;
}

/* --- Actor Cast Scroller (Wrapping) --- */
.cast-scroller {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 10px 5px;
  /* Removed overflow/mask to allow full visibility */
}

/* Scrollbar hiding no longer needed but kept for safety if content overflows container in other ways */
.cast-scroller::-webkit-scrollbar {
  display: none;
}

.actor-card {
  flex: 0 0 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.actor-card:hover {
  transform: translateY(-5px);
}

.actor-img-box {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  /* Circular */
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
}

.actor-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.actor-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #333 0%, #444 100%);
  color: #ccc;
  font-weight: 600;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.actor-name {
  font-size: 0.8rem;
  color: #a0a5b5;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* --- Focus States for Remote Navigation --- */

/* Actor Card Focus */
.actor-card:focus,
.actor-card.focus-visible {
  transform: translateY(-5px) scale(1.1);
  outline: none;
  z-index: 10;
}

.actor-card:focus .actor-img-box,
.actor-card.focus-visible .actor-img-box {
  border-color: #ff6b00;
  /* Orange highlight */
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.5);
}

.actor-card:focus .actor-name,
.actor-card.focus-visible .actor-name {
  color: #fff;
  font-weight: 600;
}

/* Plot Text Focus (Description) */
.plot-text:focus,
.plot-text.focus-visible {
  outline: 2px solid rgba(255, 107, 0, 0.5);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}