/* ===== StreamBox - Modern Streaming Platform ===== */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-card: #1a1a1a;
  --bg-hover: #222;
  --text: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #808080;
  --accent: #e50914;
  --accent-hover: #f40612;
  --accent-soft: rgba(229, 9, 20, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-height: 68px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; border: none; cursor: pointer; background: none; }
ul { list-style: none; }

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
  transition: background 0.3s ease;
}

.navbar.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: white;
}

.logo-text span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-box input {
  background: rgba(255,255,255,0.08);
  border: 1px solid transparent;
  border-radius: 50px;
  padding: 9px 16px 9px 36px;
  color: var(--text);
  font-size: 0.9rem;
  width: 220px;
  transition: all var(--transition);
}

.search-box input:focus {
  outline: none;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  width: 280px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow);
  z-index: 100;
}

.search-results.show {
  display: block;
}

.search-result-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: background var(--transition);
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item img {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-result-item .info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.search-result-item .info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-btn img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}

.profile-btn:hover img {
  border-color: var(--accent);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 999;
}

.mobile-menu.show {
  display: flex;
}

.mobile-menu a {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.mobile-menu a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ===== Pages ===== */
.page {
  display: none;
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.page.active {
  display: block;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  height: 85vh;
  min-height: 520px;
  max-height: 800px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transition: opacity 0.6s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.6) 40%, transparent 70%),
              linear-gradient(to top, var(--bg) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 4% 80px;
  max-width: 600px;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-meta .dot {
  color: var(--text-muted);
}

.hero-meta .rating {
  color: #fbbf24;
}

.hero-meta .rating i {
  margin-right: 3px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, var(--bg), transparent);
  z-index: 1;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.btn-play {
  background: var(--text);
  color: #000;
}

.btn-play:hover {
  background: rgba(255,255,255,0.85);
  transform: scale(1.03);
}

.btn-info {
  background: rgba(109, 109, 110, 0.7);
  color: white;
  backdrop-filter: blur(8px);
}

.btn-info:hover {
  background: rgba(109, 109, 110, 0.5);
}

.btn-list {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-list:hover,
.btn-list.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-list.active i::before {
  content: "\f00c";
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
}

/* ===== Content Rows ===== */
.content-row {
  padding: 0 4% 32px;
  position: relative;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.row-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.see-all {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition);
}

.see-all:hover {
  color: var(--accent);
}

.row-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.row-slider::-webkit-scrollbar {
  display: none;
}

/* ===== Video Card ===== */
.video-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform var(--transition);
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.video-card:hover {
  transform: scale(1.06);
  z-index: 5;
}

.video-card .thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
}

.video-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.video-card .thumb .progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--accent);
  z-index: 2;
}

.video-card .thumb .play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity var(--transition);
}

.video-card:hover .thumb .play-icon {
  opacity: 1;
}

.video-card .thumb .play-icon i {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.95);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.video-card .card-info {
  padding: 10px 4px 0;
}

.video-card .card-info h3 {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.video-card .card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.video-card .card-meta .rating {
  color: #fbbf24;
}

.video-card .card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 3;
}

.video-card:hover .card-actions {
  opacity: 1;
}

.card-actions button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  backdrop-filter: blur(4px);
  transition: all var(--transition);
}

.card-actions button:hover,
.card-actions button.active {
  background: var(--accent);
}

/* Grid version of cards */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 0 4% 60px;
}

.video-grid .video-card {
  flex: none;
}

/* ===== Page Headers ===== */
.page-header {
  padding: 40px 4% 24px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ===== Categories ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 0 4% 60px;
}

.category-card {
  aspect-ratio: 16/10;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(0,0,0,0.4));
}

.category-card:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.category-card i {
  font-size: 2rem;
  position: relative;
  z-index: 1;
}

.category-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.category-card span {
  font-size: 0.8rem;
  opacity: 0.8;
  position: relative;
  z-index: 1;
}

/* ===== Empty State ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 24px;
}

/* ===== Profile ===== */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 4% 80px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}

.profile-info {
  flex: 1;
}

.profile-info h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-email {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.profile-plan {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-section {
  margin-bottom: 40px;
}

.profile-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.settings-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item:hover {
  background: var(--bg-hover);
}

.setting-item div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.setting-item i:first-child {
  width: 20px;
  color: var(--text-muted);
}

.setting-item.danger {
  color: var(--accent);
}

.setting-item.danger i:first-child {
  color: var(--accent);
}

/* ===== Modal / Player ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-size: 1.1rem;
  transition: background var(--transition);
}

.modal-close:hover {
  background: var(--accent);
}

.player-wrapper {
  position: relative;
  background: #000;
}

.player-container {
  position: relative;
  aspect-ratio: 16/9;
}

.player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  transition: opacity 0.3s;
}

.player-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.big-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform var(--transition);
}

.big-play:hover {
  transform: scale(1.1);
}

.modal-body {
  padding: 28px 32px 40px;
}

.modal-info h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.modal-meta .rating {
  color: #fbbf24;
}

.modal-meta .badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.modal-desc {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.modal-details {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.modal-details p {
  margin-bottom: 6px;
}

.modal-details strong {
  color: var(--text-secondary);
}

.modal-related h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.related-grid .video-card {
  flex: none;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.4);
}

.toast i {
  margin-right: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .video-card {
    flex: 0 0 200px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .search-box input {
    width: 160px;
  }

  .search-box input:focus {
    width: 180px;
  }

  .hero {
    height: 70vh;
    min-height: 420px;
  }

  .hero-content {
    padding-bottom: 50px;
  }

  .hero-actions .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .video-card {
    flex: 0 0 160px;
  }

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

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-info h2 {
    font-size: 1.4rem;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0 3%;
  }

  .content-row,
  .page-header,
  .video-grid,
  .categories-grid {
    padding-left: 3%;
    padding-right: 3%;
  }

  .hero-content {
    padding-left: 3%;
    padding-right: 3%;
  }

  .search-box {
    display: none;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .video-card {
    flex: 0 0 140px;
  }
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 32px 4% 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.site-footer strong {
  color: var(--text-secondary);
}
