/**
 * Play page: minimal layout so player fills viewport (no page scroll).
 */
html:has(body.play_online) {
  height: 100%;
  overflow: hidden;
}

body.play_online {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.play_online.admin-bar {
  height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px)) !important;
  max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px)) !important;
}

body.play_online .filmkio_page {
  min-height: 0;
  height: 100%;
  max-height: inherit;
  overflow: hidden;
}

body.play_online .filmkio_header,
body.play_online .mobile_footer_menu,
body.play_online .side_menu_mobile {
  display: none !important;
}

body.play_online .filmkio_page > main,
body.play_online #tamasha-play-root {
  margin: 0;
  padding: 0;
  height: 100%;
  max-height: inherit;
  overflow: hidden;
}

body.play_online .play_online_page,
body.play_online .FilmKioPlayer,
body.play_online .tamasha-videojs-shell {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: inherit;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

body.play_online .tamasha-videojs-shell {
  display: flex;
  flex-direction: column;
}

body.play_online .tamasha-player-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Video.js fullscreen: root fills the fullscreen element */
body.play_online .tamasha-filmkio-skin .video-js.vjs-fullscreen,
body.play_online .tamasha-filmkio-skin .video-js.vjs-full-window,
body.play_online .tamasha-filmkio-skin .video-js:fullscreen,
body.play_online .tamasha-filmkio-skin .video-js:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
}

body.play_online .tamasha-filmkio-skin .video-js.vjs-fullscreen .tamasha-fk-foot,
body.play_online .tamasha-filmkio-skin .video-js.vjs-full-window .tamasha-fk-foot,
body.play_online .tamasha-filmkio-skin .video-js:fullscreen .tamasha-fk-foot,
body.play_online .tamasha-filmkio-skin .video-js:-webkit-full-screen .tamasha-fk-foot {
  z-index: 50;
}

body.play_online .tamasha-filmkio-skin .video-js.vjs-fullscreen .tamasha-player-head,
body.play_online .tamasha-filmkio-skin .video-js.vjs-full-window .tamasha-player-head,
body.play_online .tamasha-filmkio-skin .video-js:fullscreen .tamasha-player-head,
body.play_online .tamasha-filmkio-skin .video-js:-webkit-full-screen .tamasha-player-head {
  z-index: 60;
}
/* Episodes Selection Page */
html:has(body.tm-episodes-page) {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.tm-episodes-page {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 100dvh;
  background: #0b0e0f;
}

body.tm-episodes-page .filmkio_page,
body.tm-episodes-page #tamasha-play-root,
body.tm-episodes-page .play_online_page {
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  overflow: visible !important;
}

.episodes_selection_page {
  position: relative;
  min-height: 100vh;
  padding: 50px 0 80px;
  color: #f2f2f2;
  overflow: visible;
  z-index: 1;
}

.bg_episodes_page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.25;
  background: #080a0b;
}

.bg_episodes_page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(40px) brightness(0.35);
}

.bg_episodes_page::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(11, 14, 15, 0.4) 0%, #0b0e0f 100%);
}

.head_episodes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding: 24px 30px;
  background: rgba(17, 22, 24, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(245, 173, 17, 0.15);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.head_episodes .right_head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.head_episodes .series_mini_poster {
  width: 60px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid rgba(245, 173, 17, 0.5);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: transform 0.3s;
}

.head_episodes .series_mini_poster:hover {
  transform: scale(1.05);
}

.head_episodes .title_holder {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.head_episodes h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.head_episodes .sub_title_head {
  font-size: 14px;
  color: #b8b8b8;
  font-weight: 500;
}

.head_episodes .left_head a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0b0e0f;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #f5ad11 0%, #d89508 100%);
  padding: 10px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(245, 173, 17, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.head_episodes .left_head a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 173, 17, 0.5);
  color: #000;
}

.head_episodes .left_head svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
  transform: rotate(90deg);
}

.main_selection_holder {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
}

.sidebar_seasons {
  background: rgba(17, 22, 24, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  height: fit-content;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.title_sidebar {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 16px;
  font-weight: 800;
  color: #f2f2f2;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar_seasons ul {
  list-style: none;
  padding: 10px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar_seasons ul li {
  position: relative;
}

.sidebar_seasons ul li a {
  display: block;
  padding: 14px 20px;
  color: #b8b8b8;
  font-weight: 600;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar_seasons ul li.active a {
  background: linear-gradient(135deg, rgba(245, 173, 17, 0.15) 0%, rgba(245, 173, 17, 0.05) 100%);
  color: #f5ad11;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(245, 173, 17, 0.2);
}

.sidebar_seasons ul li.active::before {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: #f5ad11;
  border-radius: 4px;
  box-shadow: 0 0 8px #f5ad11;
}

.sidebar_seasons ul li a:hover:not(.active a) {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  padding-right: 25px;
}

.loco_season {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 25px;
  color: #fff;
  padding-bottom: 8px;
  position: relative;
  display: inline-block;
}

.loco_season::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 3px;
  background: #f5ad11;
  border-radius: 3px;
  box-shadow: 0 0 8px #f5ad11;
}

.inner_parts_holder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.episode_item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/9;
  text-decoration: none;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #111618;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.episode_item:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 173, 17, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 173, 17, 0.15);
}

.bg_part_ser {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.bg_part_ser::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.85) 100%);
  z-index: 2;
  transition: opacity 0.3s;
}

