/* ============================================
   AniStream — Design System & Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Orbitron:wght@500;700;900&display=swap');

/* CSS Variables */
:root {
  --primary: #0f0f23;
  --secondary: #1a1a2e;
  --accent: #e94560;
  --accent-secondary: #7b2cbf;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --card-bg: #16213e;
  --success: #00d26a;
  --warning: #ffc107;
  --danger: #ff4757;
  --border: rgba(255,255,255,0.06);
  --glass: rgba(15,15,35,0.85);
  --glass-border: rgba(255,255,255,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-accent: 0 4px 20px rgba(233,69,96,0.3);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(123,44,191,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(233,69,96,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(123,44,191,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--primary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-secondary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ============================================
   Navigation Bar
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(15,15,35,0.95);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
}

.nav-logo span {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  -webkit-text-fill-color: white;
}

.nav-search {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.nav-search input {
  width: 100%;
  padding: 10px 20px 10px 44px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

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

.nav-search input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 20px rgba(233,69,96,0.15);
}

.nav-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(22, 33, 62, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  max-height: 420px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
  animation: searchDropIn 0.25s ease;
}

.search-dropdown.active {
  display: block;
}

@keyframes searchDropIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
  color: inherit;
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item:hover {
  background: rgba(233,69,96,0.1);
}

.search-dropdown-thumb {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.06);
}

.search-dropdown-info {
  flex: 1;
  min-width: 0;
}

.search-dropdown-title {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.search-dropdown-title mark {
  background: none;
  color: var(--accent);
  font-weight: 800;
}

.search-dropdown-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.search-dropdown-meta .star {
  color: var(--warning);
}

.search-dropdown-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.search-dropdown-empty span {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.search-dropdown-header {
  padding: 10px 16px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(233,69,96,0.15);
}

.nav-link.admin-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
  font-weight: 700;
}

.nav-link.admin-btn:hover {
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 500px;
  margin-top: 70px;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: all;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.4) saturate(1.2);
}

.hero-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70%;
  background: linear-gradient(to top, var(--primary), transparent);
}

.hero-content {
  position: absolute;
  bottom: 80px;
  left: 5%;
  max-width: 600px;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
}

.hero-title {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 12px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hero-meta-item .star {
  color: var(--warning);
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c0392b);
  color: white;
  box-shadow: 0 4px 15px rgba(233,69,96,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(233,69,96,0.5);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-danger {
  background: linear-gradient(135deg, #ff4757, #c0392b);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px rgba(255,71,87,0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #00a854);
  color: white;
}

/* Hero dots navigation */
.hero-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.hero-dot.active {
  background: var(--accent);
  width: 30px;
  border-radius: 5px;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
  position: relative;
  z-index: 1;
  padding: 0 5% 60px;
}

.section {
  margin-bottom: 50px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--accent), var(--accent-secondary));
  border-radius: 2px;
}

/* Filter Buttons */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
  border-color: transparent;
}

/* ============================================
   Anime Card Grid
   ============================================ */

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

.anime-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  animation: fadeInUp 0.6s ease both;
}

.anime-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  border-color: rgba(233,69,96,0.3);
}

.anime-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
}

.anime-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

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

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

.play-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 30px rgba(233,69,96,0.5);
}

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

.anime-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 4px;
}

.anime-card-badge.rating .star {
  color: var(--warning);
}

.anime-card-badge.episodes {
  top: auto;
  bottom: 10px;
  right: 10px;
  left: auto;
}

.anime-card-info {
  padding: 14px;
}

.anime-card-title {
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anime-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.anime-card-category {
  padding: 2px 10px;
  border-radius: 50px;
  background: rgba(123,44,191,0.2);
  color: #b388ff;
  font-size: 0.75rem;
  font-weight: 600;
}

.anime-card-status {
  font-size: 0.75rem;
  font-weight: 600;
}

.anime-card-status.ongoing {
  color: var(--success);
}

.anime-card-status.completed {
  color: var(--accent);
}

/* Stagger animation */
.anime-card:nth-child(1) { animation-delay: 0.05s; }
.anime-card:nth-child(2) { animation-delay: 0.1s; }
.anime-card:nth-child(3) { animation-delay: 0.15s; }
.anime-card:nth-child(4) { animation-delay: 0.2s; }
.anime-card:nth-child(5) { animation-delay: 0.25s; }
.anime-card:nth-child(6) { animation-delay: 0.3s; }
.anime-card:nth-child(7) { animation-delay: 0.35s; }
.anime-card:nth-child(8) { animation-delay: 0.4s; }

/* ============================================
   Anime Detail / Watch Page
   ============================================ */

.watch-page {
  margin-top: 70px;
  padding: 30px 5%;
}

.watch-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
}

.player-section {
  width: 100%;
}

.video-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.video-player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  gap: 12px;
}

.video-player-placeholder .big-play {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 40px rgba(233,69,96,0.4);
}

