:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --text: #26221c;
  --text-muted: #6b6459;
  --accent: #8a3324;
  --accent-2: #c9a86a;
  --border: #e5e0d6;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --surface: #211e18;
    --text: #f1ede4;
    --text-muted: #a89f8f;
    --accent: #d98a6f;
    --accent-2: #c9a86a;
    --border: #34301f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header.site-header {
  padding: 2rem 1.25rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

header.site-header h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--accent);
}

header.site-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.filters {
  max-width: 900px;
  margin: 1.25rem auto 0;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.filters input {
  flex: 1 1 220px;
}

.filters select {
  flex: 0 1 220px;
}

.filters__checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.filters__checkbox input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.status {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
}

.status--error {
  color: var(--accent);
}

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

.ciclo {
  margin-bottom: 2.5rem;
}

.ciclo h2 {
  font-size: 1.3rem;
  color: var(--accent);
  border-bottom: 2px solid var(--accent-2);
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
}

.aula {
  margin-bottom: 1.75rem;
}

.aula__header h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.aula__objetivo {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.video-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.video-card--watched {
  opacity: 0.55;
}

.video-card--watched:hover {
  opacity: 0.85;
}

.video-card__link {
  display: block;
  text-decoration: none;
  color: var(--text);
}

.video-card__link--disabled {
  opacity: 0.5;
  pointer-events: none;
}

.video-card__watch-toggle {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.video-card__watch-toggle:hover {
  background: rgba(0, 0, 0, 0.55);
}

.video-card--watched .video-card__watch-toggle {
  background: #4a7c59;
  border-color: #4a7c59;
}

.video-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--border);
}

.video-card__thumb--playlist {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--border);
}

.video-card__body {
  padding: 0.7rem 0.8rem 0.85rem;
}

.video-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.video-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

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

.badge {
  font-family: system-ui, sans-serif;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

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

.badge--secondary {
  background: var(--accent-2);
  color: #3a2f14;
}

.badge--done {
  background: #4a7c59;
  color: #fff;
}
