/* ==========================================================================
   MAX ONE LIVE - NETFLIX THEME STYLESHEET
   State-of-the-Art Dark Cinema Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Prompt:wght@300;400;500;600&display=swap');

:root {
  --bg-main: #141414;
  --bg-surface: #181818;
  --bg-card: #202020;
  --bg-elevated: #282828;
  --bg-glass: rgba(20, 20, 20, 0.85);
  --bg-glass-card: rgba(32, 32, 32, 0.75);
  
  --netflix-red: #E50914;
  --netflix-red-hover: #b80710;
  --netflix-red-glow: rgba(229, 9, 20, 0.45);
  
  --text-main: #FFFFFF;
  --text-secondary: #B3B3B3;
  --text-muted: #808080;
  
  --accent-gold: #FFD700;
  --accent-blue: #0080FF;
  --accent-green: #46D369;
  
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-active: rgba(229, 9, 20, 0.6);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.95);
  --shadow-glow: 0 0 25px var(--netflix-red-glow);
  
  --font-base: 'Kanit', 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-en: 'Outfit', sans-serif;
  
  --nav-height: 68px;
  --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-normal: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0e0e0e;
}
::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--netflix-red);
}

/* ==========================================================================
   TOP ADMIN NOTICE BAR (FOR ADMIN MODE)
   ========================================================================== */
.admin-mode-banner {
  background: linear-gradient(90deg, #111, #800, #111);
  border-bottom: 1px solid var(--netflix-red);
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1100;
  font-weight: 500;
}

.admin-mode-banner a {
  background: var(--netflix-red);
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 600;
  transition: var(--transition-fast);
}

.admin-mode-banner a:hover {
  background: #ff1e27;
  box-shadow: 0 0 10px rgba(255,30,39,0.5);
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.netflix-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  transition: background-color var(--transition-normal), box-shadow var(--transition-normal);
}

.netflix-header.scrolled {
  background-color: var(--bg-main);
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.netflix-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-logo-text {
  font-family: var(--font-en);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--netflix-red);
  text-transform: uppercase;
  text-shadow: 0 2px 10px var(--netflix-red-glow);
  display: flex;
  align-items: center;
}

.brand-live-badge {
  background: var(--netflix-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 1px;
  animation: pulse-live 1.8s infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.96); }
}

.netflix-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: 35px;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  transition: color var(--transition-fast);
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  font-weight: 600;
}

.netflix-header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-action-btn {
  color: var(--text-main);
  font-size: 18px;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.nav-action-btn:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.08);
}

.btn-login-header, .btn-register-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-login-header {
  background: var(--netflix-red);
  color: #fff;
  padding: 6px 16px;
  font-size: 13px;
}

.btn-login-header:hover {
  background: var(--netflix-red-hover);
  box-shadow: 0 0 10px var(--netflix-red-glow);
}

.btn-register-header {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  font-size: 13px;
}

.btn-register-header:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}

#user-nav-container {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  flex-shrink: 0;
}

/* Responsive Header: Under 768px align buttons side-by-side in one row & hide text labels */
@media (max-width: 768px) {
  .netflix-header-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  #user-nav-container {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  #user-nav-container .btn-text,
  .btn-login-header .btn-text,
  .btn-register-header .btn-text,
  .btn-tool .btn-text {
    display: none !important;
  }

  .btn-login-header,
  .btn-register-header {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 11px !important;
    font-size: 14px !important;
    min-width: 38px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .btn-login-header i,
  .btn-register-header i {
    margin: 0 !important;
  }

  /* In mobile dropdown drawer: align login & register side-by-side */
  .mobile-auth-buttons-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 8px 14px !important;
    box-sizing: border-box !important;
  }

  .mobile-auth-buttons-row .mobile-nav-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 8px !important;
    border-radius: 6px !important;
    text-align: center !important;
    font-size: 13px !important;
    margin: 0 !important;
  }
}

/* Google Sign-in & Sync UI Components */
.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 11px 18px;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  margin-bottom: 16px;
}

.btn-google-auth:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-google-auth:active {
  background: #eeeeee;
  transform: scale(0.99);
}

.btn-google-auth svg {
  flex-shrink: 0;
}

/* Auth Section Divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: #777;
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-divider span {
  padding: 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mobile Header Navigation Dropdown */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  padding: 6px 10px;
  cursor: pointer;
  margin-right: 10px;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-dropdown-nav {
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--netflix-red);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  padding: 12px 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 1500;
}

