/* ============ RESET & BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ HEADER ============ */
.header {
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 0;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 32px;
}

.header-search {
  flex: 1;
  max-width: 500px;
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 50px;
  padding: 8px 15px;
  transition: all 0.3s;
}

.header-search:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ff6b00;
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.2);
}

#searchBox {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  outline: none;
  font-size: 14px;
}

#searchBox::placeholder {
  color: #666;
}

.search-btn {
  background: none;
  border: none;
  color: #ff6b00;
  font-size: 18px;
  cursor: pointer;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* Navbar */
.navbar {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-behavior: smooth;
}

.navbar::-webkit-scrollbar {
  height: 4px;
}

.navbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.navbar::-webkit-scrollbar-thumb {
  background: #ff6b00;
  border-radius: 10px;
}

.nav-item {
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: #999;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ff6b00;
}

.nav-item.active {
  background: #ff6b00;
  color: #fff;
  border-color: #ff6b00;
}

/* ============ LAYOUT ============ */
body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}

.header {
  grid-column: 1;
}

.main-content {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
  margin-top: 30px;
  padding-bottom: 50px;
  grid-column: 1;
}

.main-content .container {
  width: 100%;
}

.main-content > .sidebar {
  display: block;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 10px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  grid-column: 1;
}

.sidebar-header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff;
}

.filter-group {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #222;
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-group h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ff6b00;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #999;
  transition: color 0.2s;
}

.filter-item input {
  cursor: pointer;
  accent-color: #ff6b00;
}

.filter-item:hover {
  color: #fff;
}

.filter-select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:hover {
  border-color: #ff6b00;
}

.filter-select:focus {
  outline: none;
  border-color: #ff6b00;
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.2);
}

.clear-filters {
  width: 100%;
  padding: 10px;
  background: #ff6b00;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.clear-filters:hover {
  background: #ff8a00;
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.3);
}

/* ============ HERO SECTION ============ */
.hero-section {
  margin-bottom: 50px;
}

.hero-content {
  background: linear-gradient(135deg, #ff6b00 0%, #ff8a00 100%);
  border-radius: 15px;
  padding: 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero-text {
  position: relative;
  z-index: 2;
  max-width: 60%;
}

.hero-text h1 {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 10px;
}

.hero-text p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 20px;
}

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

.hero-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 13px;
}

.hero-btn.primary {
  background: #fff;
  color: #ff6b00;
}

.hero-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.hero-btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid #fff;
}

.hero-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hero-icon {
  position: relative;
  z-index: 2;
  font-size: 80px;
}

/* ============ FEATURED SECTION ============ */
.featured-section {
  margin-bottom: 60px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.view-controls {
  display: flex;
  gap: 8px;
}

.view-btn {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  color: #999;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 13px;
}

.view-btn:hover {
  border-color: #ff6b00;
  color: #ff6b00;
}

.view-btn.active {
  background: #ff6b00;
  border-color: #ff6b00;
  color: #fff;
}

/* ============ MOVIES GRID ============ */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}

.movie-card {
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  group: card;
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: #ff6b00;
  box-shadow: 0 10px 30px rgba(255, 107, 0, 0.2);
}

.movie-poster {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #333 0%, #222 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 48px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.3);
}

.movie-poster-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: all 0.3s;
}

.movie-card:hover .movie-poster-overlay {
  opacity: 1;
}

.play-btn {
  width: 50px;
  height: 50px;
  background: #ff6b00;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.play-btn:hover {
  background: #ff8a00;
  transform: scale(1.1);
}

.quality-badge {
  background: #ff6b00;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.movie-info {
  padding: 12px;
}

.movie-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  margin-bottom: 8px;
}

.movie-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffc107;
  font-size: 12px;
  font-weight: 600;
}

.movie-download {
  display: flex;
  gap: 4px;
}

