/* ─── NAV ─────────────────────────────────────── */

.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(12, 17, 32, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topnav-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-brand {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.topnav-center {
  position: absolute;
  left: 50%;
  translate: -50% 0;
}

.nav-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r8);
}

.nav-tab {
  height: 28px;
  padding: 0 13px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.nav-tab:hover { color: var(--text); }
.nav-tab.active { background: var(--bg-elevated); color: var(--text); }

.topnav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  background: rgba(251,146,60,0.08);
  border: 1px solid rgba(251,146,60,0.15);
  border-radius: var(--r999);
  font-size: 0.775rem;
  font-weight: 600;
  color: #fb923c;
}

.xp-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  background: var(--green-dim);
  border: 1px solid var(--green-line);
  border-radius: var(--r999);
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--green);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #0c1120;
  font-size: 0.625rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r8);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-logout:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-mid);
}

/* ─── HERO BANNER (imagem real) ───────────────── */

.hero-banner {
  position: relative;
  width: 100%;
  line-height: 0;
  border-bottom: 1px solid var(--border);
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 480px;
  object-fit: cover;
  object-position: center;
}

/* Área clicável transparente sobre o botão visual do banner */
.banner-cta-area {
  position: absolute;
  bottom: 18%;
  right: 7%;
  width: 22%;
  height: 14%;
  border-radius: 8px;
  cursor: pointer;
}

/* ─── CONTENT AREA ────────────────────────────── */

.home-main { flex: 1; padding-bottom: 72px; }

.content-wrap {
  max-width: 960px;
  margin: 36px auto 0;
  padding: 0 28px;
}

/* ─── FEATURED CARD ───────────────────────────── */

.featured-card {
  position: relative;
  border-radius: var(--r16);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  margin-bottom: 28px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.featured-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 12px 48px rgba(0,0,0,0.45);
}

.featured-thumb {
  aspect-ratio: 21 / 9;
  position: relative;
  overflow: hidden;
}

.featured-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s var(--ease);
}

.featured-card:hover .featured-thumb img { transform: scale(1.02); }

/* Overlay escuro bottom-up */
.featured-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12,17,32,0.9) 0%, rgba(12,17,32,0.2) 55%, transparent 100%);
  z-index: 0;
}

.featured-overlay { z-index: 1; }

/* Info dentro do thumb */
.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 28px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.featured-overlay-left { flex: 1; min-width: 0; }

.featured-tag {
  display: inline-block;
  height: 20px;
  padding: 0 8px;
  background: var(--green);
  color: #0c1120;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  line-height: 20px;
  margin-bottom: 8px;
}

.featured-title {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 3px;
}

.featured-meta {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}

.btn-featured {
  flex-shrink: 0;
  height: 38px;
  padding: 0 20px;
  background: var(--green);
  color: #0c1120;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: var(--r8);
  transition: filter 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-featured:hover { filter: brightness(1.08); }
.btn-featured:active { transform: scale(0.97); }

/* Progress bar no featured */
.featured-progress {
  padding: 0 28px 16px;
  background: var(--bg-raised);
}

.featured-progress-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.featured-progress-label {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.featured-progress-track {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.featured-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.9s var(--ease);
}

.featured-progress-pct {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

/* ─── SECTION LABEL ───────────────────────────── */

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

/* ─── STAT ROW ────────────────────────────────── */

.stat-row {
  display: flex;
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r12);
  overflow: hidden;
  margin-bottom: 28px;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 22px;
}

.stat-item--progress { flex: 2; }

.stat-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

.stat-val {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-val.green { color: var(--green); }
.stat-val.small { font-size: 0.8rem; }

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

.stat-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.9s var(--ease);
}

/* ─── AULAS GRID ──────────────────────────────── */

.aulas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.aula-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r12);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.aula-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.aula-card.current {
  border-color: var(--green-line);
}

.aula-card.current:hover {
  border-color: rgba(34,197,94,0.4);
  box-shadow: 0 8px 24px rgba(34,197,94,0.1);
}

.aula-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-elevated);
}

.aula-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}

.aula-card:hover .aula-thumb img { transform: scale(1.04); }

/* Check overlay — aula concluída */
.aula-check {
  position: absolute;
  inset: 0;
  background: rgba(12,17,32,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.aula-check svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 8px rgba(34,197,94,0.5));
}

/* Play overlay — aula atual */
.aula-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12,17,32,0.3);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}

.aula-card.current .aula-play { opacity: 1; }
.aula-card:hover .aula-play { opacity: 1; }

.aula-play svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.6));
}

/* Footer */
.aula-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  gap: 6px;
}

.aula-num {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.aula-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.done-label { color: var(--green); font-weight: 600; }
.current-label { color: var(--green); font-weight: 700; }

/* ─── ACHIEVEMENTS ────────────────────────────── */

.achievements-section { margin-top: 4px; }

.achiev-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.achiev-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r12);
  transition: border-color 0.2s;
}

.achiev-row.done {
  border-color: var(--green-line);
}

.achiev-row.done:hover {
  border-color: rgba(34,197,94,0.3);
}

.achiev-row.locked { opacity: 0.4; }

.achiev-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.achiev-info { flex: 1; min-width: 0; }

.achiev-name {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: block;
}

.achiev-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.achiev-xp {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-line);
  padding: 3px 10px;
  border-radius: var(--r999);
  flex-shrink: 0;
}

.achiev-row.locked .achiev-xp {
  color: var(--text-faint);
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
}

.achiev-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.achiev-reward-badge {
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: var(--r999);
  border: 1px solid;
  white-space: nowrap;
}

.achiev-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-mid);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achiev-row.done .achiev-check {
  background: var(--green);
  border-color: var(--green);
  color: #0c1120;
}

.achiev-row.done:hover {
  background: var(--bg-elevated);
  border-color: var(--border-mid);
}

/* ─── RESPONSIVE ──────────────────────────────── */

@media (max-width: 900px) {
  .aulas-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .topnav { padding: 0 16px; }
  .topnav-center { display: none; }

  .content-wrap { padding: 0 16px; }

  .stat-row { flex-wrap: wrap; }
  .stat-sep { display: none; }
  .stat-item { flex: 1 1 40%; padding: 12px 16px; }
  .stat-item--progress { flex: 1 1 100%; border-top: 1px solid var(--border); }

  .featured-overlay { flex-direction: column; align-items: flex-start; gap: 12px; }
  .featured-title { font-size: 1.125rem; }

  .aulas-grid { grid-template-columns: repeat(2, 1fr); }
  .achiev-row { padding: 12px 14px; }
}

@media (max-width: 480px) {
  .aulas-grid { grid-template-columns: repeat(2, 1fr); }
}
