/* ===== DRAMAX STYLESHEET ===== */

/* ===== GLOBAL RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #ff2a2a;
  --accent-2: #2ff58b;
}

.left-header .hybrid-search {
  width: 260px;
  transition: width 0.18s ease;
  flex-shrink: 0;
}

body {
  background-color: rgb(16, 17, 20);
  color: #fff;
  font-family:
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

/* ===== RESPONSIVE HELPERS ===== */
/* Hide mobile layout on desktop */
@media screen and (min-width: 768px) {
  .h5-page {
    display: none;
  }
}

/* Hide desktop layout on mobile */
@media screen and (max-width: 767px) {
  .pc-page {
    display: none;
  }
}

/* ===== HEADER ===== */
.header-fixed {
  left: 0;
  position: fixed;
  top: 0;
  z-index: 99;
  width: 100%;
}

.header-color {
  background-color: rgb(16, 17, 20);
}

.pc-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.625rem 0;
  width: 100%;
  z-index: 9;
}

.pc-header-inner {
  padding: 0 1.5rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== BANNER ===== */
.banner {
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.banner-header {
  background-color: transparent;
  position: absolute;
  top: 0;
  z-index: 2;
  width: 100%;
  padding: 1rem;
}

/* ===== MOVIE CARD LIST ===== */
.movie-card-list {
  align-items: flex-start;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  padding: 1rem 0;
  gap: 1rem;
}

/* Hide scrollbar but keep scroll */
.movie-card-list::-webkit-scrollbar {
  display: none;
}

/* ===== MOVIE CARD ===== */
.movie-card {
  cursor: pointer;
  flex-shrink: 0;
  width: calc(30.30303% - 0.34848rem);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.2s;
}

.movie-card:hover {
  transform: scale(1.05);
}

.movie-card:first-child {
  margin-left: 0.75rem;
}

.movie-card:last-child {
  margin-right: 0.75rem;
}

.movie-card img {
  width: 100%;
  height: auto;
  display: block;
}

.movie-card-title {
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
}

/* Desktop: 4-5 cards per row */
@media screen and (min-width: 768px) {
  .movie-card {
    width: calc(25% - 0.75rem);
  }

  .movie-card:first-child {
    margin-left: 0;
  }

  .movie-card:last-child {
    margin-right: 0;
  }
}

@media screen and (min-width: 1024px) {
  .movie-card {
    width: calc(20% - 0.8rem);
  }
}

/* ===== SEARCH BOX ===== */
.search-box {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  box-sizing: border-box;
  flex-grow: 1;
  height: 2.25rem;
  padding-right: 0;
  padding-left: 0.75rem;
  position: relative;
  width: 100%;
  max-width: 300px;
  display: flex;
  align-items: center;
}

.search-fixed {
  gap: 0.75rem;
  height: 2.5rem;
  position: fixed;
  width: 100%;
  max-width: 22.5rem;
  z-index: 11;
  background-color: rgb(16, 17, 20);
  top: 2.5rem;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
}

/* ===== INPUT FIELDS ===== */
.input-div {
  align-items: center;
  display: flex;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  flex: 1 1 0%;
  gap: 0.5rem;
  height: 2.25rem;
  margin: 0.375rem 0 0.5rem 0;
  padding: 0 0.75rem;
}

.input-div:focus-within {
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.input::-moz-placeholder {
  color: rgba(255, 255, 255, 0.8);
  opacity: 1;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(91deg, #1cb7ff 1.22%, #2ff58b 50.24%);
  color: #000;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ===== NAV ACTIVE STATE ===== */
.nav-active .title {
  background: linear-gradient(91deg, #1cb7ff 1.22%, #2ff58b 50.24%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.nav-active .nav-title {
  color: #fff;
  font-weight: 600;
}

/* ===== MODAL / POPUP ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background-color: rgb(16, 17, 20);
  border-radius: 0.75rem;
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100%;
  background-color: rgb(16, 17, 20);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 999;
  transition: left 0.3s ease;
  padding: 1rem;
  overflow-y: auto;
}

.sidebar.active {
  left: 0;
}

.sidebar-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #ccc;
  text-decoration: none;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s;
}

.sidebar-item:hover,
.sidebar-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ===== DROPDOWN MENU ===== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgb(16, 17, 20);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  min-width: 200px;
  z-index: 100;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: #ccc;
  text-decoration: none;
  transition: all 0.2s;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ===== FOOTER ===== */
.footer {
  background-color: rgb(16, 17, 20);
  color: #999;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
}

/* ===== DRAMAX V2 - COMPLETED MOVIEBOX.PH CLONE STYLES ===== */

/* === Utility Classes - Tailwind replacements === */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.flex-shrink-0 {
  flex-shrink: 0;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.justify-start {
  justify-content: flex-start;
}
.self-start {
  align-self: flex-start;
}
.relative {
  position: relative;
}
.absolute {
  position: absolute;
}
.static {
  position: static;
}
.top-0 {
  top: 0;
}
.left-0 {
  left: 0;
}
.right-0 {
  right: 0;
}
.right-\[4px\] {
  right: 4px;
}
.top-1\/2 {
  top: 50%;
}
.-translate-y-1\/2 {
  transform: translateY(-50%);
}
.translate-x-\[var\(--x-50\)\] {
  transform: translateX(-50%);
}
.transform {
  transform: translateZ(0);
}
.w-full {
  width: 100%;
}
.w-10 {
  width: 2.5rem;
}
.w-4 {
  width: 1rem;
}
.w-5 {
  width: 1.25rem;
}
.w-\[122px\] {
  width: 122px;
}
.w-\[18px\] {
  width: 18px;
}
.w-\[224px\] {
  width: 224px;
}
.h-10 {
  height: 2.5rem;
}
.h-4 {
  height: 1rem;
}
.h-5 {
  height: 1.25rem;
}
.h-0 {
  height: 0;
}
.h-100 {
  height: 100%;
}
.h-full {
  height: 100%;
}
.h-\[12px\] {
  height: 12px;
}
.h-\[18px\] {
  height: 18px;
}
.h-\[1px\] {
  height: 1px;
}
.h-\[24px\] {
  height: 24px;
}
.h-\[28px\] {
  height: 28px;
}
.h-\[36px\] {
  height: 36px;
}
.max-h-\[648px\] {
  max-height: 648px;
}
.max-w-\[90\%\] {
  max-width: 90%;
}
.min-w-\[130px\] {
  min-width: 130px;
}
.p-4 {
  padding: 1rem;
}
.px-\[20px\] {
  padding-left: 20px;
  padding-right: 20px;
}
.px-\[6px\] {
  padding-left: 6px;
  padding-right: 6px;
}
.py-2 {
  padding: 0.5rem 0;
}
.pt-3 {
  padding-top: 0.75rem;
}
.pt-6 {
  padding-top: 1.5rem;
}
.pb-3 {
  padding-bottom: 0.75rem;
}
.pb-5 {
  padding-bottom: 1.25rem;
}
.pb-\[140\%\] {
  padding-bottom: 140%;
}
.pb-\[44px\] {
  padding-bottom: 44px;
}
.pb-\[80px\] {
  padding-bottom: 80px;
}
.p-\[4px_1px_6px\] {
  padding: 4px 1px 6px;
}
.ps-3 {
  padding-inline-start: 0.75rem;
}
.pe-0 {
  padding-inline-end: 0;
}
.gap-1 {
  gap: 0.25rem;
}
.gap-4 {
  gap: 1rem;
}
.gap-x-4 {
  column-gap: 1rem;
}
.gap-y-1 {
  row-gap: 0.25rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-5 {
  margin-bottom: 1.25rem;
}
.mb-\[6px\] {
  margin-bottom: 6px;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mx-0 {
  margin: 0;
}
.mx-3 {
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}
.ms-3 {
  margin-inline-start: 0.75rem;
}
.ms-\[4px\] {
  margin-inline-start: 4px;
}
.me-3 {
  margin-inline-end: 0.75rem;
}
.me-\[10px\] {
  margin-inline-end: 10px;
}
.ml-\[10px\] {
  margin-left: 10px;
}
.my-8 {
  margin: 2rem 0;
}
.my-15 {
  margin: 3.75rem 0;
}
.overflow-hidden {
  overflow: hidden;
}
.overflow-auto {
  overflow: auto;
}
.overflow-y-auto {
  overflow-y: auto;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-white {
  color: #fff;
}
.text-white\/60 {
  color: rgba(255, 255, 255, 0.6);
}
.text-white\/70 {
  color: rgba(255, 255, 255, 0.7);
}
.text-white\/80 {
  color: rgba(255, 255, 255, 0.8);
}
.text-\[11px\] {
  font-size: 11px;
}
.text-\[12px\] {
  font-size: 12px;
}
.text-\[14px\] {
  font-size: 14px;
}
.text-\[16px\] {
  font-size: 16px;
}
.text-\[18px\] {
  font-size: 18px;
}
.text-\[20px\] {
  font-size: 20px;
}
.font-bold {
  font-weight: 700;
}
.font-medium {
  font-weight: 500;
}
.font-normal {
  font-weight: 400;
}
.leading-4 {
  line-height: 1rem;
}
.leading-\[13px\] {
  line-height: 13px;
}
.leading-\[14px\] {
  line-height: 14px;
}
.leading-\[16px\] {
  line-height: 16px;
}
.leading-\[20px\] {
  line-height: 20px;
}
.leading-\[24px\] {
  line-height: 24px;
}
.leading-normal {
  line-height: 1.5;
}
.text-start {
  text-align: start;
}
.text-right {
  text-align: right;
}
.text-justify {
  text-align: justify;
}
.break-words {
  overflow-wrap: break-word;
}
.rounded-full {
  border-radius: 9999px;
}
.rounded-\[2px\] {
  border-radius: 2px;
}
.rounded-\[8px\] {
  border-radius: 8px;
}
.rounded-bl-\[4px\] {
  border-bottom-left-radius: 4px;
}
.rounded-br-\[4px\] {
  border-bottom-right-radius: 4px;
}
.rounded-tl-\[4px\] {
  border-top-left-radius: 4px;
}
.rounded-tr-\[4px\] {
  border-top-right-radius: 4px;
}
.rounded-l-\[2px\] {
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}
.object-cover {
  object-fit: cover;
}
.object-contain {
  object-fit: contain;
}
.bg-black\/50 {
  background: rgba(0, 0, 0, 0.5);
}
.bg-black\/60 {
  background: rgba(0, 0, 0, 0.6);
}
.bg-white\/10 {
  background: rgba(255, 255, 255, 0.1);
}
.bg-white\/\[6\%\] {
  background: rgba(255, 255, 255, 0.06);
}
.bg-\[\#28292E\] {
  background: #28292e;
}
.bg-\[\#28292e\] {
  background: #28292e;
}
.bg-\[\#2b2e39\] {
  background: #2b2e39;
}
.bg-transparent {
  background: transparent;
}
.border {
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.border-0 {
  border: 0;
}
.border-white {
  border-color: #fff;
}
.border-transparent {
  border-color: transparent;
}
.box-border {
  box-sizing: border-box;
}
.cursor-pointer {
  cursor: pointer;
}
.pointer {
  cursor: pointer;
}
.pointer-events-none {
  pointer-events: none;
}
.backdrop-blur-sm {
  backdrop-filter: blur(4px);
}
.z-\[10\] {
  z-index: 10;
}
.z-\[9\] {
  z-index: 9;
}
.duration-500 {
  transition-duration: 500ms;
}
.transition-colors {
  transition:
    color 0.2s,
    background 0.2s;
}

/* === MovieBox Specific Components === */
.header {
  display: flex;
  align-items: center;
  height: 64px;
}
.logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(91deg, #1cb7ff 1.22%, #2ff58b 50.24%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section-container {
  padding: 1.5rem 0 0.5rem;
}
.top-title-action,
.pc-top-title-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
}
.pc-title,
.web-index-page-h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pc-more {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}
.pc-more:hover {
  color: #fff;
}
.banner-box {
  position: relative;
  width: 100%;
  height: 420px;
  max-height: 500px;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #000;
}
.banner-box .mask,
.banner-box .mask2 {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(16, 17, 20, 0.95) 0%,
      rgba(16, 17, 20, 0.6) 40%,
      rgba(16, 17, 20, 0.1) 100%
    ),
    linear-gradient(0deg, rgba(16, 17, 20, 1) 0%, transparent 50%);
  z-index: 1;
}
.banner-box img.banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bottom-info-box {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 2rem;
  max-width: 600px;
}
.pc-nav-item {
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.pc-nav-item:hover,
.pc-nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.pc-logo-txt {
  font-weight: 800;
  font-size: 1.4rem;
}
.pc-search-icon {
  color: rgba(255, 255, 255, 0.6);
}
.pc-input-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0 0.75rem;
  height: 2.25rem;
}
.pc-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 200px;
}
.pc-split-line {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 0.5rem;
}
.pc-icon-box {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

/* Carousel */
.carousel,
.pc-carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
}
.carousel-item {
  min-width: 100%;
}
.carousel-wrapper {
  padding: 0 1.5rem;
}
.pc-carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
  padding: 0 1rem;
}
.pc-carousel-control {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.pc-carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}
.swiper-pagination-bullet.active {
  background: #fff;
  width: 24px;
  border-radius: 4px;
}

/* Movie Card enhancements */
.movie-card {
  position: relative;
}
.movie-card .badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 2;
}
.movie-card .badge.trending {
  background: linear-gradient(91deg, #ff6b6b, #ffa500);
  color: #000;
  font-weight: 700;
}
.movie-card .year {
  position: absolute;
  bottom: 42px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 2px;
}
.work-name,
.pc-work-name {
  font-size: 0.85rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === WATCH PAGE - MovieBox style === */
.watch-page {
  background: rgb(16, 17, 20);
  min-height: 100vh;
  padding-top: 64px;
}
.watch-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  padding: 1.5rem;
}
@media (max-width: 1024px) {
  .watch-container {
    grid-template-columns: 1fr;
  }
}
.video-player-wrap {
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}
.video-player-wrap .player-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f0f, #1a1a1a);
  color: #fff;
  flex-direction: column;
  gap: 1rem;
}
.play-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(91deg, #1cb7ff, #2ff58b);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  color: #000;
}
.work-info {
  padding: 1.25rem 0;
}
.work-info h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.work-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.6;
}
.type {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  margin-right: 0.5rem;
}
.right-box {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.75rem;
  padding: 1rem;
  height: fit-content;
}
.episode-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}
@media (max-width: 768px) {
  .episode-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Extra compact rules for very small phones */
@media (max-width: 420px) {
  .hybrid-header {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
  .header-actions {
    gap: 0.12rem;
    align-items: center;
  }
  .menu-toggle {
    margin-right: 0.3rem;
  }
  /* Collapse search to icon only */
  .hybrid-search {
    width: 36px;
    padding: 0 0.4rem;
  }
  .hybrid-search input {
    display: none;
  }
  /* Compact Go Premium: show only the icon area */
  .go-premium {
    padding: 0.12rem 0.35rem;
    font-size: 0.7rem;
    width: 34px;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }
  /* Make login button icon-only */
  .login-btn {
    padding: 0.18rem 0.36rem;
    font-size: 0.72rem;
    gap: 0.25rem;
  }
  .login-btn span:nth-child(2) {
    display: none;
  }
  .login-avatar {
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
  }
  /* Reduce hero padding to give more horizontal space */
  .hero-content {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  /* Ensure main content doesn't get pushed by left-rail when visible */
  .main-with-rail {
    margin-left: 0;
  }
  /* Compact download and glass buttons used on watch.html */
  .download-app {
    padding: 0.18rem 0.4rem;
    font-size: 0.72rem;
    min-width: 36px;
  }
  .btn-glass {
    padding: 0.22rem 0.5rem;
    font-size: 0.72rem;
  }
}
.episode-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  cursor: pointer;
  color: #ccc;
  transition: all 0.2s;
}
.episode-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.episode-btn.active {
  background: linear-gradient(91deg, #1cb7ff, #2ff58b);
  color: #000;
  font-weight: 700;
  border-color: transparent;
}
.episode-btn.locked {
  opacity: 0.4;
  position: relative;
}
.action-bar {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.action-bar .btn {
  flex: 1;
  min-width: 120px;
}

/* Mobile */
@media (max-width: 767px) {
  .main-container,
  .top-title-action,
  .pc-top-title-action {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .banner-box {
    height: 320px;
    border-radius: 0;
  }
  .bottom-info-box {
    padding: 1rem;
  }
  .watch-container {
    padding: 0.75rem;
    gap: 1rem;
  }
  .work-info h1 {
    font-size: 1.25rem;
  }
}

/* ===== BEST VERSION - HYBRID UPGRADE 2026 ===== */

/* Left rail - MovieBox style */
.left-rail {
  position: fixed;
  left: 0;
  top: 60px;
  width: 72px;
  height: calc(100vh - 60px);
  background: linear-gradient(
    90deg,
    rgba(16, 17, 20, 0.1),
    rgba(16, 17, 20, 0.02)
  );
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 0.5rem;
  z-index: 10;
  backdrop-filter: blur(6px);
  transition:
    transform 0.28s ease,
    opacity 0.28s ease;
}
.left-rail-item {
  width: 56px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  cursor: pointer;
  gap: 4px;
  transition: all 0.2s;
  text-decoration: none;
}
.left-rail-item span {
  display: block;
  text-align: center;
  line-height: 1;
}
.left-rail-item span:first-child {
  font-size: 18px;
  display: block;
  line-height: 1;
}
.left-rail-item span:nth-child(2) {
  font-size: 10px;
  margin-top: 4px;
  display: block;
}
.left-rail-item:hover,
.left-rail-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.left-rail-item.active {
  background: rgba(28, 183, 255, 0.12);
  color: #1cb7ff;
}

/* Toggle hidden state for left-rail */
.left-rail.hidden {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

/* When left-rail is hidden, collapse main content margin */
.left-rail.hidden ~ .main-with-rail {
  margin-left: 0;
}

/* Menu toggle button */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  padding: 0.35rem;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 1024px) {
  .menu-toggle {
    display: inline-flex;
    margin-right: 0.5rem;
  }
}

.menu-toggle {
  z-index: 200;
  position: relative;
}

/* When nav-open is set (menu toggle) show hybrid-nav as an overlay on small screens */
@media (max-width: 1024px) {
  .nav-open .hybrid-nav {
    display: flex !important;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(16, 17, 20, 0.98);
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 40;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }
}
@media (max-width: 1024px) {
  .left-rail {
    display: none;
  }
}

/* Main with rail offset */
.main-with-rail {
  margin-left: 72px;
}
@media (max-width: 1024px) {
  .main-with-rail {
    margin-left: 0;
  }
}

/* Hybrid Header Upgrade */
.hybrid-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  max-width: 100%;
  background: rgba(16, 17, 20, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hybrid-logo {
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--accent),
    var(--accent-2),
    #ffb2b2,
    #2ff58b
  );
  background-size: 500% 500%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease-in-out infinite;
}
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hybrid-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.hybrid-nav a {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.hybrid-nav a:hover,
.hybrid-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.hybrid-nav a.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.go-premium {
  background: #f5e6c8;
  color: #111;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}
.download-app {
  background: linear-gradient(91deg, #1cb7ff 1.22%, #2ff58b 50.24%);
  color: #000;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.login-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.login-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(109, 45, 255, 0.18),
    rgba(177, 103, 255, 0.3)
  );
  color: #d3c2ff;
  font-size: 0.9rem;
}
.login-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.login-btn:active {
  transform: translateY(0);
}
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at top, rgba(28, 183, 255, 0.1), transparent 28%),
    linear-gradient(180deg, #0a0c10 0%, #090a0f 100%);
  animation: pageFadeIn 0.55s ease-out;
}
.login-card {
  width: min(100%, 420px);
  background: rgba(15, 17, 21, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(24px);
  animation: cardPop 0.55s ease-out 0.1s forwards;
}
.login-card h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.login-logo {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--accent),
    var(--accent-2),
    #ffb2b2,
    #2ff58b
  );
  background-size: 500% 500%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-weight: 900;
  animation: gradientShift 4s ease-in-out infinite;
}
.login-card p {
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.login-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.login-input-group label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}
.login-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  color: #fff;
  padding: 0.95rem 1rem;
  font-size: 0.95rem;
  outline: none;
}
.login-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
.login-input:focus {
  border-color: rgba(28, 183, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(28, 183, 255, 0.12);
}
.login-submit {
  width: 100%;
  background: linear-gradient(91deg, #1cb7ff 1.22%, #2ff58b 50.24%);
  color: #000;
  border: none;
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.login-submit:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.login-submit:active {
  transform: translateY(0);
}
.login-footer {
  margin-top: 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}
.login-footer a {
  color: #fff;
  text-decoration: underline;
}
@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes cardPop {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hybrid-search {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0 0.9rem;
  height: 38px;
  width: 180px;
  transition: all 0.2s;
}
.hybrid-search:focus-within {
  background: rgba(255, 255, 255, 0.14);
  width: 240px;
}
.hybrid-search input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 100%;
  font-size: 0.85rem;
}
.hybrid-search input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Hero Carousel - BEST VERSION */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 72vh;
  min-height: 460px;
  max-height: 620px;
  overflow: hidden;
  background: #000;
  margin-top: 64px;
}
.hero-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(10, 12, 16, 0.96) 0%,
      rgba(10, 12, 16, 0.75) 35%,
      rgba(10, 12, 16, 0.15) 70%
    ),
    linear-gradient(0deg, rgba(10, 12, 16, 1) 0%, rgba(10, 12, 16, 0) 55%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 2.5rem;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.hero-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.hero-tag {
  font-size: 0.68rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-tag.hd {
  background: linear-gradient(91deg, #1cb7ff, #2ff58b);
  color: #000;
  border: none;
}
.hero-tag.top {
  background: linear-gradient(91deg, #ff7a45, #ffcc4d);
  color: #000;
}
.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero-meta {
  display: flex;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  align-items: center;
}
.hero-desc {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.btn-play {
  background: linear-gradient(91deg, #1cb7ff 1.22%, #2ff58b 50.24%);
  color: #000;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.15s;
}
.btn-play:hover {
  transform: scale(1.03);
}
.btn-glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.hero-arrows {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1.2rem;
  pointer-events: none;
}
.hero-arrow {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}
.hero-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.25s;
}
.hero-dot.active {
  width: 26px;
  background: #fff;
}

/* Row headers - hybrid */
.row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.8rem 1.5rem 0.6rem;
}
.row-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.row-more {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  cursor: pointer;
}
.row-more:hover {
  color: #fff;
}

/* Movie card upgrade */
.movie-card-pro {
  position: relative;
  flex-shrink: 0;
  width: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1d24;
  cursor: pointer;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.movie-card-pro:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}
.movie-card-pro img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}
.card-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}
.badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.22rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.badge-top {
  background: linear-gradient(90deg, #ff8a2b, #ffd24d);
  color: #000;
}
.badge-trending {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.badge-dubbed {
  background: #2b2e39;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.badge-hd {
  background: linear-gradient(91deg, #1cb7ff, #2ff58b);
  color: #000;
}
.card-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}
.card-progress div {
  height: 100%;
  background: linear-gradient(91deg, #1cb7ff, #2ff58b);
}
.card-info {
  padding: 0.6rem 0.65rem 0.7rem;
}
.card-title {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #e6e6e6;
}
.card-meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.2rem;
}

.horizontal-scroll {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 1.5rem 1rem;
  scrollbar-width: none;
}
.horizontal-scroll::-webkit-scrollbar {
  display: none;
}

/* Continue watching */
.continue-card .card-progress {
  height: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .hybrid-header {
    padding: 0 0.9rem;
  }
  .hybrid-nav {
    display: none;
  }
  .hybrid-search {
    width: 140px;
  }
  .hybrid-search:focus-within {
    width: 180px;
  }
  .hero-carousel {
    height: 64vh;
    min-height: 420px;
  }
  .hero-content {
    padding: 1.2rem;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .hero-desc {
    font-size: 0.85rem;
  }
  .hero-arrows {
    display: none;
  }
  .movie-card-pro {
    width: 132px;
  }
  .row-header {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  .horizontal-scroll {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  /* Keep Go Premium visible on phones but compact it */
  .go-premium {
    display: inline-flex;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    gap: 0.25rem;
  }
  /* Make login button more compact to avoid clipping */
  .login-btn {
    padding: 0.36rem 0.6rem;
    font-size: 0.82rem;
  }
  /* Show left-rail (moviebox style) on mobile as a compact icon rail */
  .left-rail {
    display: flex;
    left: 0;
    top: 64px;
    width: 56px;
    height: calc(100vh - 64px);
    padding: 0.6rem 0;
    gap: 0.4rem;
  }
  /* Hide text labels in the left-rail to save space */
  .left-rail-item span:nth-child(2) {
    display: none;
  }
  .main-with-rail {
    margin-left: 72px;
  }
}

/* Search dropdown */
.search-dropdown {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  background: #1e212b;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: none;
  z-index: 50;
}
.search-dropdown.active {
  display: block;
}
.search-item {
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}
.search-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Additional mobile header tweaks: reduce gaps, shrink buttons, and remove left padding before logo */
@media (max-width: 768px) {
  .hybrid-header {
    padding-left: 0.5rem;
  }
  .hybrid-logo {
    margin-left: 0;
  }
  .header-actions {
    gap: 0.25rem;
  }
  .hybrid-search {
    width: 120px;
  }
  .hybrid-search:focus-within {
    width: 160px;
  }
  .go-premium {
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
  }
  .login-btn {
    padding: 0.28rem 0.5rem;
    font-size: 0.78rem;
  }
  /* Ensure header content shifts left, remove extra margin before brand */
  .main-with-rail {
    margin-left: 0;
  }
}

/* ======================================================
   FINAL MOBILE & LAYOUT FIXES - 2026 CORRECTED VERSION
   This block overrides all conflicting earlier mobile rules
   ====================================================== */

/* Global overflow safety */
html {
  overflow-x: hidden;
  width: 100%;
}
body {
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}
img {
  max-width: 100%;
}
* {
  -webkit-tap-highlight-color: transparent;
}

/* Fix :root variables ensured */
:root {
  --accent: #ff2a2a;
  --accent-2: #2ff58b;
  --header-h: 64px;
  --rail-w: 72px;
}

/* Header base - prevent wrapping issues */
.hybrid-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: nowrap;
}

.left-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.hybrid-logo {
  flex-shrink: 0;
  white-space: nowrap;
}

.hybrid-search {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 0 0.9rem;
  height: 38px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 320px;
  width: auto !important;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.2s ease;
}

.hybrid-search:focus-within {
  background: rgba(255,255,255,0.14);
  border-color: rgba(28,183,255,0.35);
  box-shadow: 0 0 0 3px rgba(28,183,255,0.12);
}

.hybrid-search input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 100%;
  min-width: 0;
  font-size: 0.9rem;
  font-family: inherit;
}

.hybrid-search input::placeholder {
  color: rgba(255,255,255,0.45);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Left rail - desktop base */
.left-rail {
  position: fixed;
  left: 0;
  top: var(--header-h);
  width: var(--rail-w);
  height: calc(100vh - var(--header-h));
  background: rgba(10,12,16,0.96);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 0.35rem;
  z-index: 90;
  overflow-y: auto;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.28s ease;
}

.left-rail.hidden {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.main-with-rail {
  margin-left: var(--rail-w);
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* Menu toggle - hidden on desktop */
.menu-toggle {
  display: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Hero */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  height: 78vh;
  min-height: 500px;
  max-height: 700px;
}

.hero-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}

.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.2) 100%), linear-gradient(0deg, rgba(10,12,16,1) 0%, transparent 60%);
  z-index: 1;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 2.5rem;
  max-width: 720px;
  width: 100%;
  box-sizing: border-box;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0.8rem 0 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-desc {
  color: rgba(255,255,255,0.72);
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.btn-play {
  background: linear-gradient(91deg,#1cb7ff,#2ff58b);
  color: #000;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-glass {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* Rows */
.row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.8rem 1.5rem 0.6rem;
  gap: 1rem;
}

.horizontal-scroll {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 1.5rem 1.2rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

/* Movie cards */
.movie-card-pro {
  position: relative;
  flex-shrink: 0;
  width: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1d24;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Search dropdown fix */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1e212b;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  display: none;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  min-width: 100%;
}
.search-dropdown.active { display: block; }

/* WATCH PAGE - proper responsive */
.watch-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  padding: 1.5rem;
  box-sizing: border-box;
  width: 100%;
}

.watch-main {
  min-width: 0;
  max-width: 100%;
}

.video-player {
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  width: 100%;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  width: 100%;
}

/* ==================== TABLET <=1024px ==================== */
@media (max-width: 1024px) {
  .menu-toggle {
    display: inline-flex;
  }
  .hybrid-nav {
    display: none;
  }
  .nav-open .hybrid-nav {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(16,17,20,0.98);
    backdrop-filter: blur(16px);
    padding: 0.8rem;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 95;
  }
  .left-rail {
    display: flex !important;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .left-rail.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .left-rail.hidden {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
  }
  .main-with-rail {
    margin-left: 0 !important;
  }
  .hybrid-header {
    padding: 0 1rem;
  }
  .watch-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .hero-carousel {
    height: 68vh;
    min-height: 460px;
  }
}

/* ==================== MOBILE <=768px ==================== */
@media (max-width: 768px) {
  :root { --rail-w: 0px; }
  
  .hybrid-header {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }
  .left-header {
    gap: 0.6rem;
    flex: 1;
  }
  .hybrid-logo {
    font-size: 1.35rem;
  }
  .hybrid-search {
    max-width: 190px;
    height: 36px;
    padding: 0 0.7rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .go-premium {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }
  .login-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }
  .download-app {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }
  .hero-carousel {
    height: 60vh;
    min-height: 380px;
    max-height: 520px;
  }
  .hero-content {
    padding: 1.2rem 1rem;
  }
  .hero-title {
    font-size: 1.45rem;
    line-height: 1.2;
  }
  .hero-desc {
    font-size: 0.82rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .hero-tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.45rem;
  }
  .hero-arrows { display: none !important; }
  .hero-dots { bottom: 0.8rem; }
  
  .row-header {
    padding: 1.2rem 1rem 0.5rem;
  }
  .row-title { font-size: 1.05rem; }
  .horizontal-scroll {
    padding: 0.4rem 1rem 1rem;
    gap: 0.7rem;
  }
  .movie-card-pro {
    width: 132px;
  }
  .card-title { font-size: 0.78rem; }
  
  .episode-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .search-dropdown {
    position: fixed;
    top: var(--header-h);
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
  }
  
  .main-with-rail {
    margin-left: 0 !important;
    width: 100%;
  }
}

/* ==================== SMALL PHONES <=480px ==================== */
@media (max-width: 480px) {
  .hybrid-header {
    padding: 0 0.5rem;
    gap: 0.35rem;
  }
  .left-header {
    gap: 0.4rem;
  }
  .hybrid-logo {
    font-size: 1.15rem;
  }
  .hybrid-search {
    max-width: 140px;
    min-width: 0;
    height: 34px;
    padding: 0 0.6rem;
    background: rgba(255,255,255,0.08);
  }
  .hybrid-search input {
    font-size: 0.82rem;
  }
  /* Keep search usable - never hide input */
  .hybrid-search input {
    display: block !important;
  }
  .menu-toggle {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }
  .go-premium {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }
  .login-btn {
    padding: 0.32rem 0.55rem;
    font-size: 0.75rem;
  }
  .login-btn span:nth-child(2) {
    display: inline; /* keep text readable, was hidden before causing confusion */
  }
  .hero-carousel {
    height: 56vh;
    min-height: 340px;
  }
  .hero-content {
    padding: 1rem 0.85rem;
  }
  .hero-title {
    font-size: 1.25rem;
  }
  .hero-actions {
    gap: 0.4rem;
  }
  .btn-play, .btn-glass {
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
  }
  .movie-card-pro {
    width: 118px;
  }
  .horizontal-scroll {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .row-header {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .watch-grid {
    padding: 0.75rem;
    gap: 1rem;
  }
  .episode-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
}

/* ==================== EXTRA SMALL <=360px ==================== */
@media (max-width: 360px) {
  .hybrid-search {
    max-width: 110px;
  }
  .go-premium {
    display: none; /* hide premium to save space on tiny screens */
  }
  .hero-title { font-size: 1.1rem; }
  .movie-card-pro { width: 108px; }
}

/* Login page mobile */
@media (max-width: 480px) {
  .login-page {
    padding: 1rem 0.75rem;
    align-items: flex-start;
    padding-top: 3rem;
  }
  .login-card {
    padding: 1.5rem 1.2rem;
    border-radius: 0.85rem;
  }
  .login-card h1 { font-size: 1.6rem; }
}

/* Fix tap targets */
@media (max-width: 768px) {
  button, .btn, .movie-card-pro, .left-rail-item, .hybrid-nav a {
    min-height: 0;
    touch-action: manipulation;
  }
}

/* Prevent horizontal scroll from inline styles in watch.html */
#watchGrid, .watch-grid {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Ensure video player never overflows */
.video-player, .video-player-wrap {
  max-width: 100%;
  box-sizing: border-box;
}

/* ======================================================
   UI/UX REQUEST: Search under DRAMAX logo, extend to Login button
   Applies to both index.html and watch.html
   Header becomes 2 rows: top row logo+actions, bottom row full-width search
   ====================================================== */

.hybrid-header.header-with-search-below {
  height: auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 0 !important;
  gap: 0 !important;
  background: rgba(16,17,20,0.98) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-top {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.header-top-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.header-search-row {
  width: 100%;
  padding: 0 1.5rem 12px 1.5rem;
  box-sizing: border-box;
  background: transparent;
  display: flex;
  align-items: center;
}

.header-search-row .hybrid-search {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  flex: 1 1 auto !important;
  background: rgba(255,255,255,0.09) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 12px !important;
  padding: 0 1rem !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.2s ease !important;
}

.header-search-row .hybrid-search:focus-within {
  background: rgba(255,255,255,0.13) !important;
  border-color: rgba(28,183,255,0.35) !important;
  box-shadow: 0 0 0 3px rgba(28,183,255,0.12) !important;
}

.header-search-row .hybrid-search input {
  display: block !important;
  width: 100% !important;
  font-size: 0.92rem !important;
}

.header-search-row .search-dropdown {
  top: calc(100% + 10px) !important;
  left: 0 !important;
  right: 0 !important;
  position: absolute !important;
}

/* Update content padding to account for taller header (64px top + 56px search = 120px) */
.main-with-rail {
  padding-top: 120px;
}

.watch-grid {
  padding-top: 120px !important;
}

/* When header has search below, adjust sticky offset for watch page right panel */
.watch-grid > div:last-child {
  top: 132px !important;
}

/* Left rail top offset now includes search row */
.left-rail {
  top: 120px !important;
  height: calc(100vh - 120px) !important;
}

/* Fix old mobile overrides that forced search to 40px icon */
@media (max-width: 1024px) {
  .header-search-row {
    padding: 0 1rem 12px 1rem !important;
  }
  .header-search-row .hybrid-search {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    border-radius: 12px !important;
    padding: 0 1rem !important;
    background: rgba(255,255,255,0.09) !important;
  }
  .header-search-row .hybrid-search input {
    display: block !important;
  }
  .header-search-row .hybrid-search > span:first-child {
    margin-right: 0.5rem !important;
    font-size: 1rem !important;
  }
}

@media (max-width: 768px) {
  :root { --rail-w: 0px; }
  .header-top {
    height: 58px !important;
    padding: 0 0.9rem !important;
    gap: 0.6rem !important;
  }
  .header-search-row {
    padding: 0 0.9rem 10px 0.9rem !important;
  }
  .header-search-row .hybrid-search {
    height: 42px !important;
    font-size: 0.88rem !important;
  }
  .main-with-rail {
    padding-top: 108px !important;
  }
  .watch-grid {
    padding-top: 108px !important;
  }
  .left-rail {
    top: 108px !important;
    height: calc(100vh - 108px) !important;
  }
  .watch-grid > div:last-child {
    top: 120px !important;
  }
  /* Premium button stays visible */
  .go-premium {
    display: inline-flex !important;
    width: auto !important;
    overflow: visible !important;
  }
}

@media (max-width: 480px) {
  .header-top {
    height: 54px !important;
    padding: 0 0.75rem !important;
  }
  .header-search-row {
    padding: 0 0.75rem 10px 0.75rem !important;
  }
  .header-search-row .hybrid-search {
    height: 40px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-radius: 10px !important;
    /* Override old icon-only collapse */
    background: rgba(255,255,255,0.09) !important;
  }
  .header-search-row .hybrid-search input {
    display: block !important;
  }
  .main-with-rail {
    padding-top: 104px !important;
  }
  .watch-grid {
    padding-top: 104px !important;
  }
  .left-rail {
    top: 104px !important;
    height: calc(100vh - 104px) !important;
  }
  /* Ensure premium and login don't clip */
  .header-top .header-actions {
    gap: 0.35rem !important;
  }
  .go-premium {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
  }
}

@media (max-width: 360px) {
  .go-premium {
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    padding: 0.35rem 0.6rem !important;
    border-radius: 999px !important;
    font-size: 0.7rem !important;
  }
  .go-premium::before {
    content: none !important;
  }
  .header-search-row .hybrid-search {
    height: 38px !important;
  }
}

/* Remove old fixed position search-dropdown override that broke new layout */
@media (max-width: 768px) {
  .header-search-row .search-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }
}

/* ===== DMXHUB REBRAND - Client request: dramax does not correspond with dramaxhub ===== */
.hybrid-logo.dmxhub-logo {
  font-family: 'JetBrains Mono', Inter, monospace !important;
  font-weight: 900 !important;
  font-size: 1.7rem !important;
  letter-spacing: -0.02em !important;
  display: flex !important;
  align-items: center !important;
  line-height: 1 !important;
}
.hybrid-logo.dmxhub-logo .logo-dmx {
  background: linear-gradient(91deg,#1cb7ff 0%, #2ff58b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}
.hybrid-logo.dmxhub-logo .logo-hub {
  background: #fff;
  color: #000;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 4px;
  font-weight: 900;
}
.logo-domain {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  margin-left: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: flex-end;
  margin-bottom: 2px;
}
/* Hide old DRAMAX text */
.hybrid-logo:not(.dmxhub-logo) { display:none; }
