@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(26, 10, 46, 0.6);
  --bg-card-solid: #1a0a2e;
  --bg-sidebar: rgba(15, 5, 30, 0.95);
  --bg-navbar: rgba(10, 10, 15, 0.9);
  --purple-primary: #8b5cf6;
  --purple-light: #a855f7;
  --purple-dark: #2d1b4e;
  --purple-glow: #7c3aed;
  --purple-neon: #c084fc;
  --text-primary: #f0e6ff;
  --text-secondary: #a78bfa;
  --text-muted: #7c7c9a;
  --border-color: rgba(139, 92, 246, 0.15);
  --glass-bg: rgba(26, 10, 46, 0.4);
  --glass-border: rgba(139, 92, 246, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--purple-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-primary); }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1050;
  transition: transform 0.3s ease;
}

.sidebar-header {
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  color: #fff !important;
}

.sidebar-logo i {
  color: var(--purple-primary);
}

.sidebar-nav .nav-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.sidebar-nav .nav-item:hover {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-neon);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 250px;
  transition: margin-left 0.3s ease;
}

/* ===== TOP NAVBAR ===== */
.top-navbar {
  background: var(--bg-navbar);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1030;
}

.search-input {
  background: rgba(45, 27, 78, 0.5) !important;
  border: 1px solid var(--glass-border) !important;
  border-right: none !important;
  color: #fff !important;
  border-radius: 20px 0 0 20px !important;
  padding: 8px 16px !important;
}

.search-input:focus {
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3) !important;
  border-color: var(--purple-primary) !important;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  background: var(--purple-primary) !important;
  border: 1px solid var(--purple-primary) !important;
  color: #fff !important;
  border-radius: 0 20px 20px 0 !important;
  padding: 8px 18px !important;
}

.search-btn:hover {
  background: var(--purple-light) !important;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* ===== CATEGORY BAR ===== */
.category-bar::-webkit-scrollbar { display: none; }
.category-bar { scrollbar-width: none; }

.cat-pill {
  white-space: nowrap;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(45, 27, 78, 0.4);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.cat-pill:hover {
  background: rgba(139, 92, 246, 0.2);
  color: var(--purple-neon);
  border-color: var(--glass-border);
}

.cat-pill.active {
  background: var(--purple-primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* ===== AD BANNER ===== */
.ad-banner {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.ad-banner-hero {
  background: linear-gradient(135deg, rgba(45, 27, 78, 0.6), rgba(139, 92, 246, 0.1));
  backdrop-filter: blur(10px);
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ===== FEATURED / PINNED VIDEO ===== */
.featured-video {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.featured-video:hover {
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
  border-color: var(--purple-primary);
}

.featured-thumb {
  position: relative;
  aspect-ratio: 16/7;
  overflow: hidden;
}

.featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-video:hover .featured-thumb img {
  transform: scale(1.03);
}

.featured-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: rgba(139, 92, 246, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
  transition: all 0.3s ease;
}

.featured-video:hover .featured-play-btn {
  background: var(--purple-primary);
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.7);
  transform: translate(-50%, -50%) scale(1.1);
}

.featured-play-btn i {
  color: #fff;
  font-size: 1.8rem;
  margin-left: 4px;
}

.featured-info {
  padding: 20px 24px;
}

.featured-info h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.featured-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== VIDEO CARD ===== */
.video-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s ease;
}

.video-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
  border-color: var(--purple-primary);
}

.video-card .thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #111;
}

.video-card .thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.video-card:hover .thumb-wrap img {
  transform: scale(1.08);
}

.video-card .thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .thumb-overlay {
  opacity: 1;
}

.thumb-overlay i {
  color: #fff;
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.8));
}

.video-card .card-body {
  padding: 12px;
}

.video-card .video-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.video-card .video-stats {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -13px;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--purple-primary), var(--purple-neon));
  border-radius: 2px;
}

.more-btn {
  padding: 6px 14px;
  background: var(--purple-primary);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.more-btn:hover {
  background: var(--purple-light);
  color: #fff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* ===== WATCH PAGE ===== */
.video-player-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.15);
}

.video-player-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 1rem;
  flex-direction: column;
  gap: 10px;
}

.video-error i {
  font-size: 3rem;
  color: var(--purple-primary);
}

