/* Anime Page Styles */

.home-btn {
  position: absolute;
  top: 2rem;
  left: 2rem;
  padding: 0.75rem 1.5rem;
  background: rgba(183, 148, 246, 0.15);
  border: 1px solid rgba(183, 148, 246, 0.3);
  border-radius: 8px;
  color: #b794f6;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  font-size: 0.95rem;
  z-index: 100;
}

.home-btn:hover {
  background: rgba(183, 148, 246, 0.25);
  border-color: #b794f6;
  transform: translateY(-2px);
}

.anime-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 60px 2rem 2rem;
}

.anime-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
  border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.anime-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #b794f6;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.anime-header h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #b794f6, transparent);
}

.anime-header .title-underline {
  display: none;
}

.anime-header .subtitle {
  font-size: 1.2rem;
  color: rgba(203, 213, 225, 0.8);
  max-width: 600px;
  margin: 0 auto;
}

/* Stats Section */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(30, 30, 46, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(30, 30, 46, 0.7);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 2.5rem;
  color: #8b5cf6;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: #94a3b8;
}

/* Content Layout */
.content-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

/* Sidebar */
.sidebar {
  width: 250px;
  flex-shrink: 0;
}

.sidebar-section {
  background: rgba(30, 30, 46, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.list-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.list-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #e2e8f0;
}

.list-btn.active {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  font-weight: 600;
}

.list-btn .count {
  background: rgba(139, 92, 246, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.filter-group {
  margin-bottom: 1rem;
}

.filter-group label {
  display: block;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.filter-input {
  width: 100%;
  background: rgba(15, 15, 30, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 0.75rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.filter-input:focus {
  outline: none;
  border-color: #8b5cf6;
  background: rgba(15, 15, 30, 0.7);
}

.filter-input::placeholder {
  color: #64748b;
}

.sort-select {
  width: 100%;
  background: rgba(15, 15, 30, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 0.75rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-select:focus {
  outline: none;
  border-color: #8b5cf6;
  background: rgba(15, 15, 30, 0.7);
}

.sort-select option {
  background: #1e1e2e;
  color: #e2e8f0;
}

.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.genre-filter-btn {
  background: rgba(15, 15, 30, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #cbd5e1;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.genre-filter-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
}

.genre-filter-btn.active {
  background: rgba(139, 92, 246, 0.3);
  border-color: #8b5cf6;
  color: #c4b5fd;
  font-weight: 600;
}

/* Tabs (kept for backwards compatibility but hidden) */
.tabs-container {
  display: none;
}

/* Anime Grid */
.anime-container {
  position: relative;
  min-height: 400px;
  flex: 1;
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.anime-card {
  background: rgba(30, 30, 46, 0.6);
  border: 2px solid rgba(139, 92, 246, 0.15);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s ease;
  display: block;
}

.anime-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--accent-color, #8b5cf6);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.4), 
              0 0 30px rgba(139, 92, 246, 0.2);
  background: rgba(30, 30, 46, 0.8);
}

.anime-image {
  position: relative;
  width: 100%;
  padding-top: 140%; /* 7:10 aspect ratio for anime covers */
  overflow: hidden;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
}

.anime-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.rating-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1rem;
  color: #fbbf24;
  border: 2px solid rgba(251, 191, 36, 0.3);
  z-index: 2;
}

.rating-badge i {
  font-size: 0.9rem;
}

.rewatch-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1rem;
  color: #8b5cf6;
  border: 2px solid rgba(139, 92, 246, 0.4);
  z-index: 2;
}

.rewatch-badge i {
  font-size: 0.85rem;
}

.anime-info {
  padding: 1.25rem;
}

.anime-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0 0 1rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.2rem;
  transition: color 0.3s ease;
}

.anime-card:hover .anime-title {
  color: var(--accent-color, #c4b5fd);
}

.episode-progress {
  margin-bottom: 1rem;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.progress-label {
  color: #cbd5e1;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.avg-score {
  color: #94a3b8;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.avg-score i {
  font-size: 0.75rem;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--accent-color, #8b5cf6);
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
  box-shadow: 0 0 10px currentColor;
}

.anime-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.genre-tag {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  color: #c4b5fd;
  font-weight: 500;
  transition: all 0.3s ease;
}

.anime-card:hover .genre-tag {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.5);
}

/* Loading and Empty States */
.loading-spinner {
  text-align: center;
  padding: 4rem 1rem;
  grid-column: 1 / -1;
}

.loading-spinner i {
  font-size: 3rem;
  color: #8b5cf6;
  margin-bottom: 1rem;
}

.loading-spinner p {
  color: #94a3b8;
  font-size: 1.1rem;
}

.empty-message, .error-message {
  text-align: center;
  padding: 4rem 1rem;
  color: #94a3b8;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.error-message {
  color: #f87171;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .content-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    position: relative;
    top: 0;
  }
  
  .sidebar-section {
    display: inline-block;
    width: calc(33.333% - 1rem);
    margin-right: 1rem;
    vertical-align: top;
  }
  
  .anime-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .anime-main {
    padding-top: 80px;
  }

  .anime-header h1 {
    font-size: 2rem;
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sidebar-section {
    width: 100%;
    margin-right: 0;
    display: block;
  }

  .anime-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .stats-container {
    grid-template-columns: 1fr;
  }

  .anime-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .anime-info {
    padding: 1rem;
  }
  
  .anime-title {
    font-size: 0.95rem;
  }
}