.mobile-dropdown-nav.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-dropdown-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mobile-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
  background: rgba(229, 9, 20, 0.15);
  color: #fff;
  font-weight: 600;
}

.mobile-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 6px 0;
}

.mobile-dropdown-user {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================================================
   HERO BILLBOARD (SPOTLIGHT / FEATURED BANNER)
   ========================================================================== */
.hero-billboard {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 520px;
  max-height: 750px;
  display: flex;
  align-items: center;
  padding: 0 4%;
  background-size: cover;
  background-position: center top;
  margin-bottom: -60px;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(77deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%),
              linear-gradient(to top, var(--bg-main) 0%, rgba(20,20,20,0.4) 30%, rgba(20,20,20,0) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin-top: -30px;
}

.hero-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 12px;
  border: 1px solid rgba(255,215,0,0.3);
}

.hero-title {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 14px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.hero-desc {
  font-size: 15px;
  color: #ddd;
  line-height: 1.6;
  margin-bottom: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-play-primary {
  background: #FFFFFF;
  color: #000000;
  padding: 10px 26px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-play-primary:hover {
  background: rgba(255, 255, 255, 0.78);
  transform: scale(1.03);
}

.btn-info-secondary {
  background: rgba(109, 109, 110, 0.7);
  color: #FFFFFF;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-info-secondary:hover {
  background: rgba(109, 109, 110, 0.4);
  transform: scale(1.03);
}

/* ==========================================================================
   CONTENT ROWS / CAROUSELS
   ========================================================================== */
.netflix-content-wrap,
.feed-content-wrapper {
  position: relative;
  z-index: 10;
  padding: 0 0 60px 0;
}

.netflix-section,
.category-row-wrapper {
  padding: 16px 0;
  margin-bottom: 12px;
  display: block;
}

.section-header,
.category-row-header {
  padding: 0 4%;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title,
.category-row-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before,
.category-row-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--netflix-red);
  border-radius: 2px;
}

.view-all-link {
  font-size: 13px;
  color: var(--netflix-red);
  font-weight: 500;
  transition: var(--transition-fast);
}

.view-all-link:hover {
  color: #ff3842;
  text-decoration: underline;
}

/* Carousel Scroller */
.carousel-container {
  position: relative;
  padding: 0 clamp(10px, 3.5vw, 64px);
  width: 100%;
  box-sizing: border-box;
}

.carousel-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 14px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-arrow, .carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: calc(100% - 28px);
  background: rgba(20, 20, 20, 0.7);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 20;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}

.carousel-container:hover .carousel-arrow,
.carousel-container:hover .carousel-nav-btn {
  opacity: 1;
}

.carousel-arrow:hover, .carousel-nav-btn:hover {
  background: rgba(20, 20, 20, 0.95);
  color: var(--netflix-red);
}

.carousel-arrow.left, .carousel-nav-btn.prev {
  left: 0;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.carousel-arrow.right, .carousel-nav-btn.next {
  right: 0;
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

@media (max-width: 768px) {
  .carousel-arrow, .carousel-nav-btn {
    display: none !important;
  }
}

/* ==========================================================================
   VIDEO CARD COMPONENT (Dynamic Multi-column 300px to 3440px+)
   ========================================================================== */
.video-card {
  flex: 0 0 calc((100% - (5 * 12px)) / 6);
  min-width: 175px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  box-sizing: border-box;
}

@media (min-width: 2560px) {
  .video-card { flex: 0 0 calc((100% - (9 * 16px)) / 10); min-width: 210px; }
}
@media (min-width: 1920px) and (max-width: 2559px) {
  .video-card { flex: 0 0 calc((100% - (7 * 14px)) / 8); min-width: 195px; }
}
@media (min-width: 1401px) and (max-width: 1919px) {
  .video-card { flex: 0 0 calc((100% - (5 * 12px)) / 6); min-width: 175px; }
}
@media (min-width: 1101px) and (max-width: 1400px) {
  .video-card { flex: 0 0 calc((100% - (4 * 12px)) / 5); min-width: 165px; }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .video-card { flex: 0 0 calc((100% - (3 * 12px)) / 4); min-width: 155px; }
}
@media (min-width: 481px) and (max-width: 768px) {
  .video-card { flex: 0 0 calc((100% - (2 * 12px)) / 3); min-width: 145px; }
}
@media (max-width: 480px) {
  .video-card { flex: 0 0 calc((100% - 8px) / 2.15); min-width: 128px; }
}
@media (max-width: 340px) {
  .video-card { flex: 0 0 calc((100% - 6px) / 2.05); min-width: 120px; }
}

.video-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: var(--shadow-md), 0 0 16px rgba(0,0,0,0.8);
  z-index: 15;
}

.card-thumbnail-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #2b2b2b;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.video-card:hover .card-img {
  transform: scale(1.06);
}

/* Badges on Thumbnail */
.badge-duration {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.15);
  z-index: 5;
}

/* User requirement: CC badge at Top-Left corner */
.badge-cc {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #46D369;
  border: 1px solid #46D369;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
  z-index: 6;
}

/* User requirement: Ended/จบแล้ว badge at Top-Right corner */
.badge-ending {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--netflix-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(229, 9, 20, 0.5);
  z-index: 6;
}

.badge-hd {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent-gold);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid var(--accent-gold);
  z-index: 5;
}

