/* ARQUIVO: assets/css/site.css */

:root {
  --primary: #0b57d0;
  --primary-hover: #0842a0;
  --bg-light: #f8f9fa;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  padding-bottom: 60px;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
  box-sizing: border-box;
  width: 100%;
}

/* HERO SECTION */
.hero {
  text-align: center;
  padding: 50px 20px;
  background: white;
  border-radius: 16px;
  margin-bottom: 40px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

/* No CSS da index.html */
.btn-primary {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
}

.btn-outline-secondary.disabled {
    border-color: var(--line);
    color: var(--text-muted);
}
.hero h1 { font-size: 2rem; font-weight: 800; color: #111; margin: 10px 0; }
.hero p { font-size: 1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 20px auto; }
.hero .badge { background: #eff6ff; color: var(--primary); padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 0.8rem; display: inline-block; }

/* GRID */
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 25px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.section-title h2 { font-size: 1.5rem; margin: 0; font-weight: 700; color: #111; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; width: 100%; }

/* === CARD DE CURSO (ESTRUTURA FIXA) === */
.course-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%; /* Garante altura igual */
}
.course-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.06); border-color: var(--primary); }

.card-header-img {
  height: 140px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.15); font-size: 3.5rem;
  flex-shrink: 0;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Ocupa o espaço restante */
}

/* Título e Badge */
.badge-course {
  font-size: 0.7rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px;
}
.card-title {
  font-size: 1.2rem; font-weight: 800; color: var(--primary);
  margin: 0 0 15px 0; line-height: 1.3;
}

/* Área de Informações (Meio do Card) */
.card-meta {
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Barra de Progresso */
.progress-info {
    display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 5px; color: #555;
}
.progress-container {
    width: 100%; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden;
}
.progress-bar {
    height: 100%; background: #10b981; border-radius: 4px; width: 0%; transition: width 0.5s ease;
}

/* Rodapé do Card (Botão sempre embaixo) */
.card-footer {
  margin-top: auto; /* Empurra para o final */
  padding-top: 15px;
  border-top: 1px solid #f3f4f6;
}

/* Botão de Ação */
.btn-enroll {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 12px; border-radius: 8px; border: none;
  background-color: var(--primary); color: white;
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  cursor: pointer; transition: background 0.2s;
  box-sizing: border-box;
}
.btn-enroll:hover { background-color: var(--primary-hover); color: white; }
.btn-enroll:disabled { background-color: #e5e7eb; color: #999; cursor: not-allowed; }
.btn-enroll i { margin-right: 6px; font-size: 1.1rem; }

/* Variação de cor para botão "Acessar" */
.btn-access { background-color: #10b981; }
.btn-access:hover { background-color: #059669; }

/* =========================================================
   HOME (index.html) — filtros, badges, toast, loader
   Cole no FINAL do assets/css/site.css
   ========================================================= */

/* Cursor do perfil (antes era injetado no JS) */
#header-name,
#header-avatar-initials,
.profile-header-card {
  cursor: pointer !important;
}

/* Loader padrão da Home */
.home-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
}
.home-loading i {
  font-size: 2.5rem;
  opacity: 0.6;
  display: inline-block;
}
.home-loading p {
  margin: 12px 0 0;
  font-size: 0.95rem;
}

/* Filtros (chips) */
.home-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
  align-items: center;
}

.home-filter-btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.06s ease, background 0.12s ease, border-color 0.12s ease;
}

.home-filter-btn:active {
  transform: scale(0.98);
}

.home-filter-btn.is-active {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.35);
  color: #0b3a86;
}

/* Badges (ciclo + inscrição) */
.home-badges {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.home-badge {
  background-color: rgba(0, 0, 0, 0.60);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.70rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  backdrop-filter: blur(2px);
  white-space: nowrap;
}

/* Estados do botão (sem inline) */
.btn-enroll.btn-muted {
  background-color: #e5e7eb;
  color: #777;
}
.btn-enroll.btn-muted:hover {
  background-color: #e5e7eb;
  color: #777;
}

.btn-enroll.btn-wait {
  background-color: #ffc107;
  color: #333;
  cursor: default;
  opacity: 1;
}
.btn-enroll.btn-wait:hover {
  background-color: #ffc107;
  color: #333;
}

/* Estilos principais para os Cards */
.class-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%; /* Garante altura igual */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px; /* Para garantir que os cards não se sobreponham */
}

.class-cover img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.class-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Cor do texto e badge */
.class-badge {
    background-color: #007bff;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.class-actions {
    margin-top: 10px;
}

/* Botão para ações */
.btn-enroll {
    display: flex;
    justify-content: center;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-enroll:hover {
    background-color: var(--primary-hover);
}

.btn-enroll:disabled {
    background-color: #e5e7eb;
    color: #999;
    cursor: not-allowed;
}

/* Estilo para o botão de "Acessar Sala" */
.btn-access {
    background-color: #10b981;
}

.btn-access:hover {
    background-color: #059669;
}

/* Ajuste para a área de texto dentro dos cards */
.card-meta {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Toasts de Alerta (SweetAlert2) */
.home-loading {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
}

.home-loading i {
    font-size: 2.5rem;
    opacity: 0.6;
    display: inline-block;
}

.home-loading p {
    margin: 12px 0 0;
    font-size: 0.95rem;
}

/* Filtros de Status */
.home-badge {
    background-color: rgba(0, 0, 0, 0.60);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.70rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    backdrop-filter: blur(2px);
    white-space: nowrap;
}
/* SweetAlert2 Toast - Ajustes de visibilidade */
.swal2-toast {
  z-index: 9999 !important; /* Certifique-se de que o toast não será ocultado por outros elementos */
  background-color: rgba(0, 0, 0, 0.75) !important; /* Fundo mais escuro para visibilidade */
  color: #fff !important; /* Texto branco */
  border-radius: 6px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) !important;
}

/* =========================================================
   HOME (index.html) — Modal de detalhes do curso (SweetAlert2)
   ========================================================= */

.course-card.js-course-card {
  position: relative;
  cursor: pointer;
}

.course-card.js-course-card .btn-enroll {
  cursor: pointer;
}

.course-modal {
  text-align: left;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.course-modal-cover {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0f172a;
}

.course-modal-cover.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 3.2rem;
}

.course-modal-body {
  padding: 14px 16px 16px;
}

.course-modal-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(11, 87, 208, 0.10);
  color: #0b57d0;
}

.course-modal-title {
  margin: 10px 0 10px;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.25;
  color: #0b57d0;
}

.course-modal-list {
  margin: 0;
  padding: 0 0 0 18px;
  color: #334155;
  font-size: 0.92rem;
}

.course-modal-list li {
  margin: 6px 0;
}

.course-modal-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  color: #475569;
  font-size: 0.90rem;
  line-height: 1.35;
}

.course-modal-extra {
  margin: 12px 0 0;
  font-size: 0.92rem;
  color: #334155;
}
