:root {
  /* Premium Dark Anime Palette */
  --bg-dark: #0f111a;
  --bg-card: #1a1d2d;
  --bg-card-hover: #222639;
  
  --accent-primary: #a855f7; /* Neon Purple */
  --accent-secondary: #ec4899; /* Neon Pink */
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --mal-blue: #2e51a2;
  --imdb-yellow: #f5c518;
  --anilist-blue: #02a9ff;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  color: var(--accent-primary);
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
}

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

.lang-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-selector i { color: var(--text-muted); }

.lang-selector select {
  background: transparent;
  color: var(--text-main);
  border: none;
  outline: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.lang-selector select option { background: var(--bg-card); color: var(--text-main); }

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 80px 20px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.15), transparent 60%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.1;
  background: linear-gradient(to right, #fff, #d8b4fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* --- Main Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
  flex: 1;
}

/* --- Browser Style Tabs --- */
.browser-window {
  background: #1e1e1e;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.browser-tabs {
  display: flex;
  background: #121212;
  padding: 10px 10px 0 10px;
  gap: 4px;
  overflow-x: auto;
}

.browser-tab {
  background: #1a1a1a;
  border: none;
  color: var(--text-muted);
  padding: 12px 20px;
  border-radius: 12px 12px 0 0;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.browser-tab:hover {
  background: #242424;
  color: var(--text-main);
}

.browser-tab.active {
  background: #1e1e1e;
  color: #fff;
  border-top: 2px solid var(--accent-primary);
}

.browser-toolbar {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: #1e1e1e;
  gap: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toolbar-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.pill.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* --- Results Header --- */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.results-header h2 { font-size: 1.8rem; font-weight: 700; }
.results-count { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }

/* --- Anime Grid --- */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

/* --- Anime Card --- */
.anime-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.anime-card:hover {
  transform: translateY(-5px);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(168, 85, 247, 0.1);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #111;
}

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

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

.rank-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #000;
  font-weight: 900;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  z-index: 2;
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.anime-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.anime-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta-tag {
  background: rgba(255,255,255,0.1);
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.meta-tag.year { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }

.anime-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Ratings */
.ratings-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.rating-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.rating-item span { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.rating-item strong { font-size: 1.1rem; }

.r-mal span { color: var(--mal-blue); }
.r-imdb span { color: var(--imdb-yellow); }
.r-anilist span { color: var(--anilist-blue); }

/* Reviews */
.review-block {
  background: rgba(168, 85, 247, 0.05);
  border-left: 3px solid var(--accent-primary);
  padding: 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.review-header i { color: var(--accent-primary); }
.review-author { font-weight: 700; color: #d8b4fe; }

.review-text {
  font-size: 0.85rem;
  font-style: italic;
  color: #cbd5e1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Links */
.watch-links {
  display: flex;
  gap: 10px;
}

.btn-watch {
  flex: 1;
  text-decoration: none;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-cr {
  background: #f47521; /* Crunchyroll Orange */
  color: #fff;
}
.btn-cr:hover { background: #e06210; }

.btn-nf {
  background: #e50914; /* Netflix Red */
  color: #fff;
}
.btn-nf:hover { background: #b80710; }

.btn-generic {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.btn-generic:hover { background: rgba(255,255,255,0.2); }


/* --- Footer --- */
footer {
  text-align: center;
  padding: 30px;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-seo-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}

.legal-disclaimer {
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.4); /* Very muted */
  max-width: 900px;
  margin: 15px auto 0;
  line-height: 1.6;
  text-align: justify;
  text-align-last: center;
}

.legal-disclaimer p {
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .controls-wrapper { padding: 15px; gap: 15px; }
  .anime-grid { grid-template-columns: 1fr; }
}
