:root {
  --bg: #080a0f;
  --panel: #11141c;
  --panel-2: #181c26;
  --text: #f6f7fb;
  --muted: #939aaa;
  --primary: #e50914;
  --primary-2: #ff3340;
  --border: rgba(255, 255, 255, .09);
  --success: #3ddc97;
  --warning: #ffb020;
  --danger: #ff4757;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, #171b27 0, var(--bg) 38rem);
  color: var(--text);
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 64px;
  padding: 10px 4%;
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(8, 10, 15, .88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.brand {
  border: 0;
  background: transparent;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0;
}

.brand-mark {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav button,
.filter-button {
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav button:hover,
.nav button.active,
.filter-button.active {
  background: var(--panel-2);
  color: white;
}

.icon-button,
.favorite-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  display: grid;
  place-items: center;
  cursor: pointer;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app {
  width: min(1180px, 92%);
  margin: 0 auto;
  padding: 24px 0 80px;
}

.hero {
  min-height: 300px;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(8,10,15,.96), rgba(8,10,15,.32)),
    var(--hero-image) center/cover;
  margin-bottom: 28px;
}

.hero-content {
  max-width: 650px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 6vw, 56px);
}

.hero p,
.muted {
  color: var(--muted);
}

.section-header,
.admin-toolbar,
.form-actions,
.detail-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.section-header {
  margin-bottom: 18px;
}

.section-header h1,
.section-header h2 {
  margin: 0;
}

.search-input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0c0f16;
  color: white;
  padding: 12px 14px;
  outline: none;
}

.search-input {
  width: min(100%, 360px);
}

.search-input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(229, 9, 20, .8);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, .12);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.movie-card {
  min-width: 0;
  cursor: pointer;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

/* Hover effect ကို mouse ရှိတဲ့ device (PC) မှာသာ အလုပ်လုပ်စေမယ် */
@media (hover: hover) and (pointer: fine) {
  .movie-card:hover img {
    transform: scale(1.035);
  }
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .75);
  font-size: 11px;
  font-weight: 800;
}

.movie-card h3 {
  font-size: 15px;
  margin: 9px 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-card p {
  margin: 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 750;
  background: var(--primary);
  color: white;
  cursor: pointer;
}

.button:hover {
  background: var(--primary-2);
}

.button.secondary {
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.button.danger {
  background: var(--danger);
}

.button.small {
  padding: 8px 11px;
  font-size: 13px;
}

.detail-hero {
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    linear-gradient(0deg, var(--bg), rgba(8,10,15,.25)),
    var(--backdrop) center/cover;
}

.detail-content {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  width: 100%;
  align-items: end;
}

.detail-poster {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.meta {
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.episode-section {
  margin-top: 28px;
}

.episode-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scroll-snap-type: x mandatory;
}

.episode-button {
  flex: 0 0 150px;
  min-height: 82px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  text-align: left;
  padding: 12px;
  cursor: pointer;
  scroll-snap-align: start;
}

.episode-button:hover {
  border-color: var(--primary);
}

.modal,
.player-modal {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  color: white;
  width: min(94%, 520px);
  padding: 24px;
}

.player-modal {
  width: min(96%, 1000px);
}

.modal::backdrop,
.player-modal::backdrop {
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(5px);
}

.modal-close,
.player-close {
  float: right;
  border: 0;
  background: transparent;
  font-size: 30px;
  cursor: pointer;
}

.player-title {
  font-weight: 800;
  padding: 7px 45px 15px 0;
}

#videoPlayer {
  display: block;
  width: 100%;
  max-height: 75vh;
  background: black;
  border-radius: 14px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.full {
  grid-column: 1 / -1;
}

.admin-card,
.loading-card,
.empty-card,
.maintenance-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

/*
 * Admin ရဲ့ အဓိက movie list ကိုသာ
 * သီးခြား scroll box လုပ်ထားပါတယ်။
 * TMDB search result list ကို မထိခိုက်ပါ။
 */
#adminList.admin-list {
  max-height: min(68vh, 720px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 6px;
  padding-bottom: 4px;
}

/* Chrome / Android scrollbar */
#adminList.admin-list::-webkit-scrollbar {
  width: 7px;
}

#adminList.admin-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .03);
  border-radius: 999px;
}

#adminList.admin-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
}

#adminList.admin-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .3);
}