.download-btn {
  flex: 1;
  padding: 6px 8px;
  background: #ff6b00;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

.download-btn:hover {
  background: #ff8a00;
}

.download-btn.secondary {
  background: rgba(255, 107, 0, 0.2);
  border: 1px solid #ff6b00;
  color: #ff6b00;
}

.download-btn.secondary:hover {
  background: rgba(255, 107, 0, 0.3);
}

/* ============ LIST VIEW ============ */
.movies-grid.list-view {
  grid-template-columns: 1fr;
}

.movies-grid.list-view .movie-card {
  display: flex;
  height: auto;
}

.movies-grid.list-view .movie-poster {
  width: 120px;
  height: 180px;
  flex-shrink: 0;
}

.movies-grid.list-view .movie-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ============ MODAL ============ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  overflow-y: auto;
  padding: 20px;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #1a1a1a;
  border-radius: 15px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 35px;
  height: 35px;
  background: #ff6b00;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.modal-close:hover {
  background: #ff8a00;
  transform: scale(1.1);
}

.detail-poster {
  width: 100%;
  height: 350px;
  background: linear-gradient(135deg, #333 0%, #222 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  color: rgba(255, 255, 255, 0.2);
  position: relative;
}

.detail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(26,26,26,1));
}

.detail-body {
  padding: 30px;
  position: relative;
  z-index: 2;
}

.detail-title {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 12px;
  color: #fff;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #999;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.detail-desc {
  color: #ccc;
  line-height: 1.8;
  margin-bottom: 20px;
  font-size: 14px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.action-btn.primary {
  background: #ff6b00;
  color: #fff;
}

.action-btn.primary:hover {
  background: #ff8a00;
  box-shadow: 0 5px 15px rgba(255, 107, 0, 0.3);
}

.action-btn.secondary {
  background: rgba(255, 107, 0, 0.2);
  color: #ff6b00;
  border: 1px solid #ff6b00;
}

.action-btn.secondary:hover {
  background: rgba(255, 107, 0, 0.3);
}

.download-links {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.download-links h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 15px;
  color: #ff6b00;
}

.link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  margin-bottom: 10px;
  border: 1px solid #222;
}

.link-quality {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.link-size {
  font-size: 11px;
  color: #666;
}

.link-btn {
  padding: 6px 15px;
  background: #ff6b00;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.link-btn:hover {
  background: #ff8a00;
}

/* ============ SEARCH MODAL ============ */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.9);
  overflow-y: auto;
  padding: 80px 20px 20px;
}

.search-modal.active {
  display: block;
}

.search-results {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #ff6b00;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-results h3 {
  color: #fff;
  margin-bottom: 20px;
  font-size: 18px;
}

#searchResultsList {
  display: grid;
  gap: 10px;
}

.search-item {
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 15px;
  cursor: pointer;
  transition: all 0.3s;
}

.search-item:hover {
  border-color: #ff6b00;
  background: rgba(255, 107, 0, 0.05);
}

.search-poster {
  width: 60px;
  height: 90px;
  background: linear-gradient(135deg, #333 0%, #222 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.search-info h4 {
  color: #fff;
  font-size: 14px;
  margin-bottom: 4px;
}

.search-info p {
  color: #666;
  font-size: 12px;
}

/* ============ MOBILE MENU ============ */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.95);
}

.mobile-menu.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
}

.mobile-menu-content {
  background: #1a1a1a;
  width: 90%;
  max-width: 300px;
  border-radius: 10px;
  padding: 20px;
  position: relative;
}

.mobile-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background: #ff6b00;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.mobile-menu-content h3 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 16px;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-item {
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: #999;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.mobile-item:hover {
  background: rgba(255, 107, 0, 0.1);
  color: #ff6b00;
  border-color: #ff6b00;
}

.mobile-item.active {
  background: #ff6b00;
  color: #fff;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-search {
    max-width: 200px;
  }

  .logo span:last-child {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .navbar {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    margin-top: 20px;
  }

  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    min-height: 200px;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-icon {
    font-size: 60px;
  }

  .section-header {
    flex-direction: column;
    gap: 15px;
  }

  .modal-content {
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .header-top {
    gap: 10px;
  }

  .header-search {
    max-width: 120px;
  }

  .header-search input {
    font-size: 12px;
  }

  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .movie-card {
    border-radius: 8px;
  }

  .section-title {
    font-size: 16px;
  }

  .hero-content {
    padding: 20px;
  }

  .hero-text h1 {
    font-size: 18px;
  }

  .detail-title {
    font-size: 20px;
  }
}