/* Source Selector */
.source-selector {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.source-btn {
  padding: 8px 18px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.source-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.source-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Anime Info */
.anime-info {
  margin-top: 24px;
  padding: 24px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.anime-info-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.anime-info-poster {
  width: 120px;
  height: 170px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.anime-info-details h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.anime-info-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tag-category {
  background: rgba(123,44,191,0.2);
  color: #b388ff;
}

.tag-status {
  background: rgba(0,210,106,0.15);
  color: var(--success);
}

.tag-status.completed {
  background: rgba(233,69,96,0.15);
  color: var(--accent);
}

.tag-rating {
  background: rgba(255,193,7,0.15);
  color: var(--warning);
}

.anime-info-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Episode Sidebar */
.episode-sidebar {
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: 0;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
}

.episode-sidebar-title {
  font-size: 1rem;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.02);
  margin: 0;
  flex-shrink: 0;
}

.episode-sidebar-title h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.episode-sidebar-title h3::before {
  content: '📋';
  font-size: 1rem;
}

.episode-count {
  font-family: 'Nunito', sans-serif;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  padding: 4px 12px;
  border-radius: 50px;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.episode-list::-webkit-scrollbar {
  width: 4px;
}

.episode-list::-webkit-scrollbar-thumb {
  background: rgba(233,69,96,0.3);
  border-radius: 4px;
}

.episode-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.episode-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(233,69,96,0.08), rgba(123,44,191,0.05));
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 14px;
}

.episode-item:hover::before {
  opacity: 1;
}

.episode-item:hover {
  border-color: rgba(255,255,255,0.06);
  transform: translateX(4px);
}

.episode-item.active {
  background: linear-gradient(135deg, rgba(233,69,96,0.12), rgba(123,44,191,0.08));
  border-color: rgba(233,69,96,0.25);
  box-shadow: 0 4px 20px rgba(233,69,96,0.1);
}

.episode-item.active::before {
  opacity: 0;
}

.episode-number {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all 0.25s ease;
}

.episode-item:hover .episode-number {
  border-color: rgba(233,69,96,0.3);
  color: var(--accent);
}

.episode-item.active .episode-number {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 15px rgba(233,69,96,0.35);
}

.episode-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 1;
  transition: color 0.25s ease;
}

.episode-item:hover .episode-title {
  color: var(--text-primary);
}

.episode-item.active .episode-title {
  color: var(--accent);
  font-weight: 700;
}

.episode-details {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.episode-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 600;
  opacity: 0.6;
}

.episode-item.active .episode-sub {
  color: var(--accent);
  opacity: 0.8;
}

/* Now Playing indicator */
.episode-item.active::after {
  content: '▶';
  position: absolute;
  right: 14px;
  font-size: 0.7rem;
  color: var(--accent);
  animation: pulse-play 1.5s ease infinite;
  z-index: 1;
}

@keyframes pulse-play {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ============================================
   Admin Panel
   ============================================ */

.admin-page {
  margin-top: 70px;
  padding: 30px 5%;
}

.admin-header {
  margin-bottom: 30px;
}

.admin-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.admin-header p {
  color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(233,69,96,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.stat-card-icon.purple {
  background: rgba(123,44,191,0.15);
  color: var(--accent-secondary);
}

.stat-card-icon.red {
  background: rgba(233,69,96,0.15);
  color: var(--accent);
}

.stat-card-icon.green {
  background: rgba(0,210,106,0.15);
  color: var(--success);
}

.stat-card-icon.yellow {
  background: rgba(255,193,7,0.15);
  color: var(--warning);
}

.stat-card-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Admin Toolbar */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Admin Table */
.admin-table-wrapper {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: rgba(255,255,255,0.03);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.admin-table tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.admin-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.admin-table .anime-row-thumb {
  width: 50px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-table .actions {
  display: flex;
  gap: 8px;
}

.admin-table .action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 0.9rem;
}

.admin-table .action-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
}

.admin-table .action-btn.edit:hover {
  color: var(--accent-secondary);
  border-color: var(--accent-secondary);
}

.admin-table .action-btn.delete:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal {
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  transform: translateY(30px) scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.2rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.modal-body {
  padding: 24px;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(233,69,96,0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  cursor: pointer;
}

.form-select option {
  background: var(--secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Episodes Form Section */
.episodes-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.episodes-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.episode-form-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.episode-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.embed-code-item {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  align-items: center;
}

.embed-code-item input {
  flex: 1;
}

.remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,71,87,0.3);
  background: rgba(255,71,87,0.1);
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.remove-btn:hover {
  background: rgba(255,71,87,0.2);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 40px 5%;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.footer-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-logo span {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Loading & Empty States
   ============================================ */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  animation: slideInRight 0.4s ease, fadeOut 0.4s ease 2.6s;
  box-shadow: var(--shadow);
}

.toast.success {
  background: linear-gradient(135deg, var(--success), #00a854);
}

.toast.error {
  background: linear-gradient(135deg, var(--danger), #c0392b);
}

.toast.info {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .episode-sidebar {
    position: static;
    max-height: none;
  }

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

@media (max-width: 768px) {
  .navbar {
    padding: 10px 1rem;
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
  }

  .watch-page {
    margin-top: 130px;
    padding: 20px 5%;
  }

  .nav-logo {
    font-size: 1.2rem;
  }

  .nav-logo-icon {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .nav-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .nav-search input {
    width: 100%;
  }

  .search-dropdown {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    max-height: 60vh;
  }

  .nav-links {
    order: 2;
  }

  .nav-links .nav-link:not(.admin-btn) {
    display: none;
  }

  .hero {
    height: 60vh;
    min-height: 400px;
  }

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

  .hero-content {
    bottom: 60px;
    left: 5%;
    right: 5%;
  }

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

  .section-title {
    font-size: 1.2rem;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) {
    display: none;
  }

  .anime-info-header {
    flex-direction: column;
  }

  .anime-info-details h1 {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .anime-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

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

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

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