:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(19, 27, 46, 0.7);
  --bg-card-hover: rgba(30, 41, 69, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  --accent-primary: #6366f1;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --badge-bg: rgba(99, 102, 241, 0.15);
  --badge-text: #a5b4fc;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header & Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 0.75rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.nav-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

/* Main Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2.5rem 1.5rem;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.12) 0%, rgba(11, 15, 25, 0) 70%);
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  letter-spacing: -1px;
}

.hero h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 680px;
  margin: 0 auto 1.8rem;
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.author-chip strong {
  color: var(--text-primary);
}

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

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Filter & Search Bar */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.genre-select {
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}

/* Movies Grid */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.movie-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.movie-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.movie-card-header {
  margin-bottom: 0.8rem;
}

.movie-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.movie-year {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.movie-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.8rem 0;
}

.badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-weight: 600;
}

.movie-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.rating-badge {
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.95rem;
}

.votes-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.match-score {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Sections */
.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}

/* Input group */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.panel h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.panel p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.slider-group {
  margin: 1.5rem 0;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.slider-input {
  width: 100%;
  accent-color: var(--accent-primary);
  height: 6px;
  border-radius: 3px;
  outline: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.8rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* Seed list */
.seed-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.seed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.seed-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.seed-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.seed-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}

/* Table styles */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.styled-table th, .styled-table td {
  padding: 0.85rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.styled-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
}

.styled-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
}
