/**
 * EVOLIA - Mobile-First Student Portal Styles
 */

/* Container Mobile-First Responsivo */
.student-viewport {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding-bottom: 90px; /* Espaço para barra inferior fixa no mobile */
}

@media (min-width: 768px) {
  .student-viewport {
    max-width: 740px;
    padding-bottom: 40px;
  }
}

@media (min-width: 992px) {
  .student-viewport {
    max-width: 940px;
    padding-bottom: 40px;
  }
}

/* Barra de Navegação Inferior Fixa (Mobile App Feel) */
.student-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: var(--evolia-nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--evolia-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1040;
  padding: 0 10px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--evolia-text-secondary);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.bottom-nav-item i {
  font-size: 1.3rem;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.bottom-nav-item.active {
  color: var(--evolia-teal);
}

.bottom-nav-item.active i {
  transform: translateY(-2px);
  color: var(--evolia-emerald);
}

.bottom-nav-item:hover {
  color: var(--evolia-teal);
}

/* Card "Continuar de onde parei" */
.resume-banner {
  background: var(--evolia-gradient-accent);
  color: #ffffff;
  border-radius: 1.25rem;
  padding: 1.35rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 210, 133, 0.4);
}

.resume-banner::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Placar de Metas da Equipe */
.team-scoreboard {
  background: var(--evolia-card-bg);
  border: 1px solid var(--evolia-border);
  border-radius: 1.25rem;
  padding: 1.25rem;
}

/* Blocos Verticais do Player de Aula */
.unit-block-vertical {
  background: var(--evolia-card-bg);
  border: 1px solid var(--evolia-border);
  border-radius: 1.25rem;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--evolia-card-shadow);
  transition: border-color 0.2s ease;
}

.unit-block-vertical:hover {
  border-color: rgba(13, 148, 136, 0.35);
}

.block-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.75rem;
  border-radius: 2rem;
  margin-bottom: 0.85rem;
}

/* Bloco Vídeo */
.video-responsive-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  border-radius: 1rem;
  overflow: hidden;
  background: #000;
}

.video-responsive-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Bloco Inteligente: NA SUA PRÁTICA */
.na-sua-pratica-container .nav-pills {
  gap: 0.4rem;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 0.5rem;
}

.na-sua-pratica-container .nav-link {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 2rem;
  padding: 0.45rem 1rem;
  color: var(--evolia-text-secondary);
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .na-sua-pratica-container .nav-link {
  background: rgba(255, 255, 255, 0.05);
}

.na-sua-pratica-container .nav-link.active {
  background: var(--evolia-gradient-accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.na-sua-pratica-box {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(2, 132, 199, 0.04) 100%);
  border: 1.5px solid rgba(13, 148, 136, 0.25);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-top: 1rem;
}

/* Bloco Inteligente: APROFUNDAMENTO */
.accordion-aprofundamento .accordion-item {
  background: transparent;
  border: 1px dashed var(--evolia-teal);
  border-radius: 1rem;
  overflow: hidden;
}

.accordion-aprofundamento .accordion-button {
  background: rgba(13, 148, 136, 0.07);
  color: var(--evolia-text-primary);
  font-weight: 700;
  padding: 1rem 1.25rem;
}

.accordion-aprofundamento .accordion-button:not(.collapsed) {
  background: rgba(13, 148, 136, 0.15);
  color: var(--evolia-teal);
  box-shadow: none;
}

/* Bloco Caso Clínico Interativo (5 Etapas) */
.clinical-case-box {
  border-left: 4px solid var(--evolia-emerald);
}

.patient-badge-card {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--evolia-border);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

[data-bs-theme="dark"] .patient-badge-card {
  background: rgba(255, 255, 255, 0.03);
}

.step-pill-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--evolia-border);
  color: var(--evolia-text-secondary);
}

.step-dot.active {
  background: var(--evolia-gradient-accent);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 210, 133, 0.5);
}

.step-dot.completed {
  background: var(--evolia-emerald);
  color: #ffffff;
}

.step-dot.wrong {
  background: #ef4444;
  color: #ffffff;
}

