/* ===== MEDIA & ENTERTAINMENT STYLES ===== */

.media-tab-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 6px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
  overflow-x: auto;
}

.media-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  touch-action: manipulation;
}

.media-tab-btn:active {
  cursor: grabbing;
}

.media-tab-btn.dragging {
  opacity: 0.45;
  transform: scale(0.95);
  border: 1px dashed var(--accent);
}

.media-tab-btn.drag-over {
  border: 1px solid #F3B200 !important;
  box-shadow: 0 0 12px rgba(243, 178, 0, 0.4);
  transform: translateY(-2px);
}

.media-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.media-tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 4px 18px var(--accent-glow);
}

/* Sub View Switcher (Movies & TV Shows) */
.sub-view-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  width: fit-content;
}

.sub-view-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sub-view-btn:hover {
  color: var(--text-primary);
}

.sub-view-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* Cards Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.media-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

.media-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-movie {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-tv {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-game {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-trivia {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-news {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-sports {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-tech {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.trivia-fact-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
  border: 1px dashed rgba(245, 158, 11, 0.3);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.news-source {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

/* ===== LIGHT THEME OVERRIDES ===== */
[data-theme="light"] .media-tab-bar,
html[data-theme="light"] .media-tab-bar,
body.light-theme .media-tab-bar,
html.light-theme .media-tab-bar {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.media-tab-btn.active,
[data-theme="light"] .media-tab-btn.active,
html[data-theme="light"] .media-tab-btn.active,
body.light-theme .media-tab-btn.active,
html.light-theme .media-tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px var(--accent-glow) !important;
}

[data-theme="light"] .sub-view-bar,
html[data-theme="light"] .sub-view-bar,
body.light-theme .sub-view-bar,
html.light-theme .sub-view-bar {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .sub-view-btn,
html[data-theme="light"] .sub-view-btn,
body.light-theme .sub-view-btn,
html.light-theme .sub-view-btn {
  color: #475569;
}

[data-theme="light"] .sub-view-btn:hover,
html[data-theme="light"] .sub-view-btn:hover,
body.light-theme .sub-view-btn:hover,
html.light-theme .sub-view-btn:hover {
  color: #0f172a;
}

.sub-view-btn.active,
[data-theme="light"] .sub-view-btn.active,
html[data-theme="light"] .sub-view-btn.active,
body.light-theme .sub-view-btn.active,
html.light-theme .sub-view-btn.active {
  background: var(--accent) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px var(--accent-glow) !important;
}

[data-theme="light"] .media-card,
html[data-theme="light"] .media-card,
body.light-theme .media-card,
html.light-theme .media-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .media-card:hover,
html[data-theme="light"] .media-card:hover,
body.light-theme .media-card:hover,
html.light-theme .media-card:hover {
  border-color: rgba(108, 99, 255, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .badge-movie,
html[data-theme="light"] .badge-movie,
body.light-theme .badge-movie,
html.light-theme .badge-movie {
  background: rgba(236, 72, 153, 0.15);
  color: #be185d;
  border-color: rgba(236, 72, 153, 0.35);
}

[data-theme="light"] .badge-tv,
html[data-theme="light"] .badge-tv,
body.light-theme .badge-tv,
html.light-theme .badge-tv {
  background: rgba(168, 85, 247, 0.15);
  color: #6b21a8;
  border-color: rgba(168, 85, 247, 0.35);
}

[data-theme="light"] .badge-game,
html[data-theme="light"] .badge-game,
body.light-theme .badge-game,
html.light-theme .badge-game {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="light"] .badge-trivia,
html[data-theme="light"] .badge-trivia,
body.light-theme .badge-trivia,
html.light-theme .badge-trivia {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .badge-news,
html[data-theme="light"] .badge-news,
body.light-theme .badge-news,
html.light-theme .badge-news {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .badge-sports,
html[data-theme="light"] .badge-sports,
body.light-theme .badge-sports,
html.light-theme .badge-sports {
  background: rgba(243, 178, 0, 0.18);
  color: #92400e;
  border-color: rgba(243, 178, 0, 0.4);
}

[data-theme="light"] .badge-tech,
html[data-theme="light"] .badge-tech,
body.light-theme .badge-tech,
html.light-theme .badge-tech {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="light"] .trivia-fact-box,
html[data-theme="light"] .trivia-fact-box,
body.light-theme .trivia-fact-box,
html.light-theme .trivia-fact-box {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.3);
  color: #1e293b;
}

/* ===== YOUTUBE CINEMA PLAYER & VIDEO GRID ===== */
.youtube-player-section {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.4s ease;
}

.youtube-player-section::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.youtube-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.youtube-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.youtube-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  flex-shrink: 0;
}

.youtube-main-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.youtube-main-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.youtube-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.youtube-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.youtube-quick-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  transform: translateY(-2px);
}

.youtube-quick-btn.primary {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.youtube-quick-btn.primary:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.youtube-frame-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.youtube-frame-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.youtube-player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.youtube-video-info-box {
  flex: 1;
  min-width: 260px;
}

.youtube-video-info-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.youtube-video-info-channel {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* YouTube Video Card in Grid */
.youtube-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.youtube-card:hover {
  transform: translateY(-4px);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.15);
}

.youtube-card.active-playing {
  border: 2px solid #ef4444;
  background: rgba(239, 68, 68, 0.04);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.youtube-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  margin-bottom: 12px;
}

.youtube-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.youtube-card:hover .youtube-card-thumb {
  transform: scale(1.05);
}

.youtube-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease;
}

.youtube-card:hover .youtube-play-overlay {
  background: rgba(0, 0, 0, 0.15);
}

.youtube-play-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.youtube-card:hover .youtube-play-icon {
  transform: scale(1.15);
  background: #ef4444;
}

.youtube-playing-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(239, 68, 68, 0.95);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.youtube-card-category-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.youtube-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.youtube-card-channel {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* Light Theme Overrides for YouTube */
[data-theme="light"] .youtube-player-section,
html[data-theme="light"] .youtube-player-section,
body.light-theme .youtube-player-section {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .youtube-card,
html[data-theme="light"] .youtube-card,
body.light-theme .youtube-card {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .youtube-card:hover,
html[data-theme="light"] .youtube-card:hover,
body.light-theme .youtube-card:hover {
  background: #ffffff;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

/* YouTube Card Delete Button */
.yt-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  line-height: 1;
}

.yt-delete-btn:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.yt-delete-btn:active {
  transform: translateY(0) scale(0.98);
}

[data-theme="light"] .yt-delete-btn,
html[data-theme="light"] .yt-delete-btn,
body.light-theme .yt-delete-btn {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
}

[data-theme="light"] .yt-delete-btn:hover,
html[data-theme="light"] .yt-delete-btn:hover,
body.light-theme .yt-delete-btn:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border-color: #ef4444;
}

/* ===== MEDIA PAGE RESPONSIVE ===== */
@media (max-width: 768px) {
  .media-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px;
    gap: 6px;
    margin-bottom: 18px;
  }
  .media-tab-bar::-webkit-scrollbar {
    display: none;
  }
  .media-tab-btn {
    padding: 8px 14px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .sub-view-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    margin-bottom: 16px;
  }
  .sub-view-bar::-webkit-scrollbar {
    display: none;
  }
  .sub-view-btn {
    padding: 6px 12px;
    font-size: 11.5px;
    flex-shrink: 0;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  .youtube-player-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .youtube-actions {
    width: 100%;
    justify-content: stretch;
  }
  .youtube-quick-btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 8px 12px;
  }
  .youtube-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .media-card-body {
    padding: 10px;
  }
  .media-card-title {
    font-size: 13px;
  }
  .media-tab-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .media-grid {
    grid-template-columns: 1fr;
  }
}




