/* ShwePlay Catalogs & Luxury Modals — Consolidated & Mobile Remediation */

/* CRITICAL Filter Hub & Country Dropdown Fix [S2-CAT-01] */
.sp-filter-hub { overflow: visible !important; }
.content-section.row > .sp-filter-hub {
  margin-inline: 10px;
  width: calc(100% - 20px);
}
.sp-sort-row > .sp-sort-group { margin-right: auto; }
.sp-genre-chip,
.sp-sort-btn,
.sp-filter-pill,
.sp-filter-reset-btn {
  min-height: 40px !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
}
.sp-dropdown-toggle {
  min-height: 42px;
  justify-content: space-between;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}
.sp-dropdown-toggle .sp-dropdown-label { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.sp-dropdown-toggle.dropdown-toggle::after {
  margin-left: 10px;
  color: #f5b301;
  vertical-align: middle;
  transition: transform 0.2s ease;
}
.sp-dropdown-capsule.show .sp-dropdown-toggle.dropdown-toggle::after { transform: rotate(180deg); }

/* Light Mode Filter Hub WCAG AA Contrast */
.light-mode .sp-filter-pill,
.light-mode .sp-filter-count-badge {
  color: #92400e !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(180, 83, 9, 0.4) !important;
}
.light-mode .sp-filter-reset-btn { color: #b91c1c !important; background: rgba(239, 68, 68, 0.1) !important; border-color: rgba(185, 28, 28, 0.35) !important; }
.light-mode .sp-rail-label,
.light-mode .sp-filter-active-label,
.light-mode .sp-sort-btn { color: #475569 !important; }
.light-mode .sp-sort-btn.active { color: #92400e !important; background: rgba(245, 158, 11, 0.16) !important; border-color: rgba(180, 83, 9, 0.5) !important; }
.light-mode .sp-dropdown-toggle.dropdown-toggle::after { color: #d97706; }

/* CRITICAL Download & Subtitles Modal [S2-MOD-01] */
.serie-dialog {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(4, 7, 14, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2060 !important;
  padding: 12px !important;
}
.serie-dialog.is-active,
.serie-dialog[style*="display: block"] { display: flex !important; }
.serie-dialog > .login-box,
.serie-dialog .sp-modal-window {
  background: linear-gradient(145deg, #121824 0%, #0a0e17 100%) !important;
  border: 1px solid rgba(255, 214, 91, 0.28) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 214, 91, 0.1) !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: min(88vh, 680px) !important;
  max-height: min(88dvh, 680px) !important;
  width: calc(100% - 24px) !important;
  max-width: 680px !important;
  overflow: hidden !important;
  margin: auto !important;
}
.serie-dialog .notif-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  padding: 14px 18px !important;
  background: linear-gradient(180deg, rgba(28, 36, 52, 0.95), rgba(16, 22, 34, 0.95)) !important;
  border-bottom: 1px solid rgba(255, 214, 91, 0.18) !important;
}
.serie-dialog .notif-title {
  color: #ffd65b !important;
  font-size: 15.5px !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere !important;
}
.serie-dialog .notif-close {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 50% !important;
  width: 44px !important;
  height: 44px !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #cbd5e1 !important;
  font-size: 16px !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
}
.serie-dialog .notif-close:hover { background: rgba(239, 68, 68, 0.25) !important; border-color: rgba(239, 68, 68, 0.5) !important; color: #ef4444 !important; }
.serie-dialog .notif-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-height: none !important;
  padding: 16px !important;
}

/* Consolidated Download Hub Cards */
.sp-download-hub { display: flex !important; flex-direction: column !important; gap: 14px !important; }
.sp-dl-empty { text-align: center !important; padding: 32px 16px !important; }
.sp-dl-empty-icon { width: 54px !important; height: 54px !important; border-radius: 50% !important; background: rgba(255, 255, 255, 0.05) !important; color: #94a3b8 !important; display: flex !important; align-items: center !important; justify-content: center !important; font-size: 22px !important; margin: 0 auto 14px auto !important; }
.sp-dl-empty h4 { color: #ffd65b !important; font-size: 16px !important; font-weight: 700 !important; margin-bottom: 6px !important; }
.sp-dl-empty p { color: #94a3b8 !important; font-size: 13px !important; margin: 0 !important; }
.sp-dl-header-strip { display: flex !important; align-items: center !important; justify-content: space-between !important; flex-wrap: wrap !important; gap: 8px !important; padding-bottom: 4px !important; }
.sp-dl-count-badge { font-size: 12.5px !important; color: #cbd5e1 !important; font-weight: 600 !important; display: inline-flex !important; align-items: center !important; gap: 6px !important; }
.sp-dl-cdn-badge { font-size: 12px !important; color: #34d399 !important; font-weight: 700 !important; display: inline-flex !important; align-items: center !important; gap: 5px !important; background: rgba(16, 185, 129, 0.14) !important; border: 1px solid rgba(16, 185, 129, 0.3) !important; padding: 3px 8px !important; border-radius: 6px !important; }
.sp-dl-cards-list { display: flex !important; flex-direction: column !important; gap: 10px !important; }
.sp-dl-item-card { display: flex !important; align-items: center !important; justify-content: space-between !important; padding: 14px 16px !important; background: rgba(255, 255, 255, 0.04) !important; border: 1px solid rgba(255, 255, 255, 0.09) !important; border-radius: 14px !important; gap: 14px !important; transition: background-color 0.22s ease, border-color 0.22s ease, transform 0.22s ease !important; }
.sp-dl-item-card:hover { background: rgba(255, 214, 91, 0.06) !important; border-color: rgba(255, 214, 91, 0.32) !important; }
.sp-dl-item-main { display: flex !important; align-items: center !important; gap: 12px !important; flex: 1 !important; min-width: 0 !important; }
.sp-dl-quality-tag { background: linear-gradient(135deg, rgba(245, 179, 1, 0.22), rgba(245, 179, 1, 0.08)) !important; color: #ffd65b !important; border: 1px solid rgba(245, 179, 1, 0.4) !important; border-radius: 10px !important; padding: 7px 11px !important; font-size: 12.5px !important; font-weight: 850 !important; display: flex !important; align-items: center !important; gap: 6px !important; flex-shrink: 0 !important; }
.sp-dl-meta-info { display: flex !important; flex-direction: column !important; gap: 4px !important; min-width: 0 !important; }
.sp-dl-item-title { color: #ffffff !important; font-size: 15px !important; font-weight: 700 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.sp-dl-sub-meta { display: flex !important; align-items: center !important; gap: 10px !important; flex-wrap: wrap !important; }
.sp-dl-pill { font-size: 11.5px !important; color: #94a3b8 !important; display: inline-flex !important; align-items: center !important; gap: 4px !important; }
.sp-dl-size { color: #cbd5e1 !important; font-weight: 600 !important; }
.sp-dl-speed { color: #38bdf8 !important; }
.sp-dl-item-action { flex-shrink: 0 !important; }
.sp-dl-btn { display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 7px !important; min-height: 42px !important; padding: 9px 18px !important; border-radius: 10px !important; font-size: 13px !important; font-weight: 750 !important; text-decoration: none !important; cursor: pointer !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important; transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important; }
.sp-dl-btn-direct { background: linear-gradient(135deg, #10b981, #059669) !important; color: #ffffff !important; border: 1px solid rgba(16, 185, 129, 0.5) !important; }
.sp-dl-btn-vip { background: linear-gradient(135deg, #ffd65b, #f59e0b) !important; color: #0b0f19 !important; border: 1px solid rgba(255, 214, 91, 0.6) !important; }
.sp-dl-btn-upgrade { background: linear-gradient(135deg, #ef4444, #dc2626) !important; color: #ffffff !important; border: 1px solid rgba(239, 68, 68, 0.5) !important; }
.sp-dl-btn-reward { background: linear-gradient(135deg, #f59e0b, #d97706) !important; color: #0b0f19 !important; border: 1px solid rgba(245, 158, 11, 0.5) !important; }
.sp-dl-footer-notice { display: flex !important; align-items: center !important; gap: 8px !important; padding: 10px 14px !important; background: rgba(255, 255, 255, 0.04) !important; border-radius: 10px !important; color: #94a3b8 !important; font-size: 12px !important; line-height: 1.55 !important; }

/* Light Mode Download & Subtitles Modal WCAG AA Contrast */
.light-mode .serie-dialog > .login-box,
.light-mode .serie-dialog .sp-modal-window { background: #ffffff !important; border-color: rgba(180, 83, 9, 0.32) !important; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25) !important; }
.light-mode .serie-dialog .notif-head { background: #f8fafc !important; border-bottom-color: rgba(15, 23, 42, 0.08) !important; }
.light-mode .serie-dialog .notif-title,
.light-mode .sp-dl-empty h4,
.light-mode .sp-dl-quality-tag { color: #92400e !important; }
.light-mode .serie-dialog .notif-close { background: rgba(15, 23, 42, 0.06) !important; border-color: rgba(15, 23, 42, 0.12) !important; color: #334155 !important; }
.light-mode .sp-dl-item-card,
.light-mode .sp-glass-table tbody tr { background: #f8fafc !important; border-color: rgba(15, 23, 42, 0.1) !important; }
.light-mode .sp-dl-item-title,
.light-mode .sp-glass-table tbody td { color: #0f172a !important; }
.light-mode .sp-dl-count-badge,
.light-mode .sp-dl-size,
.light-mode .sp-dl-pill,
.light-mode .sp-dl-footer-notice { color: #475569 !important; }
.light-mode .sp-dl-cdn-badge { color: #065f46 !important; background: rgba(16, 185, 129, 0.12) !important; }

/* Rate Modal & Trailer Modal Mobile Fit */
.sp-rate-modal,
.sp-rate-modal-backdrop,
.sp-trailer-modal { z-index: 2060 !important; padding: 12px !important; }
.sp-rate-dialog { display: flex !important; flex-direction: column !important; max-height: calc(100vh - 24px) !important; max-height: calc(100dvh - 24px) !important; width: calc(100% - 24px) !important; }
.sp-rate-header { flex-shrink: 0 !important; padding: 16px 18px !important; }
.sp-rate-body { overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; flex: 1 1 auto !important; min-height: 0 !important; padding: 18px 16px !important; }
.sp-rate-close-btn,
.sp-trailer-close { width: 44px !important; height: 44px !important; flex-shrink: 0 !important; }
.sp-rate-dialog .input-review { font-size: 16px !important; }
.sp-trailer-dialog { display: flex !important; flex-direction: column !important; max-height: calc(100vh - 24px) !important; max-height: calc(100dvh - 24px) !important; }
.sp-trailer-stage { max-height: calc(100dvh - 130px) !important; width: 100% !important; }

/* Responsive Dropdowns, Download Cards, Subtitles Table & Channel Cards */
@media (max-width: 767.98px) {
  .sp-dropdown-capsule { width: 100% !important; display: block !important; }
  .sp-dropdown-toggle { width: 100% !important; justify-content: space-between !important; min-height: 44px !important; }
  .sp-dropdown-menu,
  .sp-dropdown-menu-luxury,
  .sp-dropdown-capsule .dropdown-menu { left: 0 !important; right: 0 !important; width: 100% !important; min-width: 0 !important; }
}

@media (max-width: 575.98px) {
  .shweplay-site .row.content-section { margin-left: 0 !important; margin-right: 0 !important; padding-left: 6px !important; padding-right: 6px !important; }
  .content-section.row > .sp-filter-hub { margin-inline: 0 !important; width: 100% !important; }
  .sp-dl-item-card { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
  .sp-dl-item-main { width: 100% !important; align-items: flex-start !important; }
  .sp-dl-meta-info { width: 100% !important; }
  .sp-dl-item-title { white-space: normal !important; overflow-wrap: anywhere !important; }
  .sp-dl-item-action,
  .sp-dl-action-zone,
  .sp-dl-btn { width: 100% !important; min-height: 44px !important; justify-content: center !important; }
  .subtitles-table .table-responsive { overflow-x: visible !important; }
  .subtitles-table .sp-glass-table,
  .subtitles-table .sp-glass-table tbody { display: block !important; width: 100% !important; }
  .subtitles-table .sp-glass-table thead { display: none !important; }
  .subtitles-table .sp-glass-table tbody tr { display: flex !important; flex-wrap: wrap !important; align-items: center !important; justify-content: space-between !important; gap: 8px !important; padding: 12px !important; margin-bottom: 10px !important; border-radius: 12px !important; }
  .subtitles-table .sp-glass-table tbody td { display: block !important; padding: 0 !important; text-align: left !important; width: auto !important; min-width: 0 !important; overflow-wrap: anywhere !important; }
  .subtitles-table .sp-glass-table tbody td:last-child { width: 100% !important; }
  .subtitles-table .sp-btn-gold-dl { width: 100% !important; min-height: 40px !important; justify-content: center !important; }
}

@media (max-width: 420px) {
  .sp-rate-stars-row { gap: 6px !important; }
  .sp-rate-stars-row label { width: 40px !important; height: 40px !important; font-size: 28px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; }
  .sp-rate-actions { flex-wrap: wrap !important; }
  .sp-rate-actions .btn,
  .sp-btn-cancel-modal { flex: 1 1 100% !important; }
}

@media (max-width: 380px) {
  .sp-match-body { grid-template-columns: 54px minmax(0, 1fr) 38px !important; gap: 10px !important; padding: 12px !important; min-height: 96px !important; }
  .sp-match-logo { height: 54px !important; padding: 6px !important; border-radius: 12px !important; }
  .sp-match-copy h2 { font-size: 0.92rem !important; overflow-wrap: anywhere !important; }
}