/* Mobile admin list */
@media (max-width: 680px) {
  #adminList.admin-list {
    max-height: 62dvh;
    padding-right: 3px;
  }
}

.admin-row {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.admin-row img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 9px;
  background: #222;
}

.status-public {
  color: var(--success);
}

.status-draft {
  color: var(--warning);
}

.parser-preview {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.parser-row {
  display: grid;
  grid-template-columns: 55px 60px 1fr;
  gap: 8px;
  padding: 9px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translate(-50%, 120px);
  opacity: 0;
  background: #f7f7fb;
  color: #080a0f;
  border-radius: 999px;
  padding: 11px 18px;
  transition: .25s;
  max-width: 90%;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 680px) {
  .topbar {
    gap: 9px;
    padding-inline: 3%;
  }

  .brand {
    font-size: 17px;
  }

  .nav button {
    padding: 8px 10px;
    font-size: 12px;
  }

  #app {
    width: 94%;
    padding-top: 16px;
  }

  .movie-grid {
    gap: 8px;
  }

  .movie-card h3 {
    font-size: 12px;
  }

  .poster-wrap {
    border-radius: 11px;
  }

  .hero {
    min-height: 240px;
    padding: 22px;
  }

  .detail-hero {
    padding: 16px;
  }

  .detail-content {
    grid-template-columns: 100px 1fr;
    gap: 14px;
  }

  .detail-content h1 {
    font-size: 22px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: auto;
  }

  .admin-row {
    grid-template-columns: 44px 1fr;
  }

  .admin-row img {
    width: 44px;
    height: 60px;
  }

  .admin-row-actions {
    grid-column: 1 / -1;
  }
}
/* ======================================================
   CMFLIX premium/mobile UI fixes
   Add this block at the END of style.css
   ====================================================== */

body {
  overflow-x: hidden;
}

#app {
  width: min(1240px, calc(100% - 40px));
}

/* ---------- Home hero ---------- */

.hero {
  min-height: clamp(320px, 48vw, 520px);
  position: relative;
  align-items: flex-end;
  padding: clamp(24px, 5vw, 58px);
  isolation: isolate;
  background:
    linear-gradient(
      90deg,
      rgba(5, 7, 11, .97) 0%,
      rgba(5, 7, 11, .76) 42%,
      rgba(5, 7, 11, .12) 100%
    ),
    linear-gradient(
      0deg,
      rgba(5, 7, 11, .95) 0%,
      transparent 58%
    ),
    var(--hero-image) center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 35%;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(
      transparent,
      rgba(8, 10, 15, .68)
    );
}

.hero-content {
  width: min(650px, 100%);
}

.hero-kicker,
.detail-label {
  margin: 0 0 10px;
  color: #ff5360 !important;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -.03em;
}

.hero-overview {
  margin: 0;
  max-width: 620px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .76) !important;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  margin-top: 20px;
}

/* ---------- Genre filters ---------- */

.genre-filter,
.detail-genres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  overflow: visible;
  padding: 1px 1px 18px;
}

.genre-chip {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.genre-filter::-webkit-scrollbar,
.detail-genres::-webkit-scrollbar,
.cast-scroll::-webkit-scrollbar,
.episode-scroll::-webkit-scrollbar {
  display: none;
}

.genre-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 15px;
  background: rgba(17, 20, 28, .8);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.genre-chip:hover,
.genre-chip.active {
  border-color: rgba(229, 9, 20, .7);
  background: rgba(229, 9, 20, .15);
  color: white;
}

.genre-chip.static {
  cursor: default;
}

/* ---------- Movie grid ---------- */

/* Desktop: တစ်တန်း ၅ ကား၊ ကားများရင်လည်း စနစ်တကျ */
.movie-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px 16px;
}

/* Large tablet / small laptop: တစ်တန်း ၄ ကား */
@media (max-width: 1100px) {
  .movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Tablet: တစ်တန်း ၃ ကား */
@media (max-width: 820px) {
  .movie-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 12px;
  }
}

