/* ==========================================================================
   ShortDramas Pages CSS - Home, Discover, Detail, Top 10, Search, Profile, VIP
   ========================================================================== */

/* ==========================================================================
   1. Home View
   ========================================================================== */
.hero-billboard {
  position: relative;
  width: 100%;
  min-height: clamp(380px, 48vw, 560px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  background: #141721;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  margin-bottom: 36px;
}

.hero-art-bg {
  position: absolute;
  inset: 0 0 0 25%;
  width: 75%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.85;
}

.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(90deg, #090a0f 0%, rgba(9, 10, 15, 0.94) 30%, rgba(9, 10, 15, 0.55) 65%, transparent 100%),
    linear-gradient(0deg, #090a0f 0%, rgba(9, 10, 15, 0.7) 35%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  padding: clamp(24px, 5vw, 56px);
}

.hero-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 45, 85, 0.2);
  border: 1px solid rgba(255, 45, 85, 0.4);
  border-radius: var(--radius-full);
  color: #ff5b79;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(28px, 4.2vw, 54px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: #fff;
  margin-bottom: 14px;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #d1d5db;
  margin-bottom: 14px;
}

.hero-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ==========================================================================
   2. Discover / Short Dramas View
   ========================================================================== */
.discover-header {
  margin-bottom: 28px;
}

.discover-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: #fff;
  margin-bottom: 6px;
}

.discover-sub {
  color: var(--text-muted);
  font-size: 14px;
}

.genre-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.genre-card-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s;
}

.genre-card-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent-pink);
}

.genre-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.75);
}

.genre-card-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  padding: 8px;
  background: rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   3. Drama Detail View
   ========================================================================== */
.detail-hero-box {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  background: var(--bg-surface);
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  padding: clamp(24px, 4vw, 48px);
  margin-bottom: 36px;
}

.detail-backdrop-art {
  position: absolute;
  inset: 0 0 0 35%;
  width: 65%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.detail-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #141721 0%, rgba(20, 23, 33, 0.95) 40%, rgba(20, 23, 33, 0.4) 100%);
}

.detail-content-wrap {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.detail-title {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 12px;
}

.cast-section {
  margin: 32px 0;
}

.cast-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.cast-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 80px;
  flex-shrink: 0;
}

.cast-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-light);
  margin-bottom: 6px;
}

.cast-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.cast-role {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Episode Tabs in Detail */
.episode-range-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.range-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-subtle);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.range-tab-btn.active {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
}

.episodes-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.episode-cell-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.episode-cell-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line-highlight);
}

.episode-cell-card.playing {
  background: rgba(255, 45, 85, 0.15);
  border-color: var(--accent-pink);
  color: var(--accent-pink);
  font-weight: 800;
}

.episode-cell-card.locked {
  color: var(--text-subtle);
}

.ep-num-label {
  font-size: 13.5px;
  font-weight: 700;
}

.ep-sub-label {
  font-size: 11px;
  margin-top: 4px;
}

/* ==========================================================================
   4. Profile, Wallet & VIP Modals
   ========================================================================== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--line-subtle);
  margin-bottom: 24px;
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-pink);
}

.profile-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  text-align: center;
}

.stat-val {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Coin Packages Grid */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.package-item {
  position: relative;
  padding: 18px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-subtle);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.package-item:hover, .package-item.selected {
  border-color: var(--accent-pink);
  background: rgba(255, 45, 85, 0.08);
}

.package-badge-popular {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.pkg-coins-amount {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pkg-price {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* VIP Modal Styles */
.vip-banner-box {
  background: linear-gradient(135deg, #2b1f00 0%, #151105 100%);
  border: 1px solid rgba(255, 184, 0, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
}

.vip-perks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  text-align: left;
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #e5e7eb;
}

.perk-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.2);
  color: var(--success-green);
  display: grid;
  place-items: center;
  font-size: 11px;
}

/* Settings Items */
.settings-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  overflow: hidden;
}

.settings-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-subtle);
  cursor: pointer;
  transition: background 0.2s;
}

.settings-menu-row:last-child {
  border-bottom: none;
}

.settings-menu-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.setting-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
}

.setting-value {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-page-container [hidden] { display: none !important; }

/* Page Containers & Section Utilities */
.home-page-container,
.discover-page-container,
.detail-page-container,
.top10-page-container,
.search-page-container,
.mylist-page-container,
.profile-page-container {
  width: 100%;
}

.episodes-section {
  margin-top: 36px;
}

.genre-card-item.active {
  border-color: var(--accent-pink);
  box-shadow: 0 0 15px rgba(255, 45, 85, 0.4);
}

.episode-cell-card.playing {
  background: rgba(255, 45, 85, 0.2);
  border-color: var(--accent-pink);
  color: #fff;
  font-weight: 800;
}

/* Responsive Overrides for Pages */
@media (max-width: 900px) {
  .hero-billboard {
    min-height: 420px;
  }
  .hero-art-bg {
    inset: 0;
    width: 100%;
    opacity: 0.5;
  }
  .hero-gradient-overlay {
    background: linear-gradient(0deg, #090a0f 0%, rgba(9, 10, 15, 0.9) 60%, rgba(9, 10, 15, 0.2) 100%);
  }
  .hero-content {
    max-width: 100%;
    padding: 24px 20px;
  }
  .hero-title {
    font-size: 36px;
  }
  .detail-hero-box {
    min-height: 380px;
    padding: 24px 18px;
  }
  .detail-backdrop-art {
    inset: 0;
    width: 100%;
    opacity: 0.4;
  }
  .detail-gradient {
    background: linear-gradient(0deg, #141721 0%, rgba(20, 23, 33, 0.92) 65%, rgba(20, 23, 33, 0.3) 100%);
  }
  .detail-title {
    font-size: 32px;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 28px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .detail-title {
    font-size: 26px;
  }
  .detail-content-wrap .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .detail-content-wrap .hero-actions .btn {
    width: 100%;
  }
  .packages-grid {
    grid-template-columns: 1fr;
  }
  .profile-stats-bar {
    grid-template-columns: repeat(3, 1fr);
    padding: 12px 10px;
    gap: 8px;
  }
  .stat-val {
    font-size: 18px;
  }
}