/* Watch Progress % Bar at bottom of thumbnail */
.card-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  z-index: 5;
}

.card-progress-bar {
  height: 100%;
  background: var(--netflix-red);
  width: 0%;
  transition: width 0.3s;
}

.card-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-relative-time {
  font-size: 11.5px;
  color: #a0a0a0;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.card-relative-time::before {
  content: "•";
  color: var(--netflix-red);
}

/* ==========================================================================
   LATEST UPDATES VIEW (หน้าอัพเดทล่าสุด - 30 รายการต่อหน้า)
   ========================================================================== */
.view-container {
  padding: calc(var(--nav-height) + 24px) clamp(10px, 3.5vw, 64px) 60px;
  max-width: 3440px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.page-title {
  font-size: clamp(20px, 3.5vw, 32px);
  font-weight: 700;
  color: var(--text-main);
}

.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-only-filter {
  display: none;
}

.filter-group-dropdown {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.filter-group-dropdown option {
  background: #181818;
  color: #fff;
}

.filter-pill {
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
  cursor: pointer;
}

.filter-pill:hover, .filter-pill.active {
  background: var(--netflix-red);
  color: #fff;
  border-color: var(--netflix-red);
  box-shadow: 0 0 10px var(--netflix-red-glow);
}

/* Category Logo Filter Bar */
.category-logo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 0 16px 0;
  margin-bottom: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--netflix-red) rgba(255, 255, 255, 0.05);
  -webkit-overflow-scrolling: touch;
}

.category-logo-bar::-webkit-scrollbar {
  height: 6px;
}

.category-logo-bar::-webkit-scrollbar-thumb {
  background: var(--netflix-red);
  border-radius: 3px;
}

.category-logo-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 16px;
  color: #ddd;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.category-logo-btn .cat-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(229, 9, 20, 0.15);
  color: #E50914;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.category-logo-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-2px);
}

.category-logo-btn.active {
  background: linear-gradient(135deg, #E50914, #B81D24);
  border-color: #E50914;
  color: #fff;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.category-logo-btn.active .cat-icon-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* 30 Items Grid - Ultra-Responsive (300px to 3440px+) */
.grid-30 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 36px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 2560px) {
  .grid-30 { grid-template-columns: repeat(10, 1fr); gap: 20px; }
}
@media (min-width: 1920px) and (max-width: 2559px) {
  .grid-30 { grid-template-columns: repeat(8, 1fr); gap: 18px; }
}
@media (min-width: 1401px) and (max-width: 1919px) {
  .grid-30 { grid-template-columns: repeat(6, 1fr); gap: 16px; }
}
@media (min-width: 1101px) and (max-width: 1400px) {
  .grid-30 { grid-template-columns: repeat(5, 1fr); gap: 14px; }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .grid-30 { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
@media (min-width: 481px) and (max-width: 768px) {
  .grid-30 { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
  .grid-30 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 24px; }
}
@media (max-width: 340px) {
  .grid-30 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
}

/* Pagination */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
}

.page-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition-fast);
}

.page-btn:hover, .page-btn.active {
  background: var(--netflix-red);
  border-color: var(--netflix-red);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   REAL-TIME SEARCH VIEW
   ========================================================================== */
.search-hero-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.search-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid #444;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input-group:focus-within {
  border-color: var(--netflix-red);
  box-shadow: 0 0 12px var(--netflix-red-glow);
}

.search-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.search-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-select {
  background: var(--bg-main);
  color: #fff;
  border: 1px solid #444;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--netflix-red);
}