.bg_part_ser img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.episode_item:hover .bg_part_ser img {
  transform: scale(1.08);
}

.episode_item:hover .bg_part_ser::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.9) 100%);
}

.center_btn_play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #f5ad11 0%, #d89508 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 3;
  box-shadow: 0 4px 15px rgba(245, 173, 17, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.episode_item:hover .center_btn_play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.center_btn_play svg {
  width: 18px;
  height: 18px;
  fill: #0b0e0f;
  margin-right: 2px;
}

.episode_item_info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px 16px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  box-sizing: border-box;
  direction: rtl;
}

.episode_item_info .ep_name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.en_epi {
  background: #f5ad11;
  color: #0b0e0f;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(245, 173, 17, 0.3);
  position: static;
  z-index: auto;
}

/* availability notice styling */
.episodes_selection_page .tamasha-episode-notice {
  margin-bottom: 30px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(29, 138, 225, 0.1);
  border: 1px dashed rgba(29, 138, 225, 0.3);
  color: #8ec3f8;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 992px) {
  .main_selection_holder {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .episodes_selection_page {
    padding: 30px 0 50px;
  }
  
  .head_episodes {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 20px;
  }
  
  .head_episodes .right_head {
    align-items: center;
  }
  
  .head_episodes .left_head a {
    justify-content: center;
    width: 100%;
  }

  .sidebar_seasons {
    border-radius: 15px;
  }

  .sidebar_seasons ul {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    gap: 8px;
  }
  
  .sidebar_seasons ul::-webkit-scrollbar {
    display: none;
  }
  
  .sidebar_seasons ul li {
    flex: 0 0 auto;
  }
  
  .sidebar_seasons ul li.active::before {
    display: none;
  }
  
  .sidebar_seasons ul li.active a {
    box-shadow: 0 4px 12px rgba(245, 173, 17, 0.2);
  }

  .inner_parts_holder {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .inner_parts_holder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  
  .episode_item {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
  }
  
  .head_episodes h1 {
    font-size: 18px;
  }
  
  .episode_item_info {
    padding: 8px 10px;
  }
  
  .episode_item_info .ep_name {
    font-size: 12px;
  }
  
  .en_epi {
    padding: 2px 6px;
    font-size: 10px;
  }
}

.episodes_selection_page .container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .episodes_selection_page .container {
    padding: 0 16px;
  }
}

/* ========================================
   PREMIUM GATE & FALLBACK SCREENS
   ======================================== */
.tamasha-gate-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0b0e0f;
  z-index: 10000;
  padding: 20px;
  overflow: hidden;
  box-sizing: border-box;
}

.tamasha-gate-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.tamasha-gate-bg-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.tamasha-gate-bg-glow.glow-1 {
  background: #f5ad11;
  top: 10%;
  right: 15%;
}

.tamasha-gate-bg-glow.glow-2 {
  background: #3b82f6;
  bottom: 10%;
  left: 15%;
}

.tamasha-gate-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  background: rgba(17, 22, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: gateCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  direction: rtl;
}

@keyframes gateCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tamasha-gate-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(245, 173, 17, 0.15) 0%, rgba(245, 173, 17, 0.05) 100%);
  border: 1px solid rgba(245, 173, 17, 0.25);
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5ad11;
  box-shadow: 0 8px 24px rgba(245, 173, 17, 0.15);
}

.tamasha-gate-icon.alert-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}

.tamasha-gate-icon svg {
  width: 32px;
  height: 32px;
}

.tamasha-gate-title {
  font-family: "iranyekan", "YekanBakh", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  line-height: 1.5;
}

.tamasha-gate-desc {
  font-family: "iranyekan", "YekanBakh", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #b8b8b8;
  margin-bottom: 32px;
  line-height: 1.7;
}

.tamasha-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tamasha-gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  font-family: "iranyekan", "YekanBakh", sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.tamasha-gate-btn-primary {
  background: linear-gradient(135deg, #f5ad11 0%, #d89508 100%);
  color: #0b0e0f !important;
  box-shadow: 0 4px 20px rgba(245, 173, 17, 0.25);
}

.tamasha-gate-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 173, 17, 0.4);
  color: #0b0e0f !important;
}

.tamasha-gate-btn-primary svg.btn-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.tamasha-gate-btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff !important;
}

.tamasha-gate-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .tamasha-gate-card {
    padding: 32px 20px;
    border-radius: 16px;
  }
  .tamasha-gate-title {
    font-size: 18px;
  }
  .tamasha-gate-desc {
    font-size: 13px;
    margin-bottom: 24px;
  }
}

/* Movi Player (MKV soft sub) */
body.play_online-mkv .tamasha-filmkio-skin {
  display: flex;
  flex-direction: column;
}

body.play_online-mkv .webflix-movi-stage {
  flex: 1;
  min-height: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

body.play_online-mkv .webflix-movi-player {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.play_online-mkv movi-player::part(container) {
  width: 100%;
  height: 100%;
}

body.play_online-mkv movi-player.webflix-movi-player {
  font-family: "iranyekan", "YekanBakh", sans-serif;
}

  z-index: 20;
}

body.play_online-mkv .tamasha-series-nav {
  z-index: 20;
}

