/* ===== Globale stijlen: kleuren, knoppen, formulieren en kaarten =====
   Componentspecifieke stijlen staan in de .css-bestanden van elk component. */

:root {
  --bg: #0d0b1e;
  --bg-elevated: #16132e;
  --surface: #1e1a3d;
  --surface-hover: #27224f;
  --border: #322c63;
  --text: #ece9ff;
  --text-muted: #9a94c4;

  --primary: #ff4d8d;       /* sakura-roze */
  --primary-hover: #ff6fa4;
  --accent: #38d9f5;        /* neon-cyaan */
  --danger: #ff5c6c;

  --planned: #a78bfa;
  --watching: #38d9f5;
  --completed: #4ade80;

  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --sidebar-width: 230px;
  --navbar-height: 60px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 77, 141, 0.18), transparent 40%),
    radial-gradient(circle at -10% 110%, rgba(56, 217, 245, 0.12), transparent 40%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

/* ----- Paginakop ----- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
}

/* ----- Kaarten ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

/* ----- Knoppen ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

/* ----- Formulieren ----- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-weight: 600;
  font-size: 0.9rem;
}

.form-field .hint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

input,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 217, 245, 0.2);
}

input.invalid,
select.invalid {
  border-color: var(--danger);
}

.error-text {
  color: var(--danger);
  font-size: 0.8rem;
  margin: 0;
}

/* ----- Meldingen ----- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--danger);
  background: rgba(255, 92, 108, 0.12);
  color: #ffc2c8;
}

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

.loading {
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

/* ----- Raster voor kaarten ----- */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* Elementen met het hidden-attribuut altijd verbergen (ook als ze display: grid hebben) */
[hidden] {
  display: none !important;
}

.full {
  grid-column: 1 / -1;
}

/* ===== Layout: navbar, zijmenu en inhoud ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  background: rgba(13, 11, 30, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
}

.logo {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.brand-name strong {
  color: var(--primary);
}

.add-button {
  margin-left: auto;
}

.menu-button {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-button span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

@media (max-width: 800px) {
  .menu-button {
    display: flex;
  }
}

@media (max-width: 420px) {
  .brand-name {
    display: none;
  }
}
.sidebar {
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 0.75rem;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.sidebar nav a:hover {
  background: var(--surface);
  color: var(--text);
}

.sidebar nav a.active {
  background: var(--surface);
  color: var(--text);
  border-left-color: var(--primary);
}

.sidebar .icon {
  width: 1.2rem;
  text-align: center;
  color: var(--primary);
}

.sidebar-footer {
  margin: 0;
  padding: 0 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Op kleine schermen schuift het menu van links in beeld */
@media (max-width: 800px) {
  .sidebar {
    position: fixed;
    left: 0;
    z-index: 16;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

.shell {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}

.content {
  flex: 1;
  min-width: 0;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.backdrop {
  display: none;
}

@media (max-width: 800px) {
  .content {
    padding: 1.25rem 1rem;
  }

  /* Donkere achtergrond achter het open zijmenu op kleine schermen */
  .backdrop.visible {
    display: block;
    position: fixed;
    inset: var(--navbar-height) 0 0 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15;
  }
}

/* ===== Gedeelde componenten ===== */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid currentColor;
}

.badge.planned {
  color: var(--planned);
  background: rgba(167, 139, 250, 0.12);
}

.badge.watching {
  color: var(--watching);
  background: rgba(56, 217, 245, 0.12);
}

.badge.completed {
  color: var(--completed);
  background: rgba(74, 222, 128, 0.12);
}

.progress-track {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-fill.done {
  background: var(--completed);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--stat-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--stat-color);
}
.anime-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}

.anime-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.anime-card .rating {
  color: #ffd166;
  font-weight: 600;
  font-size: 0.9rem;
}

.anime-card .rating.empty {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.anime-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.anime-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.anime-card h3 a:hover {
  color: var(--primary);
}

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

.genre {
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.card-actions:empty {
  display: none;
}
.anime-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 760px;
}


.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .anime-form {
    grid-template-columns: 1fr;
  }
}

/* ===== Pagina: dashboard ===== */
.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(120deg, rgba(255, 77, 141, 0.25), rgba(56, 217, 245, 0.12)),
    var(--surface);
}

.hero h1 {
  font-size: 1.9rem;
}

.hero p {
  margin: 0;
}

.kicker {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.episodes {
  margin: 1rem 0 2rem;
}

.episodes strong {
  color: var(--accent);
}

/* ===== Pagina: anime-overzicht ===== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.search {
  flex: 1 1 260px;
}

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

.filter {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter:hover {
  color: var(--text);
}

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

.count {
  margin-left: 0.25rem;
  opacity: 0.75;
}


/* ===== Pagina: anime-detail ===== */
.back {
  display: inline-block;
  margin-bottom: 1rem;
  text-decoration: none;
}

.detail {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.75rem;
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.detail-header h1 {
  margin-top: 0.6rem;
  font-size: 2rem;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
}

.section-title {
  font-size: 1rem;
  color: var(--text-muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 0;
}

.facts div {
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border-radius: 8px;
}

dt {
  font-size: 0.8rem;
  color: var(--text-muted);
}

dd {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

.facts .rating {
  color: #ffd166;
}
