/* =============================================
   MNR-Video — Premium Dark Theme
   ============================================= */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --bg-card-hover: #22223a;
  --accent-1: #7c3aed;
  --accent-2: #db2777;
  --accent-grad: linear-gradient(135deg, #7c3aed, #db2777);
  --accent-grad-2: linear-gradient(135deg, #6d28d9, #be185d);
  --text-primary: #f0f0f8;
  --text-secondary: #9090b0;
  --text-muted: #5a5a7a;
  --border: rgba(255, 255, 255, 0.07);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.3);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --header-h: 68px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Source Selector Buttons */
.dynamic-source-buttons {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-source {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-source:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-source.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-1);
  border-radius: 99px;
}

/* =============================================
   HEADER
   ============================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
}

.logo-img {
  height: 35px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  display: block;
  transition: transform var(--transition), filter var(--transition);
}

.logo:hover .logo-img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.4));
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-grad);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.logo:hover .logo-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.5);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* Search Form */
.search-form {
  flex: 1;
  max-width: 540px;
  display: flex;
  gap: 0;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: 10px 16px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.search-input:focus {
  border-color: var(--accent-1);
  background: rgba(124, 58, 237, 0.05);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  background: var(--accent-grad);
  border: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 10px 18px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition), transform var(--transition);
}

.search-btn:hover {
  opacity: 0.88;
  transform: scale(0.98);
}

.search-btn:active {
  transform: scale(0.95);
}

/* Source Switcher Pills */
.source-pills {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.source-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.source-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.source-pill.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.source-pill .pill-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.source-pill.active .pill-dot {
  background: #fff;
}

.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 40px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-daftar {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border: none;
  box-shadow: var(--shadow-glow);
}

.btn-daftar:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
  filter: brightness(1.1);
}

.btn-promo {
  background: var(--glass);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-promo:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-1);
  transform: translateY(-2px);
}

.btn-icon {
  width: 40px;
  height: 40px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--accent-1);
  background: rgba(124, 58, 237, 0.1);
}

/* =============================================
   SETTINGS PANEL
   ============================================= */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.settings-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 340px;
  max-width: 92vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--glass-border);
  z-index: 1200;
  padding: 32px 24px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
}

.settings-panel.active {
  transform: translateX(0);
}

.settings-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text-primary);
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.setting-row label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.setting-row input {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

.setting-row input:focus {
  border-color: var(--accent-1);
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-save,
.btn-cancel {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-save {
  background: var(--accent-grad);
  color: #fff;
}

.btn-save:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-cancel {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.btn-cancel:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.settings-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--accent-1);
  min-height: 18px;
  text-align: center;
}

/* =============================================
   MAIN
   ============================================= */
.main {
  padding-top: var(--header-h);
}

/* ---- Slider ---- */
.slider-container {
  position: relative;
  width: calc(100% - 48px);
  max-width: 1352px;
  margin: 30px auto 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  aspect-ratio: 1920 / 480;
  /* Standard banner desktop aspect ratio */
  background: var(--bg-card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
}

.slider-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
}

.slide img,
.slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* Fallback for when there are no images */
.slide-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(219, 39, 119, 0.15) 100%);
  color: var(--text-primary);
  text-align: center;
  padding: 24px;
}

.slide-fallback-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: pulse 2s infinite;
}

.slide-fallback-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.slide-fallback-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Slider Controls */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(10, 10, 15, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}

.slider-btn:hover {
  background: var(--accent-grad);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-glow);
}

.slider-btn-prev {
  left: 20px;
}

.slider-btn-next {
  right: 20px;
}

.slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all var(--transition);
}

.slider-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent-1);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* ---- Content Section ---- */
.content-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-badge {
  background: var(--accent-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.5px;
  display: none;
}

.section-badge.show {
  display: inline-block;
}

/* ---- Grid ---- */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ---- Video Card ---- */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  animation: fadeUp 0.4s ease both;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(124, 58, 237, 0.3);
  border-color: rgba(124, 58, 237, 0.4);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  overflow: hidden;
}

.card-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.video-card:hover .card-thumb-wrap img {
  transform: scale(1.07);
}

.card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}

.card-premium-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: 0.5px;
}

.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.video-card:hover .card-play-overlay {
  background: rgba(0, 0, 0, 0.35);
}

.play-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--transition), transform var(--transition);
  backdrop-filter: blur(8px);
}

.play-icon svg {
  width: 22px;
  height: 22px;
  color: #fff;
  display: block;
  margin-left: 3px;
  /* Compensate visual weight of triangle pointing right */
}

.video-card:hover .play-icon {
  opacity: 1;
  transform: scale(1);
}

.card-body {
  padding: 14px 16px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  transition: color var(--transition);
}

.video-card:hover .card-title {
  color: #c4b5fd;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.card-meta .dot {
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
}