.movie-card {
  transition:
    transform .2s ease,
    opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Hover effect ကို PC (mouse) မှာသာ အလုပ်လုပ်စေမယ် */
@media (hover: hover) and (pointer: fine) {
  .movie-card:hover {
    transform: translateY(-4px);
  }
}

/* ဖုန်း/tablet (touch) မှာ တစ်ချက်ဖိပြီး လက်လွှတ်ရင် နဂိုအတိုင်း ချက်ချင်းပြန်ဖြစ်စေမယ် */
@media (hover: none) {
  .movie-card:active {
    transform: scale(.98);
    transition: transform .1s ease;
  }
  .movie-card:active img {
    transform: none;
  }
}

.poster-wrap {
  box-shadow: 0 14px 32px rgba(0, 0, 0, .22);
}

.movie-card h3 {
  margin-top: 10px;
  font-size: 14px;
}

/* ---------- Detail page ---------- */

.detail-hero {
  min-height: clamp(420px, 55vw, 610px);
  position: relative;
  align-items: flex-end;
  overflow: hidden;
  padding: clamp(24px, 5vw, 54px);
  isolation: isolate;

  background:
    linear-gradient(
      90deg,
      rgba(5, 7, 11, .96) 0%,
      rgba(5, 7, 11, .72) 48%,
      rgba(5, 7, 11, .18) 100%
    ),
    linear-gradient(
      0deg,
      rgba(5, 7, 11, .98) 0%,
      rgba(5, 7, 11, .08) 70%
    ),
    var(--backdrop) center / cover no-repeat;
}

.detail-content {
  grid-template-columns: 180px minmax(0, 1fr);
  grid-template-areas:
    "poster main"
    "poster overview";
  align-items: end;
  gap: 16px 28px;
  max-width: 920px;
}

.detail-poster {
  grid-area: poster;
  width: 180px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  align-self: end;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .48);
}

.poster-placeholder {
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.detail-main {
  grid-area: main;
  min-width: 0;
}

.detail-main h1 {
  margin: 0 0 12px;
  max-width: 760px;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.06;
  letter-spacing: -.03em;
}

.detail-main .meta {
  margin-bottom: 18px;
}

.detail-overview {
  grid-area: overview;
  min-width: 0;
}

.detail-overview h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-overview p {
  margin: 0;
  max-width: 900px;
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
  line-height: 1.85;

  /*
   * Admin က line break ခွဲရေးထားရင်လည်း
   * မူလအတိုင်း ပြပေးပါမယ်။
   */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;

  /*
   * စာဖြတ်ခြင်းကို ပိတ်ထားပါတယ်။
   */
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.detail-actions {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.detail-actions .button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.detail-actions .button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.detail-section {
  margin-top: 30px;
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.detail-section-heading h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 27px);
}

/* ---------- Cast ---------- */

.cast-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.cast-card {
  flex: 0 0 112px;
  min-width: 0;
  scroll-snap-align: start;
}

.cast-card img,
.cast-placeholder {
  width: 112px;
  height: 148px;
  border: 1px solid var(--border);
  border-radius: 15px;
  object-fit: cover;
  display: block;
  background: var(--panel);
}

.cast-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 34px;
  font-weight: 800;
}

.cast-card strong {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  color: white;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cast-card span {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ---------- Episodes ---------- */

.episode-section {
  margin-top: 30px;
}

.episode-button {
  display: grid;
  gap: 5px;
  flex-basis: 170px;
}

.episode-button .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Full-size video player ---------- */

.player-modal {
  position: fixed;
  inset: 0;
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 22px;
  overflow: hidden;
}

.player-modal[open] {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.player-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 5;
  width: 42px;
  height: 42px;
  float: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
}

.player-title {
  flex: 0 0 auto;
  min-height: 45px;
  padding: 5px 52px 14px 0;
  font-size: 17px;
}

#videoPlayer {
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 110px);
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
}

#videoPlayer:fullscreen,
#videoPlayer:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  border-radius: 0;
  object-fit: contain;
  background: #000;
}

/* ---------- Tablet ---------- */

