/* ==========================================================================
   JORNADA DO ALUNO — DESIGN SYSTEM & ESTILOS GERAIS
   Tecnologia que transforma acompanhamento em aprovação.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variáveis e Tokens de Design (HSL & CSS Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Cores Principais */
  --primary-hue: 243;
  --primary: hsl(var(--primary-hue), 75%, 59%);         /* Indigo #4F46E5 */
  --primary-hover: hsl(var(--primary-hue), 75%, 50%);
  --primary-light: hsl(var(--primary-hue), 85%, 96%);
  
  --secondary-hue: 262;
  --secondary: hsl(var(--secondary-hue), 83%, 58%);       /* Violet #7C3AED */
  --secondary-hover: hsl(var(--secondary-hue), 83%, 48%);
  --secondary-light: hsl(var(--secondary-hue), 90%, 96%);

  --teal-hue: 175;
  --teal: hsl(var(--teal-hue), 84%, 32%);              /* Teal #0D9488 */
  --teal-light: hsl(var(--teal-hue), 80%, 95%);

  --emerald-hue: 160;
  --emerald: hsl(var(--emerald-hue), 84%, 39%);          /* Emerald #10B981 */
  --emerald-light: hsl(var(--emerald-hue), 80%, 95%);

  --amber-hue: 38;
  --amber: hsl(var(--amber-hue), 92%, 50%);            /* Amber #F59E0B */
  --amber-light: hsl(var(--amber-hue), 90%, 95%);

  --rose-hue: 350;
  --rose: hsl(var(--rose-hue), 89%, 60%);              /* Rose #F43F5E */
  --rose-light: hsl(var(--rose-hue), 90%, 96%);

  /* Neutros e Superfícies */
  --bg-main: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-subtle: #F1F5F9;
  --border-color: #E2E8F0;
  --border-color-hover: #CBD5E1;

  /* Texto */
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-white: #FFFFFF;

  /* Elevacoes e Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  /* Raio de Borda e Transições */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* --------------------------------------------------------------------------
   2. Reset e Estilos Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.5;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Foco Visível para Acessibilidade */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Topbar e Navegação Responsiva
   -------------------------------------------------------------------------- */
.navbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
}

.brand-logo svg {
  width: 34px;
  height: 34px;
  color: var(--primary);
}

.brand-tag {
  font-size: 0.75rem;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text-main);
  padding: 0.5rem;
}

/* --------------------------------------------------------------------------
   4. Botões e Ações
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-white);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--text-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--text-white);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  color: var(--text-white);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
}

.btn-danger {
  background-color: var(--rose-light);
  color: var(--rose);
}

.btn-danger:hover {
  background-color: var(--rose);
  color: var(--text-white);
}

/* --------------------------------------------------------------------------
   5. Layout Geral de Containers e Grids
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.85rem;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.grid-layout-sidebar {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

/* --------------------------------------------------------------------------
   6. Cards e Componentes Visuais
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Big Numbers e Métricas */
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.indigo { background: var(--primary-light); color: var(--primary); }
.stat-icon.emerald { background: var(--emerald-light); color: var(--emerald); }
.stat-icon.amber { background: var(--amber-light); color: var(--amber); }
.stat-icon.teal { background: var(--teal-light); color: var(--teal); }
.stat-icon.violet { background: var(--secondary-light); color: var(--secondary); }

.stat-value {
  font-size: 2.1rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  margin: 0.5rem 0 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-meta {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.trend-up { color: var(--emerald); font-weight: 600; }
.trend-down { color: var(--rose); font-weight: 600; }

/* --------------------------------------------------------------------------
   7. Barras de Progresso e Badges
   -------------------------------------------------------------------------- */
.progress-bar-container {
  width: 100%;
  background-color: var(--bg-surface-subtle);
  height: 10px;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--emerald-light); color: var(--emerald); }
.badge-warning { background: var(--amber-light); color: var(--amber); }
.badge-danger { background: var(--rose-light); color: var(--rose); }
.badge-neutral { background: var(--bg-surface-subtle); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   8. Avisos de Isenção e Notificações (Alerts)
   -------------------------------------------------------------------------- */
.alert-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.alert-info {
  background-color: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

.alert-warning {
  background-color: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

/* --------------------------------------------------------------------------
   9. Componentes da Tutora Virtual (Lumi)
   -------------------------------------------------------------------------- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tutor-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  gap: 0.75rem;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-bubble {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.5;
}

.message.tutor .message-bubble {
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
  border-top-left-radius: 4px;
}

.message.user .message-bubble {
  background-color: var(--primary);
  color: var(--text-white);
  border-top-right-radius: 4px;
}

.chat-quick-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.5rem;
  background-color: #F8FAFC;
  border-top: 1px solid var(--border-color);
}

.action-pill {
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.action-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.chat-input-area {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  background-color: var(--bg-surface);
}

.chat-input-area input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--primary);
}

/* --------------------------------------------------------------------------
   10. Componentes de Orientação Profissional (Wizard)
   -------------------------------------------------------------------------- */
.wizard-step-container {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.wizard-progress {
  margin-bottom: 2rem;
}

.option-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
  margin-bottom: 0.75rem;
}

.option-card:hover {
  border-color: var(--primary-hover);
  background-color: var(--primary-light);
}

.option-card.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.option-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-card.selected .option-radio {
  border-color: var(--primary);
  background-color: var(--primary);
}

.option-card.selected .option-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

/* --------------------------------------------------------------------------
   11. Rodapé Institucional
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   12. Tabelas e Filtros
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th, .table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background-color: var(--bg-surface-subtle);
  font-weight: 600;
  color: var(--text-muted);
}

.table tr:hover td {
  background-color: #F8FAFC;
}

/* --------------------------------------------------------------------------
   13. Responsividade (Breakpoints)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid-layout-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.show {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  .wizard-step-container {
    padding: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   14. Modal e Componentes de Acompanhamento
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--rose-light);
  color: var(--rose);
}

/* Item Clicável de Estudante */
.estudante-item-clicavel {
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.estudante-item-clicavel:hover {
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* Estado Lido de Comunicados */
.comunicado-box {
  transition: all var(--transition-fast);
}

.comunicado-box.lido {
  background-color: #F0FDF4 !important;
  border-left: 4px solid var(--emerald) !important;
}

