/* Main Grid Container */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
  padding: 15px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    padding: 8px;
  }
}

/* Movie Box */
.box {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.box a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.box:hover img {
  transform: scale(1.05);
}

/* Info Panel */
.info-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
  color: white;
  z-index: 2;
  pointer-events: none;
  transition: all 0.3s ease;
  transform: translateY(0);
}

.box:hover .info-panel {
  transform: translateY(0);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 80%, transparent 100%);
}

.info-panel h3 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Movie Meta */
.movie-meta {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  color: #ddd;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.movie-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.movie-meta .year {
  color: #aaa;
}

.movie-meta .rating {
  color: #ffd700;
  font-weight: 500;
}

.movie-meta .rating i {
  font-size: 0.9em;
  color: #ffd700;
}

/* Hover Buttons */
.movie-hover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
  padding: 15px;
  text-align: center;
  pointer-events: none;
}

.box:hover .movie-hover {
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  width: 100%;
  max-width: 120px;
  pointer-events: auto;
  text-decoration: none;
}

.btn i {
  margin-right: 5px;
  font-size: 0.9em;
}

.btn-play {
  background: #e50914;
  color: white;
}

.btn-play:hover {
  background: #f40612;
  transform: translateY(-2px);
}

.btn-more {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

.btn-more:hover {
  background: white;
  transform: translateY(-2px);
}

/* Favorite Button */
.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  opacity: 0;
  transform: scale(0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  pointer-events: auto;
}

.box:hover .favorite-btn {
  opacity: 1;
  transform: scale(1);
}

.favorite-btn:hover {
  background: #e50914;
  transform: scale(1.1) !important;
}

.favorite-btn.active {
  color: #e50914;
  background: rgba(255, 255, 255, 0.9);
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px 10px;
  max-width: 1400px;
  margin: 0 auto;
}

.main-content {
    position: relative;
    padding: 20px 20px 20px 20px;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Responsive main content */
@media (max-width: 1200px) {
    .main-content {
        padding: 20px 15px 20px 15px;
    }
}

@media (max-width: 992px) {
    .main-content {
        padding: 20px 10px 20px 10px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px 10px 20px 10px;
    }
}

.section-header h2 {
  font-size: 1.5rem;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 i {
  color: #e50914;
}

.view-all {
  color: #e50914;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease;
}

.view-all:hover {
  color: #f40612;
  text-decoration: underline;
}

/* Navigation */
.navigation {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
  padding: 0 15px;
  flex-wrap: wrap;
}

.navigation a {
  display: block;
  padding: 8px 14px;
  background: #2a2a2a;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  white-space: nowrap;
}

.navigation a:hover,
.navigation a.active {
  background: #e50914;
  color: white;
  transform: translateY(-2px);
}

/* Filter Sidebar */
.filter-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #0f0f0f;
    padding: 25px;
    box-sizing: border-box;
    z-index: 10;
    border-left: 1px solid #2a2a2a;
}

/* Responsive filter sidebar */
@media (max-width: 1200px) {
    .filter-sidebar {
        width: 250px;
        padding: 20px;
    }
}

@media (max-width: 992px) {
    .filter-sidebar {
        width: 200px;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .filter-sidebar {
        display: none;
    }
    
    .main-content {
        padding-right: 0 !important;
    }
}

.filter-sidebar h3 {
  margin-bottom: 25px;
  color: #e50914;
  font-size: 1.4rem;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid #2a2a2a;
}

.filter-group {
  margin-bottom: 25px;
  padding: 15px 0;
  border-bottom: 1px solid #2a2a2a;
}

.filter-group h4 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1rem;
}

.form-check {
  margin-bottom: 10px;
}

.form-check-label {
  color: #999;
  cursor: pointer;
  font-size: 0.9rem;
}

.form-check-input:checked + .form-check-label {
  color: #e50914;
}

.input-group {
  max-width: 100%;
  margin: 0 auto;
}

.form-control {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
}

.form-control:focus {
  background: #2a2a2a;
  border-color: #e50914;
  box-shadow: 0 0 0 0.2rem rgba(229, 9, 20, 0.25);
}

.form-control::placeholder {
  color: #666;
}

.form-range {
  width: 100%;
  background: #2a2a2a;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  margin: 10px 0;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #e50914;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.rating-display {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #e50914;
  font-weight: 500;
}

.rating-display i {
  color: #e50914;
}

.btn {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.btn i {
  font-size: 0.95em;
}

.btn-primary {
  background: #e50914;
  color: white;
  border: none;
}

.btn-primary:hover {
  background: #f40612;
  transform: translateY(-2px);
}

.btn-outline-primary {
  background: transparent;
  color: #fff;
  border: 1px solid #444;
}

.btn-outline-primary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.navigation .active {
  background: #e50914;
  font-weight: 500;
}
