/* ── Watchlist panel ──────────────────────────────────────── */
.watchlist-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100%;
  background: rgba(21, 23, 61, 0.97);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateX(100%);
  transition: transform 300ms ease;
  z-index: 1100;
  overflow-y: auto;
  padding: 1.5rem;
  box-sizing: border-box;
}

.watchlist-panel.open {
  transform: translateX(0);
}

/* ── Overlay ─────────────────────────────────────────────── */
.watchlist-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1099;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.watchlist-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Header ──────────────────────────────────────────────── */
.watchlist-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
}

.watchlist-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  color: #E8EAF0;
  margin: 0;
}

#watchlist-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #E8EAF0;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  transition: background 200ms ease, color 200ms ease;
}

#watchlist-close:hover {
  background: #ffffff;
  color: #070b34;
}

/* ── Watchlist card ──────────────────────────────────────── */
.watchlist-card {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0;
  align-items: flex-start;
}

.watchlist-poster {
  width: 60px;
  height: 90px;
  object-fit: cover;
  border-radius: 1rem;
  flex-shrink: 0;
}

.watchlist-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.watchlist-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #E8EAF0;
}

.watchlist-rating {
  font-size: 0.8rem;
  color: #c5a3ff;
}

.watchlist-year {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ── Remove button ───────────────────────────────────────── */
.watchlist-remove-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.4rem;
  cursor: pointer;
  align-self: center;
  flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.watchlist-remove-btn:hover {
  background: rgba(255, 80, 80, 0.2);
  border-color: rgba(255, 80, 80, 0.5);
  color: #ff6b6b;
}

/* ── Empty message ───────────────────────────────────────── */
#watchlist-empty-msg {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* ── Navbar toggle button ────────────────────────────────── */
#watchlist-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 2px solid #ffffff;
  color: #ffffff;
  padding: 0.4rem 1rem;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  border-radius: 3rem;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

#watchlist-toggle:hover {
  background: #ffffff;
  color: #070b34;
}

/* ── Count badge ─────────────────────────────────────────── */
.watchlist-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #c5a3ff;
  color: #070b34;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  padding: 0 4px;
  box-sizing: border-box;
}

.watchlist-count.hidden {
  display: none;
}

/* ── Bookmark button on movie cards ──────────────────────── */
.bookmark-btn {
  display: block;
  width: calc(100% - 2rem);
  margin: 0.5rem 1rem 1rem;
  padding: 0.45rem 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #E8EAF0;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.bookmark-btn:hover {
  background: rgba(197, 163, 255, 0.15);
  border-color: #c5a3ff;
  color: #c5a3ff;
}

.bookmark-btn--saved {
  background: rgba(197, 163, 255, 0.15);
  border-color: #c5a3ff;
  color: #c5a3ff;
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .watchlist-panel {
    transition: none;
  }
  .watchlist-overlay {
    transition: none;
  }
  .bookmark-btn {
    transition: none;
  }
  #watchlist-close {
    transition: none;
  }
  .watchlist-remove-btn {
    transition: none;
  }
  #watchlist-toggle {
    transition: none;
  }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .watchlist-panel {
    width: 100%;
  }
}