/* ---- Skeleton ---- */
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.skel-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skel-line {
  height: 12px;
  margin: 14px 16px 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skel-line.skel-lg {
  width: 85%;
}

.skel-line.skel-sm {
  width: 45%;
  margin-top: 0;
  margin-bottom: 16px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ---- States ---- */
.error-state,
.empty-state {
  text-align: center;
  padding: 80px 24px;
  grid-column: 1/-1;
}

.error-icon,
.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  line-height: 1;
}

.error-state h3,
.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.error-state p,
.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

.btn-retry {
  margin-top: 20px;
  padding: 10px 24px;
  background: var(--accent-grad);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-retry:hover {
  opacity: 0.85;
}

/* Keyword Suggestions */
.keyword-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  max-width: 500px;
}

.suggestion-btn {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.suggestion-btn:hover {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  transform: translateY(-1px);
}

/* ---- Pagination ---- */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-btn {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--accent-1);
  background: rgba(124, 58, 237, 0.1);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-info {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 90px;
  text-align: center;
}

/* =============================================
   MODAL — Video Player
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(124, 58, 237, 0.2);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.modal-close:hover {
  color: #fff;
  background: #e11d48;
  border-color: #e11d48;
}

.modal-body {
  padding: 28px;
}

/* Video Player */
.modal-player-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  margin-bottom: 20px;
  aspect-ratio: 16/9;
}

.modal-player-wrap video,
.modal-player-wrap iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

/* Tap-to-Play overlay */
.tap-to-play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  z-index: 10;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.tap-to-play:hover {
  background: rgba(0, 0, 0, 0.35);
}

.tap-to-play>div {
  animation: pulse-play 1.8s ease-in-out infinite;
}

@keyframes pulse-play {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0);
  }
}

.modal-title-bar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-video-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  flex: 1;
}

.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.modal-meta-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.modal-meta-item .meta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.modal-meta-item .meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn-modal-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all var(--transition);
}

.btn-modal-primary {
  background: var(--accent-grad);
  color: #fff;
}

.btn-modal-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-modal-secondary {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-modal-secondary:hover {
  color: var(--text-primary);
  border-color: var(--accent-1);
}

/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .logo-text {
    display: none;
  }

  .btn-header {
    padding: 0 10px;
    height: 36px;
    font-size: 12px;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
  }

  .header-inner {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
    height: auto;
  }

  .logo {
    order: 1;
  }

  .header-actions {
    order: 2;
    margin-left: auto;
  }

  .source-pills {
    order: 3;
    width: 100%;
    display: flex;
  }

  .source-pill {
    flex: 1;
    justify-content: center;
  }

  .search-form {
    order: 4;
    width: 100%;
    max-width: none;
  }

  .main {
    padding-top: 150px;
  }

  .slider-container {
    aspect-ratio: 16 / 9;
    /* Standard banner mobile aspect ratio */
    margin: 25px auto 0;
    width: calc(100% - 32px);
    border-radius: var(--radius-lg);
  }

  .slider-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .slider-btn-prev {
    left: 10px;
  }

  .slider-btn-next {
    right: 10px;
  }

  .slider-dots {
    bottom: 12px;
  }

  .content-section {
    padding: 24px 16px 60px;
  }

  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    transform: translateY(100%);
  }

  .modal-overlay.active .modal {
    transform: translateY(0);
  }

  .modal-close {
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-player-wrap {
    margin: -16px -16px 16px -16px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-actions {
    flex-direction: column;
  }

  .btn-modal-action {
    width: 100%;
    justify-content: center;
  }
}

/* Source Selector Buttons */
.dynamic-source-buttons {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-source {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-source:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-source.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Related Videos Section in Modal */
.modal-related-section {
  margin-top: 24px;
  border-top: 1px solid var(--glass-border);
  padding-top: 20px;
}

.modal-related-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .modal-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.related-card {
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.related-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.related-thumb-wrap {
  width: 100px;
  height: 60px;
  flex-shrink: 0;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

.related-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-card:hover .related-thumb-wrap img {
  transform: scale(1.05);
}

.related-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 600;
}

.related-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  /* allows text truncation */
  flex-grow: 1;
}

.related-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-card:hover .related-title {
  color: var(--text-primary);
}

.no-related {
  grid-column: span 2;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 15px 0;
}

.spinner-small {
  grid-column: span 2;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

/* Watch Section (Non-Modal Watch Page) */
.watch-section {
  width: calc(100% - 48px);
  max-width: 1352px;
  margin: 30px auto 40px;
}

@media (max-width: 768px) {
  .watch-section {
    width: calc(100% - 32px);
    margin: 25px auto 30px;
  }
}

.watch-back-bar {
  margin-bottom: 20px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-1);
  color: var(--text-primary);
  transform: translateX(-3px);
}

.btn-back svg {
  transition: transform 0.2s ease;
}

.btn-back:hover svg {
  transform: translateX(-2px);
}

.watch-content-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
  .watch-content-wrapper {
    padding: 16px;
    border-radius: var(--radius-md);
  }
}

.watch-related-section {
  border-top: 1px solid var(--glass-border);
  padding-top: 24px;
}

.watch-related-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.watch-related-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.watch-related-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.related-pill {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 30px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.related-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-1);
  color: var(--text-primary);
}

.related-pill.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

@media (max-width: 640px) {
  .watch-related-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .watch-related-title {
    font-size: 17px;
  }
}

/* Metadata Icon Styling (Lock/Unlock) */
.icon-meta {
  width: 13px;
  height: 13px;
  display: inline-block;
  vertical-align: -2.5px;
  margin-right: 4px;
  stroke: currentColor;
}

/* Inline Emojis Replacement Style */
.icon-inline {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.15em;
  margin-right: 6px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* Error/Empty Large Icons */
.error-icon svg,
.empty-icon svg {
  width: 56px;
  height: 56px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  display: inline-block;
  vertical-align: middle;
}

/* Slider Mute/Unmute Button Styling */
.slider-mute-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider-mute-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.08);
  border-color: var(--accent-1);
}

.slider-mute-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Adjust for mobile screens */
@media (max-width: 768px) {
  .slider-mute-btn {
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .slider-mute-btn svg {
    width: 16px;
    height: 16px;
  }
}