.download-btn {
  display: inline-block;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--purple-primary), var(--purple-light));
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.download-btn:hover {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.genre-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-neon);
  border-radius: 20px;
  font-size: 0.75rem;
  text-decoration: none;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--glass-border);
  transition: all 0.2s ease;
}

.genre-tag:hover {
  background: var(--purple-primary);
  color: #fff;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
  background: rgba(45, 27, 78, 0.4);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 8px !important;
  margin: 0 3px;
  transition: all 0.2s ease;
}

.pagination .page-link:hover {
  background: rgba(139, 92, 246, 0.3);
  color: #fff;
  border-color: var(--purple-primary);
}

.pagination .page-item.active .page-link {
  background: var(--purple-primary);
  border-color: var(--purple-primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.pagination .page-item.disabled .page-link {
  background: rgba(20, 10, 35, 0.5);
  color: var(--text-muted);
  border-color: transparent;
}

/* ===== GENRE LIST ===== */
.genre-list-btn {
  padding: 10px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
}

.genre-list-btn:hover {
  background: var(--purple-primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

/* ===== LOADING ===== */
.spinner-border.text-purple {
  color: var(--purple-primary) !important;
}

/* ===== OVERLAY ===== */
.screen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1040;
  backdrop-filter: blur(3px);
}

.screen-overlay.active {
  display: block;
}

/* ===== RESPONSIVE ===== */

/* Tablet & below: hide sidebar, full width content */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .content-area {
    padding: 12px !important;
  }

  .search-form {
    max-width: 100% !important;
  }
}

/* Mobile: compact everything */
@media (max-width: 767.98px) {
  .top-navbar {
    padding: 8px 10px !important;
    gap: 8px !important;
  }

  .search-input {
    padding: 6px 12px !important;
    font-size: 0.8rem;
  }

  .search-btn {
    padding: 6px 12px !important;
  }

  .content-area {
    padding: 8px !important;
  }

  .category-bar {
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
  }

  .cat-pill {
    padding: 5px 12px;
    font-size: 0.72rem;
  }

  /* Featured video */
  .featured-video {
    margin-bottom: 1rem;
    border-radius: 10px;
  }

  .featured-thumb {
    aspect-ratio: 16/9;
  }

  .featured-info {
    padding: 12px 14px;
  }

  .featured-info h2 {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }

  .featured-info p {
    font-size: 0.75rem;
  }

  .featured-play-btn {
    width: 44px;
    height: 44px;
  }

  .featured-play-btn i {
    font-size: 1.1rem;
  }

  /* Video cards */
  .video-card {
    border-radius: 8px;
  }

  .video-card .card-body {
    padding: 8px 10px;
  }

  .video-card .video-title {
    font-size: 0.72rem;
    -webkit-line-clamp: 2;
    margin-bottom: 4px;
  }

  .video-card .video-stats {
    font-size: 0.62rem;
  }

  /* Section headers */
  .section-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .section-title {
    font-size: 0.85rem;
  }

  .more-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  /* Ad banners */
  .ad-banner {
    padding: 12px;
    font-size: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 8px;
  }

  .ad-banner-hero {
    padding: 14px;
    font-size: 0.78rem;
    margin-bottom: 1rem;
    border-radius: 8px;
  }

  /* Watch page */
  .video-player-wrap {
    border-radius: 8px;
    margin-bottom: 12px;
  }

  .download-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
  }

  .genre-tag {
    padding: 3px 8px;
    font-size: 0.68rem;
  }

  /* Pagination */
  .pagination .page-link {
    padding: 6px 10px;
    font-size: 0.75rem;
    margin: 0 2px;
  }

  /* Genre list */
  .genre-list-btn {
    padding: 8px 14px;
    font-size: 0.78rem;
  }

  /* Grid spacing */
  .row {
    --bs-gutter-x: 0.5rem;
  }

  .col-6 {
    padding-left: 4px;
    padding-right: 4px;
  }

  .mb-3 {
    margin-bottom: 0.5rem !important;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .top-navbar .sidebar-logo span {
    display: none;
  }

  .search-input {
    font-size: 0.75rem;
    padding: 5px 10px !important;
  }

  .cat-pill {
    padding: 4px 10px;
    font-size: 0.68rem;
  }

  .video-card .video-title {
    font-size: 0.68rem;
  }

  .video-card .video-stats {
    font-size: 0.58rem;
  }

  .featured-info h2 {
    font-size: 0.82rem;
  }

  .pagination .page-link {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}
