/* ===== Tokens de tema (padrão Shadcn UI — dark / zinc) ===== */
:root {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #18181b;
  --card-foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
  --input: #27272a;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --accent: #6366f1;
  --destructive: #ef4444;
  --ring: #52525b;
  --radius: 0.65rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.subtitle {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}
.badge-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  white-space: nowrap;
}

/* ===== Layout (grid: form + catálogo) ===== */
.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.75rem;
  align-items: start;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

/* ===== Card (componente base Shadcn) ===== */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-card { position: sticky; top: 1.5rem; }
.card-header { padding: 1.25rem 1.25rem 0; }
.card-title { font-size: 1.1rem; font-weight: 600; }
.card-description {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: 0.2rem;
}
.card-content { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

/* ===== Form fields ===== */
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.82rem; font-weight: 500; }
.field input,
.field textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--foreground);
  background: transparent;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 0.2rem);
  padding: 0.55rem 0.7rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Só o textarea pode redimensionar (vertical). Inputs ficam fixos. */
.field input { resize: none; }
.field textarea { resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted-foreground); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.35);
}

/* ===== Button ===== */
.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: calc(var(--radius) - 0.2rem);
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.form-error {
  color: var(--destructive);
  font-size: 0.82rem;
  margin-top: -0.25rem;
}

/* ===== Grid de filmes ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* ===== Card de filme ===== */
.movie-card {
  position: relative;            /* ancora a badge de nota */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--ring);
}
.movie-nota {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 9999px;
  padding: 0.2rem 0.55rem;
}
.movie-categoria {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--muted);
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
}
.movie-nome {
  font-size: 1.05rem;
  font-weight: 600;
  padding-right: 2.5rem;          /* espaço para a badge de nota */
}
.movie-descricao {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  flex: 1;
}
.movie-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.btn-delete {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.25rem);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-delete:hover {
  color: var(--destructive);
  border-color: var(--destructive);
  background: rgba(239, 68, 68, 0.08);
}

/* ===== Estado vazio ===== */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted-foreground);
}
.empty-state p { font-weight: 500; color: var(--foreground); }
.empty-state span { font-size: 0.88rem; }