@media (max-width: 820px) {
  #app {
    width: min(100% - 28px, 1240px);
  }

  .hero {
    min-height: 390px;
  }

  .detail-content {
    grid-template-columns: 145px minmax(0, 1fr);
  }

  .detail-poster {
    width: 145px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 680px) {
  #app {
    width: calc(100% - 24px);
    padding-top: 12px;
    padding-bottom: 50px;
  }

  .topbar {
    min-height: 60px;
  }

  .hero {
    min-height: 360px;
    margin-bottom: 24px;
    padding: 24px 20px;
    border-radius: 20px;

    background:
      linear-gradient(
        0deg,
        rgba(5, 7, 11, .98) 0%,
        rgba(5, 7, 11, .72) 48%,
        rgba(5, 7, 11, .12) 100%
      ),
      var(--hero-image) center / cover no-repeat;
  }

  .hero h1 {
    font-size: 31px;
  }

  .hero-overview {
    font-size: 14px;
    line-height: 1.7;
    -webkit-line-clamp: 3;
  }

  .section-header {
    align-items: stretch;
  }

  .section-header h1,
  .section-header h2 {
    width: 100%;
  }

  .search-input {
    width: 100%;
    max-width: none;
  }

  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 10px;
  }

  .movie-card h3 {
    font-size: 13px;
  }

  .movie-card p {
    font-size: 11px;
  }

  .detail-hero {
    min-height: 0;
    padding: 190px 18px 22px;
    border-radius: 20px;

    background:
      linear-gradient(
        0deg,
        rgba(5, 7, 11, .99) 0%,
        rgba(5, 7, 11, .93) 42%,
        rgba(5, 7, 11, .15) 100%
      ),
      var(--backdrop) top center / 100% auto no-repeat;
  }

  .detail-content {
    grid-template-columns: 110px minmax(0, 1fr);
    grid-template-areas:
      "poster main"
      "overview overview";
    align-items: start;
    gap: 17px 15px;
  }

  .detail-poster {
    width: 110px;
    max-width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 13px;
    align-self: start;
  }

  .detail-main h1 {
    margin-bottom: 9px;
    font-size: 23px;
    line-height: 1.12;
  }

  .detail-label {
    margin-bottom: 7px;
  }

  .detail-main .meta {
    gap: 6px 10px;
    margin-bottom: 13px;
    font-size: 12px;
  }

  .detail-actions {
    gap: 8px;
    margin: 0;
  }

  .detail-actions .button {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 13px;
  }

  .detail-actions .button svg {
    width: 18px;
    height: 18px;
  }

  .detail-overview {
    width: 100%;
    padding-top: 5px;
  }

  .detail-overview p {
    font-size: 14px;
    line-height: 1.8;
    display: block;
    overflow: visible;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
  }

  .detail-section {
    margin-top: 25px;
  }

  .cast-card {
    flex-basis: 94px;
  }

  .cast-card img,
  .cast-placeholder {
    width: 94px;
    height: 128px;
    border-radius: 13px;
  }

  .player-modal {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding:
      max(12px, env(safe-area-inset-top))
      12px
      max(12px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: #000;
  }

  .player-modal::backdrop {
    background: #000;
  }

  .player-title {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: 16px;
    right: 58px;
    z-index: 4;
    padding: 8px 0;
    text-shadow: 0 2px 8px #000;
  }

  .player-close {
    top: max(8px, env(safe-area-inset-top));
    right: 10px;
  }

  #videoPlayer {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    object-fit: contain;
  }
}

/* Mobile landscape video */

@media (
  max-width: 920px
) and (
  orientation: landscape
) {
  .player-title {
    font-size: 14px;
  }

  #videoPlayer {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
  }
}
/* ======================================================
   CMFLIX improved player UI
   ====================================================== */

.player-modal {
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  background: #080a0f;
  color: white;
  box-shadow:
    0 30px 100px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(255, 255, 255, .03);
}

.player-modal[open] {
  display: block;
}

.player-modal::backdrop {
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(12px);
}

.player-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(
      circle at top,
      rgba(229, 9, 20, .11),
      transparent 38%
    ),
    #080a0f;
}

.player-header {
  position: relative;
  z-index: 4;
  min-height: 72px;
  padding: 13px 15px 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(8, 10, 15, .94);
}

.player-heading {
  min-width: 0;
}

.player-kicker {
  display: block;
  margin-bottom: 3px;
  color: #ff4b58;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.player-title {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  color: white;
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.player-action-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  color: white;
  cursor: pointer;
  transition:
    background .2s ease,
    border-color .2s ease,
    transform .2s ease;
}

.player-action-button:hover {
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .14);
  transform: translateY(-1px);
}

.player-action-button svg {
  width: 19px;
  height: 19px;
}

.player-close {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
  float: none;
  font-size: 27px;
  line-height: 1;
  background: rgba(229, 9, 20, .18);
}

.player-close:hover {
  border-color: rgba(229, 9, 20, .7);
  background: rgba(229, 9, 20, .35);
}

.player-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(
      circle at center,
      #161922,
      #000 72%
    );
}

#videoPlayer {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 105px);
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 0;
  background: #000;
}

