@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #0c1220;
  --card: #11192d;
  --panel: #161f35;
  --text: #eef2ff;
  --muted: #a9b4d0;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --danger: #f472b6;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.08), transparent 25%),
    radial-gradient(circle at 80% 0%, rgba(244, 114, 182, 0.1), transparent 25%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 18, 32, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.logo {
  font-size: 24px;
}

.nav-links {
  display: flex;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(125, 211, 252, 0.1);
  color: var(--accent);
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
}

.controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 14px;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  border-color: rgba(125, 211, 252, 0.7);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.2);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  align-self: start;
}

.card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(125, 211, 252, 0.6);
}

.card__poster {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #0f172a;
}

.card__body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.1);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

.card__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.card__summary {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.card__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.btn {
  border: none;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1224;
  font-weight: 700;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn--danger {
  background: rgba(244, 114, 182, 0.14);
  color: var(--danger);
  border: 1px solid rgba(244, 114, 182, 0.4);
}

.favorites {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  align-self: start;
  position: sticky;
  top: 88px;
}

.favorites__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.favorites__list {
  display: grid;
  gap: 10px;
}

.favorite {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.favorite img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
}

.favorite__title {
  font-weight: 600;
  margin: 0;
}

.favorite__meta {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}

.about {
  grid-column: 1 / -1;
  margin-top: 20px;
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.about__list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal__content {
  background: var(--panel);
  border-radius: 16px;
  max-width: 720px;
  width: min(90vw, 720px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  position: relative;
}

.modal__body {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.detail__header {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
}

.detail__poster {
  width: 100%;
  border-radius: 12px;
  height: 180px;
  object-fit: cover;
}

.detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.detail__cast {
  margin: 0;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .favorites {
    position: static;
    order: 3;
  }

  .cards {
    order: 2;
  }
}

@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .detail__header {
    grid-template-columns: 1fr;
  }
}