/* ==========================================================================
   SERIES DETAIL VIEW (หน้ารายการ เจาะลึก)
   ========================================================================== */
.series-detail-hero {
  position: relative;
  width: 100%;
  min-height: 400px;
  background-size: cover;
  background-position: center top;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 40px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 30px;
}

.series-detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-main) 10%, rgba(20,20,20,0.8) 50%, rgba(20,20,20,0.3) 100%);
}

.series-detail-content {
  position: relative;
  z-index: 2;
  max-width: 850px;
}

.series-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #eee;
}

.meta-pill.red {
  background: var(--netflix-red);
  color: #fff;
}

.meta-pill.gold {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.series-title-lg {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 14px;
}

.series-meta-table {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  background: rgba(0,0,0,0.4);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  max-width: 600px;
}

.meta-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.meta-value {
  color: #fff;
  font-weight: 600;
}

.series-synopsis-box {
  font-size: 15px;
  line-height: 1.7;
  color: #ccc;
  margin-bottom: 24px;
}

/* Episodes Tab Header */
.episodes-section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.episode-list-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .episode-list-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .episode-list-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .episode-list-grid { grid-template-columns: 1fr; }
}

.episode-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
}

.episode-item-card:hover {
  transform: translateY(-4px);
  border-color: var(--netflix-red);
}

/* ==========================================================================
   VIDEO PLAYER VIEW (หน้าเล่นคลิป)
   JWPlayer 8.8.2 / .m3u8 + Live Captions + Subtitle Studio + Drawer
   ========================================================================== */
.player-page-wrap {
  padding: calc(var(--nav-height) + 12px) clamp(10px, 3.5vw, 64px) 60px;
  max-width: 3440px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Breadcrumb */
.player-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.player-breadcrumb a {
  color: var(--text-secondary);
}
.player-breadcrumb a:hover {
  color: var(--netflix-red);
}
.player-breadcrumb .crumb-sep {
  color: #555;
}
.player-breadcrumb .crumb-active {
  color: #fff;
  font-weight: 600;
}

.player-main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  max-width: 100%;
}

/* Video Frame Container with Ambient Glow */
.player-container-box {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.9);
  width: 100%;
  max-width: 100%;
  max-height: 1000px;
  margin: 0 auto;
}

.ambient-glow-layer {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle at center, rgba(229,9,20,0.2) 0%, rgba(0,0,0,0) 70%);
  filter: blur(25px);
  z-index: -1;
  pointer-events: none;
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 1000px;
  background: #000000;
  margin: 0 auto;
}

#jwplayer-video-target {
  width: 100% !important;
  height: 100% !important;
  max-height: 1000px !important;
  aspect-ratio: 16 / 9;
}

/* Custom Live Caption Overlay in Player */
.live-caption-display {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.86);
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 600;
  font-family: 'Prompt', 'Inter', -apple-system, sans-serif;
  padding: 6px 20px;
  border-radius: 8px;
  text-align: center;
  max-width: 85%;
  pointer-events: none;
  z-index: 100;
  text-shadow: 0 2px 4px rgba(0,0,0,0.95), 0 0 2px rgba(0,0,0,0.8);
  transition: opacity 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  line-height: 1.45;
}

.live-caption-display .live-transcribe-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(229, 9, 20, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-caption-display .live-transcribe-text {
  font-size: 20px;
  font-weight: 600;
  color: #FFF;
  line-height: 1.4;
}

.btn-tool.transcribing-active {
  background: #E50914 !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.6);
  animation: pulse-transcribe 1.5s infinite;
}

/* In-Player Direct Toggle Button Badge */
.inplayer-transcribe-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 35;
  background: rgba(18, 18, 18, 0.85);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.inplayer-transcribe-badge:hover {
  background: rgba(229, 9, 20, 0.9);
  border-color: #E50914;
  transform: translateY(-1px) scale(1.03);
}

.inplayer-transcribe-badge.active {
  background: #E50914;
  border-color: #ff3842;
  box-shadow: 0 0 16px rgba(229, 9, 20, 0.75);
  animation: pulse-transcribe 1.5s infinite;
}

@keyframes pulse-transcribe {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

/* AI Translation Badge Pill */
.ai-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.85), rgba(255, 68, 68, 0.85));
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(229, 9, 20, 0.4);
}

.ai-badge-sub {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #00e5ff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 5px;
}

