/* CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --primary: #ff6b9d;
  --primary-dark: #e91e63;
  --secondary: #7c4dff;
  --accent: #00e5ff;
  --background: #0f0f1a;
  --surface: #1a1a2e;
  --surface-light: #25253d;
  --text: #ffffff;
  --text-secondary: #b0b0c0;
  --text-muted: #6c6c80;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

/* Light Theme */
[data-theme="light"] {
  --background: #f5f5f7;
  --surface: #ffffff;
  --surface-light: #f0f0f5;
  --text: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #8c8c9a;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: var(--transition);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 15, 26, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  font-size: 1.8rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: rgba(255, 107, 157, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-btn,
.theme-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 1.2rem;
  transition: var(--transition);
}

.search-btn:hover,
.theme-toggle:hover {
  background: var(--primary);
  transform: scale(1.1);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  z-index: 10;
  max-width: 800px;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #ff6b9d 50%, #7c4dff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.5)); }
  to { filter: drop-shadow(0 0 40px rgba(124, 77, 255, 0.5)); }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

.btn-outline:hover {
  background: var(--text);
  color: var(--background);
}

.hero-slider {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active {
  opacity: 0.15;
}

.hero-dots {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

/* Filter Section */
.filter-section {
  padding: 4rem 2rem 2rem;
  background: var(--background);
}

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

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--gradient-1);
  border-radius: 2px;
}

.filter-tabs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-tab {
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 50px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover {
  background: var(--surface-light);
  color: var(--text);
}

.filter-tab.active {
  background: var(--gradient-1);
  color: white;
  border-color: transparent;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* Anime Grid */
.anime-section {
  padding: 2rem 0 4rem;
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

/* Anime Card */
.anime-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.anime-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow);
}

.anime-card-image {
  position: relative;
  width: 100%;
  padding-top: 140%;
  overflow: hidden;
}

.anime-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.anime-card:hover .anime-card-image img {
  transform: scale(1.1);
}

.anime-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.anime-card:hover .anime-card-overlay {
  opacity: 1;
}

.anime-card-play {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  transform: scale(0);
  transition: var(--transition);
}

.anime-card:hover .anime-card-play {
  transform: scale(1);
}

.anime-card-score {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.anime-card-score::before {
  content: '⭐';
}

.anime-card-content {
  padding: 1rem;
}

.anime-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anime-card-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.anime-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.anime-card-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--secondary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Movie Section */
.movie-section {
  padding: 4rem 0;
  background: var(--surface);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.movie-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.movie-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

.movie-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.movie-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
}

.movie-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.movie-card-year {
  color: var(--primary);
  font-weight: 600;
}

/* Ranking Section */
.ranking-section {
  padding: 4rem 0;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  padding: 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.ranking-item:hover {
  background: var(--surface-light);
  transform: translateX(10px);
}

.ranking-number {
  font-size: 2rem;
  font-weight: 800;
  width: 60px;
  text-align: center;
  color: var(--text-muted);
}

.ranking-item:nth-child(1) .ranking-number { color: #ffd700; }
.ranking-item:nth-child(2) .ranking-number { color: #c0c0c0; }
.ranking-item:nth-child(3) .ranking-number { color: #cd7f32; }

.ranking-image {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.ranking-info {
  flex: 1;
}

.ranking-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.ranking-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.ranking-score {
  background: var(--gradient-1);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
}

/* Footer */
.footer {
  background: var(--surface);
  padding: 4rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-column h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.footer-column a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.footer-column a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1400px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Modal */
.modal,
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active,
.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: var(--background);
  border: none;
  border-radius: 50%;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

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

.modal-body {
  padding: 2rem;
}

.modal-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.modal-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.modal-desc {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.modal-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-tag {
  background: var(--surface-light);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Search Modal */
.search-modal {
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(20px);
}

.search-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 600px;
  width: 90%;
  background: var(--surface);
  border-radius: 50px;
  padding: 0.5rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}

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

.search-close {
  width: 50px;
  height: 50px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.search-close:hover {
  transform: scale(1.1);
}

.search-results {
  max-width: 600px;
  width: 90%;
  margin-top: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.search-result-image {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.search-result-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.search-result-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

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

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

  .movie-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .ranking-item {
    flex-wrap: wrap;
  }

  .ranking-image {
    width: 60px;
    height: 80px;
  }
}
