/* WebMasti Design System - Premium Dark OTT Theme */
:root {
  --bg-dark: #090b10;
  --bg-card: rgba(18, 22, 33, 0.85);
  --bg-card-hover: rgba(28, 34, 50, 0.95);
  --accent-pink: #ff0055;
  --accent-purple: #7928ca;
  --accent-gradient: linear-gradient(135deg, #ff0055 0%, #7928ca 100%);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-glass: rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 10px 30px rgba(255, 0, 85, 0.25);
  --radius-card: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 11, 16, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 14px 24px;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-masti {
  color: #fff;
}

.logo-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-vip {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-gradient);
  color: #fff;
  padding: 3px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 450px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 10px 16px 10px 42px;
  border-radius: 30px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.search-box input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-pink);
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.2);
}

/* Ad Banner Container */
.ad-container {
  max-width: 1400px;
  margin: 14px auto;
  padding: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.ad-container iframe, .ad-container img {
  max-width: 100%;
  height: auto;
  border: none;
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 420px;
  max-width: 1400px;
  margin: 20px auto;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 40px;
  background: #111420;
  box-shadow: inset 0 0 100px #000;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4) blur(2px);
  transition: background 0.5s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9,11,16,0.95) 20%, rgba(9,11,16,0.3) 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 600px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-pink);
  background: rgba(255, 0, 85, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 0, 85, 0.3);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.hero-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.meta-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.btn-play {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.2s ease;
}

.btn-play:hover {
  transform: scale(1.05);
}

/* Category Pills */
.category-bar {
  max-width: 1400px;
  margin: 0 auto 20px;
  padding: 0 24px;
}

.category-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.pill:hover, .pill.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

/* Main Catalog Grid */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 0, 85, 0.4);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #181c28;
  overflow: hidden;
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-poster img {
  transform: scale(1.08);
}

.card-episodes-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Modal Player */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #111420;
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  width: 100%;
  max-width: 950px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.btn-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.8rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-close:hover {
  background: var(--accent-pink);
}

.modal-header {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-poster {
  width: 140px;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.modal-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Realtime Engagement Bar (Views, Likes, Native Share) Directly Below Player */
.modal-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 18px 0;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.modal-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #d1d5db;
}

.btn-stat-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 0, 85, 0.1);
  border: 1px solid rgba(255, 0, 85, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-pink);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}

.btn-stat-like:active, .btn-stat-like:hover {
  transform: scale(1.05);
  background: rgba(255, 0, 85, 0.25);
}

.btn-stat-like.liked {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 0, 85, 0.4);
}

.btn-stat-like.liked svg {
  fill: #fff;
}

.btn-stat-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(121, 40, 202, 0.15);
  border: 1px solid rgba(121, 40, 202, 0.35);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #c084fc;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}

.btn-stat-share:active, .btn-stat-share:hover {
  transform: scale(1.05);
  background: rgba(121, 40, 202, 0.35);
  color: #fff;
}

/* Video Player */
.player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--border-glass);
}

.player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-watermark {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.player-status {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: var(--accent-pink);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  opacity: 1;
  visibility: visible;
}

/* Episodes Grid */
.episodes-section {
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
}

.episodes-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.btn-ep {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-ep:hover, .btn-ep.active {
  background: var(--accent-gradient);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

/* Pagination Controls */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn-page {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-page:hover {
  background: rgba(255, 0, 85, 0.25);
  border-color: var(--accent-pink);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 85, 0.35);
}

.btn-page.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 25px rgba(255, 0, 85, 0.5);
  transform: scale(1.08);
}

.btn-page:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-page.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 25px rgba(255, 0, 85, 0.45);
  transform: scale(1.08);
}

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.footer {
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-glass);
}

/* Responsive Media Queries for Mobile & Tablet */
@media (max-width: 1024px) {
  .nav-container {
    padding: 0 10px;
  }
  .hero-section {
    height: 360px;
    padding: 30px;
  }
  .hero-title {
    font-size: 2rem;
  }
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .navbar {
    padding: 10px 14px;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .logo {
    justify-content: center;
    font-size: 1.5rem;
  }

  .search-box {
    max-width: 100%;
  }

  .hero-section {
    height: auto;
    min-height: 280px;
    margin: 10px 14px;
    padding: 20px;
    border-radius: 14px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-desc {
    font-size: 0.85rem;
    margin-bottom: 14px;
  }

  .btn-play {
    padding: 10px 20px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }

  .category-bar {
    padding: 0 14px;
    margin-bottom: 14px;
  }

  .category-container {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-container::-webkit-scrollbar {
    display: none;
  }

  .main-content {
    padding: 0 14px 40px;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card-info {
    padding: 10px;
  }

  .card-title {
    font-size: 0.88rem;
  }

  .modal-overlay {
    padding: 6px;
  }

  .modal-card {
    padding: 14px 12px;
    max-height: 96vh;
    border-radius: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .modal-poster {
    width: 85px;
    height: 110px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .modal-info h2 {
    font-size: 1.15rem;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  .modal-desc {
    font-size: 0.8rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .modal-actions-bar {
    padding: 8px 12px;
    margin: 10px 0 14px 0;
    gap: 8px;
  }

  .stat-badge, .btn-stat-like, .btn-stat-share {
    padding: 7px 12px;
    font-size: 0.82rem;
    min-height: 38px;
  }

  .episodes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .btn-ep {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .pagination-container {
    gap: 6px;
    margin-top: 24px;
  }

  .btn-page {
    min-width: 36px;
    height: 36px;
    padding: 4px 8px;
    font-size: 0.85rem;
    border-radius: 8px;
  }
}

/* Native Ad Box Container & Responsive Scaling */
.native-ad-box {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 15px 0 25px 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 10px 4px;
}

.native-ad-box iframe, 
.native-ad-box div {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 480px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .card-episodes-badge {
    font-size: 0.6rem;
    padding: 2px 5px;
  }
  
  .episodes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .native-ad-box {
    margin: 10px 0 16px 0;
    padding: 4px 2px;
    border-radius: 8px;
  }
}

/* Continue Watching Section */
.continue-section {
  max-width: 1400px;
  margin: -30px auto 20px;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.continue-container {
  background: rgba(18, 22, 33, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 0, 85, 0.3);
  box-shadow: 0 8px 32px rgba(255, 0, 85, 0.15);
  border-radius: 14px;
  padding: 16px 20px;
}

.continue-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-pink);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.continue-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.continue-thumb {
  width: 90px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  object-fit: cover;
}

.continue-details {
  flex: 1;
}

.continue-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.continue-ep {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-resume {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease;
}

.btn-resume:hover {
  transform: scale(1.05);
}

/* 5-Second Autoplay Progress Bar Header */
.autoplay-bar-wrapper {
  background: rgba(15, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.autoplay-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.btn-play-now {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.autoplay-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.autoplay-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-gradient);
  transition: width 0.1s linear;
}