.player-status {
  position: absolute;
  left: 50%;
  bottom: 74px;
  z-index: 3;
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(0, 0, 0, .78);
  color: rgba(255, 255, 255, .9);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity .2s ease,
    transform .2s ease,
    visibility .2s ease;
  backdrop-filter: blur(8px);
}

.player-status.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

#videoPlayer:fullscreen,
#videoPlayer:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
  background: #000;
}

@media (max-width: 680px) {
  .player-modal {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #000;
  }

  .player-modal::backdrop {
    background: #000;
  }

  .player-shell {
    width: 100%;
    height: 100%;
    justify-content: center;
    background: #000;
  }

  .player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    min-height: 68px;
    padding:
      max(10px, env(safe-area-inset-top))
      11px
      10px
      15px;
    border-bottom: 0;
    background:
      linear-gradient(
        rgba(0, 0, 0, .88),
        transparent
      );
  }

  .player-heading {
    max-width: calc(100vw - 125px);
  }

  .player-title {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    padding: 0;
    font-size: 14px;
    text-shadow: 0 2px 8px #000;
  }

  .player-kicker {
    font-size: 9px;
  }

  .player-action-button {
    width: 39px;
    height: 39px;
    background: rgba(0, 0, 0, .58);
  }

  .player-stage {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    background: #000;
  }

  #videoPlayer {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .player-status {
    bottom:
      max(
        72px,
        calc(env(safe-area-inset-bottom) + 56px)
      );
    font-size: 12px;
  }
}

@media (
  max-width: 920px
) and (
  orientation: landscape
) {
  .player-header {
    min-height: 56px;
    padding-block: 7px;
  }

  .player-kicker {
    display: none;
  }

  .player-action-button {
    width: 38px;
    height: 38px;
  }

  #videoPlayer {
    max-height: 100dvh;
  }
}

.detail-overview p {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: normal;
}
/* Mobile: တစ်တန်း ၃ ကား */
@media (max-width: 680px) {
  .movie-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 7px;
  }

  .movie-card {
    min-width: 0;
  }

  .poster-wrap {
    border-radius: 9px;
  }

  .card-badge {
    top: 5px;
    left: 5px;
    padding: 4px 6px;
    font-size: 8px;
  }

  .movie-card h3 {
    margin: 7px 1px 3px;
    font-size: 11px;
    line-height: 1.35;
  }

  .movie-card p {
    margin-inline: 1px;
    font-size: 9px;
  }
}

.catalog-loader {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 28px 0 8px;
}

.catalog-status {
  min-height: 20px;
  margin: 0;
  font-size: 12px;
  text-align: center;
}
.poster-wrap img,
.detail-poster,
.cast-card img {
  -webkit-user-drag: none;
  user-select: none;
}

.poster-wrap,
.detail-poster,
.cast-card img,
.hero,
.detail-hero {
  -webkit-touch-callout: none;
}
/* ---------- Editable episode parser ---------- */

.parser-preview {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
}

.parser-preview-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: #11141c;
}

.parser-list {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.parser-row.editable {
  display: grid;
  grid-template-columns:
    90px
    90px
    minmax(220px, 1fr)
    100px
    auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.parser-row.editable label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.parser-row.editable label span {
  color: var(--muted);
  font-size: 11px;
}

.parser-row.editable input,
.parser-row.editable select {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0c0f16;
  color: white;
}

.parser-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 680px) {
  .parser-row.editable {
    grid-template-columns: 1fr 1fr;
  }

  .parser-url-field {
    grid-column: 1 / -1;
  }

  .parser-delete {
    width: 100%;
  }
}
/* ---------- Season and episode browser ---------- */

.episode-browser {
  width: 100%;
  min-width: 0;
}

.episode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.season-selector {
  display: flex;
  align-items: center;
  gap: 9px;
}

.season-selector span,
.episode-count {
  color: var(--muted);
  font-size: 13px;
}

.season-selector select {
  min-width: 135px;
  padding: 10px 35px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: white;
}

.episode-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.episode-grid .episode-button {
  width: 100%;
  min-width: 0;
  min-height: 76px;
  display: grid;
  gap: 5px;
  padding: 12px;
  text-align: left;
}

.episode-grid .episode-button strong,
.episode-grid .episode-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.episode-pagination button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

@media (max-width: 820px) {
  .episode-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .episode-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .episode-grid .episode-button {
    min-height: 70px;
    padding: 10px;
    font-size: 12px;
  }

  .episode-toolbar {
    align-items: stretch;
  }

  .season-selector {
    width: 100%;
    justify-content: space-between;
  }

  .season-selector select {
    flex: 1;
  }
}
/* ======================================================
   CMFLIX fixed bottom navigation
   ====================================================== */

:root {
  --bottom-nav-height: 78px;
  --bottom-nav-accent: #15b8ff;
  --bottom-nav-background: rgba(8, 10, 15, .96);
}

/*
 * Top navigation ဖြုတ်ပြီးနောက်
 * Logo နဲ့ Account button ကို ဘယ်/ညာ ခွဲထားမယ်။
 */
.topbar {
  justify-content: space-between;
}

/*
 * Content ကို fixed bottom navigation အောက်
 * မဖုံးသွားအောင် နေရာချန်ထားမယ်။
 */
#app {
  padding-bottom:
    calc(
      var(--bottom-nav-height) +
      env(safe-area-inset-bottom) +
      42px
    );
}

