/* 기본 스타일 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #141414;
  color: #ffffff;
  line-height: 1.6;
}

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

/* 헤더 스타일 */
.header {
  background-color: #000000;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #333;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  color: #e50914;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #e50914;
}

/* 히어로 섹션 */
.hero {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  padding: 4rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #e50914, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #cccccc;
  margin-bottom: 2rem;
}

/* 영화 섹션 */
.movies-section {
  padding: 3rem 0;
}

.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

/* 영화 그리드 */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* 영화 카드 */
.movie-card {
  background-color: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.movie-poster {
  width: 100%;
  height: 350px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.movie-card:hover .movie-poster {
  transform: scale(1.05);
}

.movie-info {
  padding: 1.5rem;
}

.movie-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-release-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

.release-label {
  color: #cccccc;
  font-weight: 500;
}

.release-date {
  color: #e50914;
  font-weight: 600;
}

.movie-overview {
  font-size: 0.9rem;
  color: #cccccc;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.movie-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #ffd700;
}

.star-icon {
  width: 16px;
  height: 16px;
  fill: #ffd700;
}

/* 로딩 스피너 */
.loading {
  text-align: center;
  padding: 3rem 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #333;
  border-top: 4px solid #e50914;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading p {
  color: #cccccc;
  font-size: 1.1rem;
}

/* 에러 메시지 */
.error {
  text-align: center;
  padding: 3rem 0;
  background-color: #2d1b1b;
  border-radius: 12px;
  border: 1px solid #e50914;
}

.error p {
  color: #ff6b6b;
  font-size: 1.1rem;
}

/* 푸터 */
.footer {
  background-color: #000000;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid #333;
  margin-top: 3rem;
}

.footer p {
  color: #666666;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    gap: 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

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

  .movie-poster {
    height: 280px;
  }

  .movie-info {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .movie-poster {
    height: 220px;
  }

  .movie-title {
    font-size: 1rem;
  }

  .movie-overview {
    font-size: 0.8rem;
  }
}

/* 추가 애니메이션 */
.movie-card {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(30px);
}

.movie-card:nth-child(1) {
  animation-delay: 0.1s;
}
.movie-card:nth-child(2) {
  animation-delay: 0.2s;
}
.movie-card:nth-child(3) {
  animation-delay: 0.3s;
}
.movie-card:nth-child(4) {
  animation-delay: 0.4s;
}
.movie-card:nth-child(5) {
  animation-delay: 0.5s;
}
.movie-card:nth-child(6) {
  animation-delay: 0.6s;
}
.movie-card:nth-child(7) {
  animation-delay: 0.7s;
}
.movie-card:nth-child(8) {
  animation-delay: 0.8s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
