* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  color: #fff;
  min-height: 100vh;
}

.header {
  text-align: center;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header p {
  color: #bbb;
  font-size: 1rem;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 30px 20px;
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 25px;
}

.movie-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  overflow: hidden;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(255, 107, 107, 0.3);
}

.movie-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #1a1a2e;
}

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.movie-card:hover .movie-poster img {
  transform: scale(1.08);
}

.rating-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #feca57;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

.movie-info {
  padding: 15px;
}

.movie-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-year {
  color: #999;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.movie-actions {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-download {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
}

.btn-download:hover {
  background: linear-gradient(135deg, #20c997, #28a745);
  transform: scale(1.05);
}

.btn-watch {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: #fff;
}

.btn-watch:hover {
  background: linear-gradient(135deg, #ee5a6f, #ff6b6b);
  transform: scale(1.05);
}

/* Loader */
.loader {
  text-align: center;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ff6b6b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.end-message {
  text-align: center;
  padding: 30px;
  color: #999;
  font-size: 1.1rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #1a1a2e;
  border-radius: 15px;
  padding: 25px;
  max-width: 800px;
  width: 100%;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
  margin-bottom: 15px;
  color: #feca57;
  font-size: 1.3rem;
}

.close {
  position: absolute;
  top: 10px;
  left: 15px;
  font-size: 2rem;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
  line-height: 1;
}

.close:hover {
  color: #ff6b6b;
}

#videoPlayer {
  border-radius: 10px;
  background: #000;
  max-height: 70vh;
}

/* Responsive */
@media (max-width: 600px) {
  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .header h1 {
    font-size: 1.6rem;
  }
  
  .movie-actions {
    flex-direction: column;
  }
  
  .btn {
    padding: 8px;
    font-size: 0.8rem;
  }
}