/* Fixed bottom navigation container */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;

  min-height:
    calc(
      var(--bottom-nav-height) +
      env(safe-area-inset-bottom)
    );

  padding:
    8px
    max(10px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 4px;

  border-top: 1px solid rgba(255, 255, 255, .1);

  background:
    linear-gradient(
      180deg,
      rgba(8, 10, 15, .92),
      var(--bottom-nav-background)
    );

  box-shadow:
    0 -12px 35px rgba(0, 0, 0, .38);

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Navigation button */
.bottom-nav-item {
  position: relative;
  min-width: 0;
  min-height: 60px;
  padding: 5px 4px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;

  border: 0;
  border-radius: 13px;
  outline: none;

  background: transparent;
  color: #969ba8;

  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  transition:
    color .2s ease,
    background .2s ease,
    transform .15s ease;
}

.bottom-nav-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Navigation icon */
.bottom-nav-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;

  transition:
    color .2s ease,
    transform .2s ease,
    filter .2s ease;
}

/* Selected item */
.bottom-nav-item.active {
  color: var(--bottom-nav-accent);
  background:
    linear-gradient(
      180deg,
      rgba(21, 184, 255, .1),
      rgba(21, 184, 255, .025)
    );
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-1px);
  filter:
    drop-shadow(
      0 0 7px rgba(21, 184, 255, .42)
    );
}

/* Active item အပေါ်မှာ indicator line သေးသေး */
.bottom-nav-item.active::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;

  width: 30px;
  height: 3px;

  border-radius: 0 0 999px 999px;
  background: var(--bottom-nav-accent);

  box-shadow:
    0 0 10px rgba(21, 184, 255, .6);

  transform: translateX(-50%);
}

/* Keyboard accessibility */
.bottom-nav-item:focus-visible {
  box-shadow:
    inset 0 0 0 2px var(--bottom-nav-accent);
}

/* Touch feedback */
.bottom-nav-item:active {
  transform: scale(.95);
}

/*
 * Toast message ကို bottom navigation အပေါ်မှာ ပြမယ်။
 */
.toast {
  bottom:
    calc(
      var(--bottom-nav-height) +
      env(safe-area-inset-bottom) +
      18px
    );
}

/* Desktop မှာ navigation content အရမ်းပြန့်မသွားစေရန် */
@media (min-width: 900px) {
  .bottom-nav {
    left: 50%;
    right: auto;

    width: min(620px, calc(100% - 40px));

    border:
      1px solid rgba(255, 255, 255, .11);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;

    transform: translateX(-50%);

    box-shadow:
      0 -14px 45px rgba(0, 0, 0, .5);
  }
}

/* Mobile */
@media (max-width: 680px) {
  :root {
    --bottom-nav-height: 72px;
  }

  .bottom-nav {
    gap: 1px;
    padding-top: 6px;
  }

  .bottom-nav-item {
    min-height: 57px;
    gap: 4px;
    padding-inline: 2px;
    border-radius: 11px;
    font-size: 10px;
  }

  .bottom-nav-icon {
    width: 24px;
    height: 24px;
  }

  /*
   * အပေါ်က မူရင်း mobile #app padding-bottom: 50px
   * rule ကို override ပြန်လုပ်ထားတာပါ။
   */
  #app {
    padding-bottom:
      calc(
        var(--bottom-nav-height) +
        env(safe-area-inset-bottom) +
        32px
      );
  }
}