/* In-Player Subtitle Language Selector Dropdown */
.inplayer-lang-selector-box {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 38;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.inplayer-lang-btn {
  background: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
}

.inplayer-lang-btn:hover {
  background: rgba(229, 9, 20, 0.95);
  border-color: #E50914;
  transform: translateY(-1px) scale(1.02);
}

.inplayer-lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(20, 20, 20, 0.97);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 0 6px 0;
  min-width: 250px;
  max-height: 380px;
  overflow-y: auto;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.9);
  display: none;
  z-index: 50;
  animation: fadeInDown 0.2s ease-out;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.inplayer-lang-dropdown::-webkit-scrollbar {
  width: 5px;
}
.inplayer-lang-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.inplayer-lang-dropdown.open {
  display: block;
}

.inplayer-lang-dropdown-header {
  padding: 6px 14px 8px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inplayer-lang-option {
  padding: 7px 14px;
  font-size: 13px;
  color: #e0e0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.18s ease;
  gap: 8px;
}

.inplayer-lang-option:hover {
  background: rgba(229, 9, 20, 0.35);
  color: #ffffff;
  padding-left: 17px;
}

.inplayer-lang-option.active {
  color: #46D369;
  background: rgba(70, 211, 105, 0.12);
  font-weight: 700;
}

.inplayer-lang-option.inplayer-lang-off {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4px;
  padding-top: 8px;
  color: #aaa;
}

.inplayer-lang-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inplayer-lang-flag {
  font-size: 16px;
  line-height: 1;
}

/* Global Website Language Switcher */
.site-lang-selector-box {
  position: relative;
  display: inline-block;
  margin-right: 6px;
}

.site-lang-btn {
  background: rgba(35, 35, 35, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.site-lang-btn:hover {
  background: rgba(50, 50, 50, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.site-lang-flag {
  font-size: 15px;
  line-height: 1;
}

.site-lang-arrow {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.site-lang-btn.open .site-lang-arrow {
  transform: rotate(180deg);
}

.site-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(22, 22, 22, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 230px;
  max-height: 380px;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
  display: none;
  z-index: 1000;
  animation: fadeInDown 0.2s ease-out;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.site-lang-dropdown.open {
  display: block;
}

.site-lang-header {
  padding: 6px 14px 8px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-lang-item {
  padding: 8px 14px;
  font-size: 13px;
  color: #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.18s ease;
}

.site-lang-item:hover {
  background: rgba(229, 9, 20, 0.3);
  color: #fff;
  padding-left: 17px;
}

.site-lang-item.active {
  color: #46D369;
  background: rgba(70, 211, 105, 0.12);
  font-weight: 700;
}

.site-lang-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* In-Player Episode Drawer (Slide-over drawer inside video) */
.inplayer-drawer {
  position: absolute;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--border-subtle);
  z-index: 40;
  transition: right 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
}

.inplayer-drawer.open {
  right: 0;
}

.inplayer-drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}

.inplayer-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-ep-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.drawer-ep-item:hover, .drawer-ep-item.active {
  background: var(--netflix-red);
}

.drawer-ep-thumb {
  width: 75px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 3px;
}

.drawer-ep-meta {
  flex: 1;
  overflow: hidden;
}

.drawer-ep-meta strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-ep-meta span {
  font-size: 11px;
  color: #bbb;
}

/* Player Controls & Action Bar */
.player-actions-toolbar {
  padding: 16px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-tool:hover, .btn-tool.active {
  background: var(--netflix-red);
  border-color: var(--netflix-red);
  box-shadow: 0 0 10px var(--netflix-red-glow);
}

/* ==========================================================================
   REAL-TIME SUBTITLE STUDIO & MANAGEMENT DRAWER (Base Styles)
   Member+: Edit, Add, Delete, Auto-translate, Highlight & Scroll to top
   Admin: Import SRT
   ========================================================================== */
#subtitle-studio-column {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.subtitle-studio-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 600px;
  box-sizing: border-box;
  width: 100%;
}

.subtitle-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
  gap: 8px;
}

.subtitle-studio-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  white-space: nowrap;
}

.subtitle-lang-select {
  background: var(--bg-main);
  color: #fff;
  border: 1px solid #444;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  max-width: 130px;
}

/* Live Subtitle Scroll Container */
.subtitle-cue-list-wrap {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Individual Subtitle Cue Item */
.sub-cue-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: all var(--transition-fast);
  cursor: pointer;
  box-sizing: border-box;
}

.sub-cue-card:hover {
  background: var(--bg-elevated);
}

/* Highlight & Scroll active cue to the top line */
.sub-cue-card.active-cue {
  background: rgba(229, 9, 20, 0.15);
  border-left: 4px solid var(--netflix-red);
  border-color: var(--netflix-red);
  box-shadow: 0 0 12px rgba(229,9,20,0.3);
}

.sub-cue-time {
  font-size: 11px;
  color: var(--accent-gold);
  font-family: var(--font-en);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.sub-cue-text {
  font-size: 13.5px;
  color: #fff;
  line-height: 1.4;
  word-break: break-word;
}

.sub-cue-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-cue-action {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.btn-cue-action:hover {
  background: var(--netflix-red);
}

/* Subtitle Add / Edit Form */
.subtitle-form-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-time-inputs {
  display: flex;
  gap: 8px;
}

.sub-time-inputs input {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid #444;
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  box-sizing: border-box;
}

.sub-textarea {
  background: var(--bg-main);
  border: 1px solid #444;
  color: #fff;
  padding: 8px;
  border-radius: 4px;
  font-size: 13px;
  resize: vertical;
  min-height: 50px;
  box-sizing: border-box;
  width: 100%;
}

/* Inline Subtitle Editor for Mobile & Desktop */
.sub-inline-edit-box {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s ease-in-out;
}

.sub-inline-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #111;
  color: #fff;
  border: 1px solid var(--netflix-red);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
  min-height: 60px;
  outline: none;
  box-shadow: 0 0 8px rgba(229, 9, 20, 0.4);
}

.sub-inline-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-cue-save {
  background: #00a854;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.btn-cue-save:hover {
  background: #00cc66;
}

.btn-cue-cancel {
  background: rgba(255,255,255,0.15);
  color: #eee;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.btn-cue-cancel:hover {
  background: rgba(255,255,255,0.25);
}

/* ==========================================================================
   VIDEO PLAYER & SUBTITLE STUDIO RESPONSIVE RULES (Mobile, Tablet, Desktop)
   ========================================================================== */
.player-main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
  transition: all 0.3s ease;
}

.player-main-left-col {
  width: 100%;
  transition: all 0.3s ease;
}

/* JWPlayer 100% Theater / Cinema Mode (ขยาย/ย่อจอ) */
.player-main-layout.theater-mode {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  width: 100% !important;
  max-width: 100% !important;
}

.player-main-layout.theater-mode .player-main-left-col {
  width: 100% !important;
  max-width: 100% !important;
}

.player-main-layout.theater-mode #subtitle-studio-column {
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 20px;
}

.player-container-box.theater-100-mode,
.video-player-wrapper.theater-100-mode,
.video-player-wrapper.theater-90-mode {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 16 / 9;
  max-height: 85vh;
  margin: 0 auto;
  box-shadow: 0 0 60px rgba(229, 9, 20, 0.45);
  border-radius: var(--radius-sm);
}

.player-actions-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: 14px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 1100px) {
  .player-main-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Navigation dropdown in mobile */
  .netflix-nav {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: inline-flex !important;
  }

  /* Latest page group filter dropdown */
  .desktop-filter-bar {
    display: none !important;
  }

  .mobile-only-filter {
    display: block !important;
    width: 100%;
    margin-top: 8px;
  }

  .player-page-wrap {
    padding: calc(var(--nav-height) + 4px) 0 30px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .player-breadcrumb {
    padding: 8px 12px;
    font-size: 12.5px;
    margin-bottom: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .player-container-box {
    border-radius: 0;
    box-shadow: none;
  }

  .video-player-wrapper {
    width: 100vw;
    max-width: 100%;
    aspect-ratio: 16 / 9;
  }

  .live-caption-display {
    bottom: 30px;
    font-size: clamp(13px, 3.8vw, 17px);
    padding: 4px 10px;
    max-width: 90%;
  }

  .inplayer-drawer {
    width: 85%;
    max-width: 320px;
  }

  .player-actions-toolbar {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar-left, .toolbar-right {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    width: 100%;
  }

  .btn-tool {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
    justify-content: center;
    text-align: center;
  }

  /* Subtitle Studio Mobile Responsive */
  #subtitle-studio-column {
    padding: 0 12px;
    width: 100%;
    margin-top: 8px;
  }

  .subtitle-studio-panel {
    height: auto;
    max-height: 520px;
    padding: 12px;
    border-radius: var(--radius-sm);
  }

  .subtitle-cue-list-wrap {
    max-height: 240px;
  }

  .sub-cue-card {
    padding: 8px;
  }

  .sub-cue-text {
    font-size: 13px;
  }

  .sub-cue-actions {
    gap: 4px;
  }

  .btn-cue-action {
    font-size: 11px;
    padding: 4px 7px;
  }

  .sub-time-inputs {
    gap: 6px;
  }

  .sub-time-inputs input {
    font-size: 11.5px;
    padding: 6px;
  }
}

/* User requirement: Subtitle Studio hidden on mobile portrait */
@media (max-width: 768px) and (orientation: portrait) {
  #subtitle-studio-column,
  .subtitle-studio-column {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .player-breadcrumb {
    font-size: 11.5px;
  }
  .btn-tool {
    font-size: 11px;
    padding: 5px 8px;
  }
  .inplayer-drawer-header {
    padding: 10px 12px;
    font-size: 14px;
  }
  .drawer-ep-thumb {
    width: 60px;
  }
  .drawer-ep-meta strong {
    font-size: 12px;
  }

  /* Subtitle Studio Extra-small Mobile */
  #subtitle-studio-column {
    padding: 0 8px;
  }
  .subtitle-studio-header {
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
  .subtitle-studio-title {
    font-size: 13.5px;
  }
  .subtitle-lang-select {
    font-size: 11px;
    padding: 4px 6px;
    max-width: 110px;
  }
  .subtitle-cue-list-wrap {
    max-height: 200px;
  }
  .sub-textarea {
    font-size: 12px;
    min-height: 44px;
  }
}

/* ==========================================================================
   MODAL / POPUP COMPONENT (SRT Upload / Login / Quick Preview)
   ========================================================================== */
.netflix-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.netflix-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.netflix-modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.94);
  transition: transform var(--transition-fast);
}

.netflix-modal-backdrop.show .netflix-modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   TOAST NOTIFICATION COMPONENT
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.netflix-toast {
  background: var(--bg-surface);
  border-left: 4px solid var(--netflix-red);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toast-in 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.netflix-footer {
  background: #0d0d0d;
  border-top: 1px solid var(--border-subtle);
  padding: 40px clamp(10px, 3.5vw, 64px) 60px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
  margin-top: 50px;
  width: 100%;
  box-sizing: border-box;
}

.footer-inner {
  max-width: 3440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  .netflix-footer { padding: 30px 14px 40px; margin-top: 30px; }
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
}

.footer-col a:hover {
  color: var(--netflix-red);
}

.footer-bottom {
  max-width: 3440px;
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  font-size: 12px;
}

/* ==========================================================================
   MASTER RESPONSIVE ENGINE (300px to 3440px+ MONITOR SUPPORT)
   ========================================================================== */

/* 1. Ultra-Wide 21:9 & 4K UHD Monitors (2560px to 3440px+) */
@media (min-width: 2560px) {
  .netflix-header {
    height: 80px;
    padding: 0 clamp(24px, 3vw, 80px);
  }
  .brand-logo-text {
    font-size: 32px;
  }
  .nav-link {
    font-size: 16px;
  }
  .hero-billboard {
    height: 75vh;
    min-height: 650px;
    max-height: 850px;
    padding: 0 clamp(24px, 3vw, 80px);
  }
  .hero-content {
    max-width: 920px;
  }
  .hero-title {
    font-size: 58px;
    line-height: 1.15;
  }
  .hero-desc {
    font-size: 18px;
    line-height: 1.6;
    -webkit-line-clamp: 4;
  }
  .btn-play-primary, .btn-info-secondary {
    padding: 13px 32px;
    font-size: 18px;
  }
  .category-row-title, .section-title {
    font-size: 26px;
  }
  .player-main-layout {
    grid-template-columns: 1fr 440px;
    gap: 32px;
  }
  .subtitle-studio-panel {
    height: 750px;
  }
  .episode-list-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

/* 2. 2K QHD & Large Wide Monitors (1920px to 2559px) */
@media (min-width: 1920px) and (max-width: 2559px) {
  .netflix-header {
    height: 74px;
    padding: 0 4%;
  }
  .brand-logo-text {
    font-size: 28px;
  }
  .hero-billboard {
    height: 70vh;
    min-height: 560px;
    max-height: 740px;
  }
  .hero-content {
    max-width: 780px;
  }
  .hero-title {
    font-size: 48px;
  }
  .hero-desc {
    font-size: 16px;
  }
  .category-row-title, .section-title {
    font-size: 23px;
  }
  .player-main-layout {
    grid-template-columns: 1fr 390px;
    gap: 26px;
  }
  .subtitle-studio-panel {
    height: 680px;
  }
  .episode-list-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 3. Small Laptop & Large Tablet (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .netflix-nav {
    gap: 14px;
    margin-left: 18px;
  }
  .nav-link {
    font-size: 13px;
  }
  .hero-billboard {
    height: 58vh;
    min-height: 440px;
  }
  .hero-title {
    font-size: 32px;
  }
  .hero-desc {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }
  .episode-list-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 4. Medium / Small Mobile Screens (341px to 480px) */
@media (max-width: 480px) {
  :root {
    --nav-height: 58px;
  }
  .netflix-header {
    padding: 0 12px;
  }
  .brand-logo-text {
    font-size: 20px;
  }
  .brand-live-badge {
    font-size: 8.5px;
    padding: 1.5px 5px;
    letter-spacing: 0.5px;
  }
  .btn-login-header {
    font-size: 12px;
    padding: 5px 12px;
  }
  .hero-billboard {
    height: auto;
    min-height: 360px;
    padding: 72px 14px 24px;
    margin-bottom: -15px;
    align-items: flex-end;
  }
  .hero-meta-badge {
    font-size: 10px;
    padding: 2px 8px;
    margin-bottom: 6px;
  }
  .hero-title {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 8px;
  }
  .hero-desc {
    font-size: 12.5px;
    line-height: 1.45;
    margin-bottom: 14px;
    -webkit-line-clamp: 2;
  }
  .hero-actions {
    gap: 8px;
    flex-wrap: wrap;
  }
  .btn-play-primary, .btn-info-secondary {
    padding: 8px 16px;
    font-size: 13.5px;
    gap: 6px;
  }
  .category-row-title, .section-title {
    font-size: 16.5px;
    gap: 6px;
  }
  .view-all-link {
    font-size: 12px;
  }
  .card-info {
    padding: 7px 8px;
    gap: 2px;
  }
  .card-title {
    font-size: 12.5px;
  }
  .card-subtitle {
    font-size: 10.5px;
  }
  .card-relative-time {
    font-size: 10px;
  }
  .badge-duration, .badge-cc, .badge-ending, .badge-hd {
    font-size: 9.5px;
    padding: 1.5px 4.5px;
  }
  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .search-hero-box {
    padding: 14px;
    margin-bottom: 18px;
  }
  .search-filters-row {
    flex-direction: column;
    width: 100%;
  }
  .filter-select {
    width: 100%;
    font-size: 13px;
  }
  .episode-list-grid {
    grid-template-columns: 1fr;
  }
  .player-actions-toolbar {
    padding: 8px;
    gap: 6px;
  }
  .toolbar-left, .toolbar-right {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .btn-tool {
    font-size: 11px;
    padding: 6px 8px;
  }
}

/* 5. Ultra-compact Smartphone & Folded Screens (300px to 340px) */
@media (max-width: 340px) {
  :root {
    --nav-height: 52px;
  }
  .netflix-header {
    padding: 0 8px;
  }
  .brand-logo-text {
    font-size: 17px;
    letter-spacing: -0.5px;
  }
  .brand-live-badge {
    font-size: 7.5px;
    padding: 1px 3px;
    margin-left: 3px;
  }
  .btn-login-header {
    font-size: 10.5px;
    padding: 3px 7px;
  }
  .hero-billboard {
    min-height: 320px;
    padding: 65px 10px 16px;
  }
  .hero-title {
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 6px;
  }
  .hero-desc {
    font-size: 11.5px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    margin-bottom: 10px;
  }
  .btn-play-primary, .btn-info-secondary {
    padding: 6px 10px;
    font-size: 12px;
  }
  .card-info {
    padding: 5px 6px;
  }
  .card-title {
    font-size: 11.5px;
  }
  .card-subtitle {
    font-size: 9.5px;
  }
  .card-relative-time {
    font-size: 9px;
  }
  .badge-duration, .badge-cc, .badge-ending, .badge-hd {
    font-size: 8.5px;
    padding: 1px 3px;
  }
  .category-row-title, .section-title {
    font-size: 15px;
  }
  .view-all-link {
    font-size: 11px;
  }
  .btn-tool {
    font-size: 10px;
    padding: 5px 6px;
  }
  .pagination-wrap {
    gap: 4px;
  }
  .page-btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
}