.case-option-card {
  border: 1.5px solid var(--evolia-border);
  border-radius: 0.85rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  background: var(--evolia-bg-surface);
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.case-option-card:hover {
  border-color: var(--evolia-teal);
  background: rgba(13, 148, 136, 0.04);
}

.case-option-card.selected-correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.case-option-card.selected-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.case-feedback-box {
  border-radius: 0.85rem;
  padding: 1rem;
  margin-top: 1rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ferramenta de Bolso (Offline Flowchart) */
.flowchart-step-card {
  background: var(--evolia-bg-surface);
  border: 1px solid var(--evolia-border);
  border-left: 4px solid var(--evolia-teal);
  border-radius: 0.75rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.65rem;
  position: relative;
}

.flowchart-arrow-down {
  text-align: center;
  color: var(--evolia-teal);
  font-size: 1.2rem;
  margin: -0.25rem 0 0.4rem 0;
}

/* 7. Botão Favoritar e Filtros do Catálogo de Cursos */
.btn-icon-favorite {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.btn-icon-favorite:hover {
  transform: scale(1.15);
}

.btn-icon-favorite.is-fav {
  background: rgba(239, 68, 68, 0.12) !important;
}

.btn-icon-favorite.is-fav i {
  color: #ef4444 !important;
  animation: heartPulse 0.35s ease;
}

@keyframes heartPulse {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.catalog-filters {
  background: var(--evolia-bg-surface, rgba(255, 255, 255, 0.6));
}

.catalog-filters .filter-btn {
  border: none;
  font-size: 0.76rem;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--evolia-text-secondary);
}

.catalog-filters .filter-btn.active {
  background: var(--evolia-teal, #0d9488);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}

.catalog-filters .filter-btn.active i {
  color: #ffffff !important;
}

/* Visualizador Integrado de PDF e Mídias */
.pdf-viewer-container {
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--evolia-border);
  background-color: #323639;
}

[data-bs-theme="dark"] .pdf-viewer-container {
  border-color: rgba(255, 255, 255, 0.1);
  background-color: #202124;
}

.video-native-wrapper video {
  display: block;
  width: 100%;
}

/* ============================================================== */
/* EVOLIA TUTOR IA - PRECEPTOR CLÍNICO FLUTUANTE                  */
/* ============================================================== */
.evolia-tutor-launcher {
  position: fixed;
  bottom: 85px;
  right: 24px;
  z-index: 1040;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0d9488 0%, #0f172a 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  padding: 0.65rem 1.15rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.evolia-tutor-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 28px -5px rgba(13, 148, 136, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  color: #ffffff;
}

.evolia-tutor-icon-box {
  position: relative;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.tutor-pulse-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: tutorPulse 1.8s infinite;
}

@keyframes tutorPulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tutor-offcanvas {
  width: 440px !important;
  max-width: 95vw !important;
  border-left: 1px solid var(--evolia-border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  background: var(--evolia-bg-base);
}

.tutor-chat-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tutor-messages-scroll {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tutor-bubble {
  max-width: 88%;
  padding: 0.85rem 1.1rem;
  border-radius: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  position: relative;
}

.tutor-bubble-ai {
  align-self: flex-start;
  background: var(--evolia-bg-surface);
  border: 1px solid var(--evolia-border);
  border-top-left-radius: 0.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tutor-bubble-ai p:last-child {
  margin-bottom: 0;
}

.tutor-bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  color: #ffffff;
  border-top-right-radius: 0.2rem;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.tutor-suggestions-pills {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.5rem 1rem;
  scrollbar-width: thin;
  background: rgba(13, 148, 136, 0.04);
  border-top: 1px solid var(--evolia-border);
  border-bottom: 1px solid var(--evolia-border);
}

.tutor-suggestion-btn {
  white-space: nowrap;
  font-size: 0.74rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--evolia-border);
  background: var(--evolia-bg-surface);
  color: var(--evolia-text-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.tutor-suggestion-btn:hover {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

.tutor-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 8px;
}

.tutor-typing-dots span {
  width: 6px;
  height: 6px;
  background-color: #0d9488;
  border-radius: 50%;
  animation: tutorTyping 1.4s infinite ease-in-out both;
}

.tutor-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.tutor-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes tutorTyping {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================================== */
/* SIMULAÇÃO CLÍNICA COM TEMPORIZADOR DE DECISÃO CRÍTICA          */
/* ============================================================== */
.case-timer-wrapper {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--evolia-border);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.85rem;
  transition: all 0.3s ease;
}

.case-timer-bar-container {
  height: 6px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.case-timer-bar {
  height: 100%;
  width: 100%;
  transition: width 1s linear, background-color 0.4s ease;
}

.case-timer-critical {
  animation: timerCriticalBlink 1s infinite alternate;
}

@keyframes timerCriticalBlink {
  from { border-color: rgba(239, 68, 68, 0.3); box-shadow: 0 0 4px rgba(239, 68, 68, 0.2); }
  to { border-color: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
}

