/* =========================================
   RESET + BASE
========================================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* =========================================
   VARIÁVEIS DE TEMA (LIGHT / DARK)
========================================= */
:root {
  --bg-body: #f4f5f7;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  --border-soft: #dde1e7;
  --text-main: #222;
  --text-muted: #6c757d;
  --primary: #4e6bff;
  --primary-soft: rgba(78, 107, 255, 0.12);
  --danger: #e55353;
  --success: #2fb380;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

body.dark {
  --bg-body: #050816;
  --bg-card: #0b1020;
  --bg-header: #050816;
  --bg-input: #111827;
  --border-soft: #1f2937;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --shadow-soft: 0 10px 40px rgba(0,0,0,0.5);
}

/* =========================================
   UTILITÁRIOS
========================================= */

.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}


.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.text-center {
  text-align: center;
}

.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.25rem; }
.mt-4 { margin-top: 2rem; }

/* =========================================
   HEADER / NAVBAR (INDEX + OUTRAS)
========================================= */

.header,
.topbar {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header .nav,
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
}

.logo span {
  color: var(--primary);
}

.nav,
nav.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav a,
nav.nav a,
.nav button {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text-main);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: 0.2s;
}

.nav a:hover,
nav.nav a:hover,
.nav button:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-login {
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
}

/* Sanduíche simples em telas menores (sem JS) */
@media (max-width: 720px) {
  .nav,
  nav.nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* =========================================
   BOTÕES
========================================= */

.btn,
.btn-primary,
.btn-outline,
.btn-small,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: 0.2s;
}

.btn-primary,
.btn {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn:hover {
  filter: brightness(0.95);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-soft);
}

.btn-small {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(0.92);
}

/* =========================================
   HERO (INDEX)
========================================= */

.hero {
  padding: 3rem 0 2rem;
}

.hero-box {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2rem, 3vw, 2.6rem);
  margin-bottom: 0.8rem;
}

.hero-text p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 34rem;
}

.hero-img {
  max-width: 360px;
  justify-self: center;
}

@media (max-width: 900px) {
  .hero-box {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-text p {
    margin-inline: auto;
  }
}

/* =========================================
   SEÇÕES GENÉRICAS (TÍTULOS + GRIDS)
========================================= */

section {
  padding: 2.5rem 0;
}

section h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

/* =========================================
   CARDS / PROFESSORES / CURSOS
========================================= */

.card,
.teacher-card,
.form-card,
.table-wrapper,
.aula-sidebar,
.user-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.card h3,
.teacher-card h3 {
  margin-bottom: 0.3rem;
}

.card p,
.teacher-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.icon {
  width: 42px;
  height: 42px;
  margin-bottom: 0.8rem;
}

.teacher-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.75rem;
  border: 2px solid var(--primary-soft);
}

/* Badge categoria */
.badge-categoria {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}

/* Cards de aula */
.aula-card .aula-descricao {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* =========================================
   FORMULÁRIOS (LOGIN, REGISTER, ADMIN, ETC)
========================================= */

.form-card h1,
.form-card h2 {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

label span {
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* =========================================
   TABELAS (ADMIN, DASHBOARD)
========================================= */

.table-wrapper h2 {
  margin-bottom: 0.8rem;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: rgba(148, 163, 184, 0.15);
}

th,
td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  text-align: left;
}

tr:last-child td {
  border-bottom: none;
}

/* =========================================
   ALERTS (ERRO / SUCESSO)
========================================= */

.alert {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.alert-error {
  background: #fee2e2;
  color: #b91c1c;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
}

/* =========================================
   LAYOUT AULA (VIDEO + SIDEBAR)
========================================= */

.aula-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr);
  gap: 1.6rem;
  align-items: flex-start;
}

.aula-player-wrapper iframe {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-soft);
}

.aula-descricao {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

.aula-sidebar h3 {
  margin-bottom: 0.6rem;
}

.modulo-bloco + .modulo-bloco {
  margin-top: 1rem;
}

.modulo-bloco h4 {
  margin-bottom: 0.3rem;
}

.lista-aulas {
  list-style: none;
  padding-left: 0.4rem;
}

.lista-aulas li a {
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
}

.lista-aulas li a:hover {
  color: var(--primary);
}

/* Aula layout responsivo */
@media (max-width: 900px) {
  .aula-layout {
    grid-template-columns: 1fr;
  }
  .aula-player-wrapper iframe {
    height: 260px;
  }
}

/* =========================================
   ÁREA DO USUÁRIO / PERFIL
========================================= */

.user-area {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr);
  gap: 1.8rem;
}

.user-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.user-photo {
  text-align: center;
}

.user-photo img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-soft);
  margin-bottom: 0.4rem;
}

.user-photo input[type="file"] {
  font-size: 0.78rem;
}

.user-info input {
  margin-bottom: 0.6rem;
}

.stats-info p {
  margin-top: 0.2rem;
}

/* Responsivo user-card */
@media (max-width: 720px) {
  .user-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* =========================================
   DASHBOARD CARDS (ADMIN)
========================================= */

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.dashboard-cards .card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

/* =========================================
   BUSCA GLOBAL
========================================= */

#resCursos.card,
#resModulos.card,
#resAulas.card {
  text-align: left;
}

/* =========================================
   BOTÃO FLUTUANTE (WHATSAPP / AJUDA)
========================================= */

.btn-flutuante {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  font-size: 1.4rem;
  text-decoration: none;
  z-index: 60;
}

/* =========================================
   FOOTER
========================================= */

.footer {
  padding: 2rem 0 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* =========================================
   RESPONSIVIDADE GLOBAL
========================================= */

@media (max-width: 600px) {
  section {
    padding: 2rem 0;
  }
  .hero {
    padding-top: 2rem;
  }
}

.curso-header {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
}

.curso-thumb {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.curso-descricao {
  margin-top: .6rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.curso-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

.curso-progress {
  margin-top: 1rem;
}

.progressbar {
  width: 100%;
  height: 12px;
  background: var(--border-soft);
  border-radius: 999px;
  margin-top: .3rem;
  position: relative;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: .4s;
}

/* Responsivo */
@media (max-width: 900px) {
  .curso-header {
    grid-template-columns: 1fr;
  }
}

/* ANIMAÇÃO SUAVE DAS SEÇÕES */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animação dos cards e módulos */
.modulo-bloco {
  animation: slideUp 0.7s ease both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hover das aulas */
.lista-aulas a {
  display: block;
  padding: 4px 6px;
  border-radius: 6px;
  transition: 0.2s;
}

.lista-aulas a:hover {
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateX(4px);
}

/* Animação da barra de progresso */
#progressFill {
  transition: width 0.8s ease;
}

/* Player suave */
.video-wrapper {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  animation: fadeIn 0.8s ease;
}


