/* ==========================================================================
   1. VARIÁVEIS E RESET (ROOT & DARK MODE)
   ========================================================================== */
:root {
    --primary: #c1121f; 
    --primary-dark: #a4161a; 
    --secondary: #003049; 
    --accent: #f77f00;
    --dark-text: #1a202c; 
    --light-text: #2d3748; 
    --light-bg: #f8f9fa; 
    --success: #2a9d8f;
    --info-bg: #e6f4ff; 
    --info-border: #90cdf4; 
    --panel-bg: #ffffff; 
    --border-color: #e2e8f0;
    
    /* Cores Específicas do Novo Design */
    --brand-orange: #f97316;
    --brand-dark: #111827;
}

.dark {
    --primary: #d90429; 
    --primary-dark: #c1121f; 
    --secondary: #1d3557; 
    --accent: #ff9e00;
    --dark-text: #edf2f4; 
    --light-text: #d1d5db; 
    --light-bg: #111827; 
    --success: #2a9d8f;
    --info-bg: #1e3a8a; 
    --info-border: #3b82f6; 
    --panel-bg: #1f2937; 
    --border-color: #374151;
}

body { 
    font-family: 'Lato', sans-serif; 
    scroll-behavior: smooth; 
    background-color: var(--light-bg); 
    color: var(--dark-text); 
    padding-bottom: 70px; /* Espaço para menu mobile */
    transition: background-color 0.3s, color 0.3s; 
}

@media (max-width: 1024px) {
    .main-content-container {
        padding-top: 12.5rem !important; 
    }
    body { padding-bottom: 80px; }
}

@media (min-width: 1024px) { 
    body { padding-bottom: 0; } 
}

h1, h2, h3 { font-family: 'Lora', serif; }

/* ==========================================================================
   2. ANIMAÇÕES GERAIS
   ========================================================================== */
.floating { animation: floating 3s ease-in-out infinite; }
@keyframes floating { 
    0% { transform: translateY(0px); } 
    50% { transform: translateY(-8px); } 
    100% { transform: translateY(0px); } 
}

.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 
    0% { transform: scale(1); } 
    50% { transform: scale(1.03); } 
    100% { transform: scale(1); } 
}

.pulse-button { animation: pulse-glow 2s infinite; }
@keyframes pulse-glow { 
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); transform: scale(1); } 
    50% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); transform: scale(1.05); } 
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); transform: scale(1); } 
}

@keyframes slideInRight { 
    from { transform: translateX(100%); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}
.animate-slide-in { animation: slideInRight 0.5s ease-out forwards; }

@keyframes gradient-x { 
    0% { background-position: 0% 50%; } 
    50% { background-position: 100% 50%; } 
    100% { background-position: 0% 50%; } 
}
.animate-gradient { animation: gradient-x 3s ease infinite; }

/* ANIMAÇÃO DEGRADÊ DOURADO - DESENVOLVEDOR (CORREÇÃO PEDIDO 5) */
.developer-credit {
    background: linear-gradient(to right, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine-gold 4s linear infinite;
    font-weight: 800;
    letter-spacing: 0.5px;
}
@keyframes shine-gold { 
    to { background-position: 200% center; } 
}

/* ==========================================================================
   3. LAYOUT E HEADER
   ========================================================================== */
#main-header { 
    backdrop-filter: blur(16px); 
    -webkit-backdrop-filter: blur(16px); 
}
#main-header.scrolled { 
    background-color: rgba(255, 255, 255, 0.9); 
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); 
}
.dark #main-header.scrolled { 
    background-color: rgba(17, 24, 39, 0.9); 
}

/* Barra de Progresso Sticky */
.sticky-progress-wrapper {
    position: sticky;
    top: 5.5rem; 
    z-index: 39; 
    padding: 0.75rem 0; 
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    color: var(--light-text);
    transition: top 0.3s ease;
}

@media (max-width: 1024px) { 
    .sticky-progress-wrapper { 
        top: 110px; 
    } 
}
.dark .sticky-progress-wrapper { background-color: rgba(17, 24, 39, 0.85); color: var(--light-text); }

@keyframes progress-gradient-flow { 
    0% { background-position: 200% center; } 
    100% { background-position: 0% center; } 
}
#progress-bar-minimal {
    position: absolute; bottom: 0; left: 0; width: 0%; height: 4px;        
    background: linear-gradient(90deg, var(--accent), var(--primary), var(--accent));
    background-size: 200% auto; transition: width 0.5s ease; z-index: 40; 
    animation: progress-gradient-flow 3s linear infinite;
    box-shadow: 0 0 10px var(--accent);
}
.dark #progress-bar-minimal { box-shadow: 0 0 12px var(--accent); }

/* Sidebar */
#off-canvas-sidebar { background-color: var(--panel-bg); }
#off-canvas-sidebar.open { transform: translateX(0); }
.sidebar-overlay { transition: opacity 0.3s; }
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }
.sidebar { 
    background: var(--panel-bg); 
    padding: 1.5rem; 
    border-radius: 1rem; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.07); 
    border: 1px solid var(--border-color); 
}

/* MODO EXAME/PROVA - CORREÇÃO DE ERRO VISUAL (PEDIDO 1) */
body.exam-mode #main-header,
body.exam-mode #sticky-progress-wrapper,
body.exam-mode footer,
body.exam-mode #back-to-top,
body.exam-mode #mobile-menu-button,
body.exam-mode nav.md\:hidden,
body.exam-mode aside.sidebar {
    display: none !important;
}

/* Ajusta o padding quando o header some para não ficar espaço branco */
body.exam-mode .container.main-content-container {
    padding-top: 1rem !important;
}
body.exam-mode .lg\:w-2\/3 {
    width: 100% !important; /* Ocupa tela toda */
}

/* ==========================================================================
   4. BOTÕES E UI ELEMENTS
   ========================================================================== */
.action-button {
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, #c1121f, #f77f00);
  color: #fff; font-weight: 700; padding: 0.85rem 2rem;
  border-radius: 0.6rem; border: none; cursor: pointer;
  box-shadow: 0 4px 10px rgba(193, 18, 31, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.5s ease;
}
.action-button:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 8px 20px rgba(247, 127, 0, 0.4); 
    background: linear-gradient(90deg, #f77f00, #c1121f); 
}
.action-button:active { transform: scale(0.98); }
.action-button:disabled { 
    background: #bdbdbd; color: #6c757d; cursor: not-allowed; box-shadow: none; 
}

.action-button .ripple, .quiz-option .ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  animation: ripple-effect 0.6s linear; pointer-events: none;
}
:root .action-button .ripple { background: rgba(255, 255, 255, 0.7); }
.dark .action-button .ripple { background: rgba(247, 127, 0, 0.45); }
@keyframes ripple-effect { to { transform: scale(4); opacity: 0; } }

.drive-button { 
    display: flex; align-items: center; justify-content: center; width: 100%; 
    padding: 1.25rem; margin: 2rem 0; background: linear-gradient(135deg, #3b82f6, #2563eb); 
    color: white; font-weight: bold; border-radius: 1rem; text-decoration: none; 
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2); transition: all 0.3s ease; 
    border: 1px solid rgba(255,255,255,0.1); 
}
.drive-button:hover { 
    transform: translateY(-3px); box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4); 
    background: linear-gradient(135deg, #2563eb, #1d4ed8); 
}
.drive-button i { font-size: 1.5rem; margin-right: 0.75rem; }

/* ==========================================================================
   5. FUNCIONALIDADES E TOOLS
   ========================================================================== */
#back-to-top.action-button {
    border-radius: 50% !important; 
    width: 40px !important;       
    height: 40px !important;       
    padding: 0 !important;         
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    bottom: 20px !important;       
    right: 20px !important;
    font-size: 1.2rem !important;
    z-index: 48 !important;        
    background: var(--secondary);
    opacity: 0.9;
}
#back-to-top.action-button:hover {
    opacity: 1;
    transform: translateY(-5px);
}

#accessibility-fab {
    position: fixed; bottom: 80px; right: 20px; z-index: 49;
    width: 45px; height: 45px; border-radius: 50%; background-color: var(--accent);
    color: white; box-shadow: 0 4px 12px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; transition: transform 0.3s ease;
}
#accessibility-fab:hover { transform: scale(1.1); }

#accessibility-menu {
    position: fixed; bottom: 140px; right: 20px; background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 1rem; padding: 1rem; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 49; display: flex; flex-direction: column; gap: 0.5rem; min-width: 200px; opacity: 0; pointer-events: none; transform: translateY(20px); transition: all 0.3s ease;
}
#accessibility-menu.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

.acc-btn {
    background: var(--light-bg); border: 1px solid var(--border-color); padding: 0.5rem; border-radius: 0.5rem; text-align: left; cursor: pointer; display: flex; align-items: center; font-size: 0.9rem; color: var(--dark-text);
}
.acc-btn:hover { background: var(--info-bg); }
.acc-btn i { width: 25px; text-align: center; margin-right: 8px; }

body.dyslexic-font { font-family: 'Comic Sans MS', 'Verdana', sans-serif !important; }
body.high-spacing { line-height: 2 !important; letter-spacing: 1px !important; }

/* SIMULADO STICKY HEADER (OLD - MANTIDO POR COMPATIBILIDADE) */
.simulado-header-sticky {
    position: sticky; top: 5.5rem; z-index: 38; background: var(--panel-bg); padding: 10px 1rem; border-bottom: 2px solid var(--primary); display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 1.5rem; border-radius: 0 0 8px 8px;
}
@media (max-width: 1024px) { .simulado-header-sticky { top: 110px; } }
.simulado-timer { font-family: 'Courier New', monospace; font-weight: bold; font-size: 1.2rem; color: var(--primary); }
.simulado-progress { font-size: 0.9rem; color: var(--light-text); font-weight: bold; }

.tool-card {
    background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 1rem; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: transform 0.2s; height: 100%; display: flex; flex-direction: column;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.tool-title { font-size: 1.1rem; font-weight: bold; color: var(--secondary); margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.dark .tool-title { color: #fff; }

.water-jar {
    width: 100px; height: 140px; background: rgba(255, 255, 255, 0.2); border: 4px solid #cbd5e1; border-top: none; border-radius: 10px 10px 40px 40px; position: relative; overflow: hidden; margin: 0 auto; box-shadow: 0 10px 20px rgba(0,0,0,0.1), inset 0 0 20px rgba(255,255,255,0.5); z-index: 1;
}
.dark .water-jar { border-color: #475569; background: rgba(255,255,255,0.05); }
.water-level {
    position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%); transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1); opacity: 0.85; box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
}
.water-level::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 10px; background: rgba(255,255,255,0.3); transform: skewY(-5deg) translateY(-5px); }
.glass-reflection { position: absolute; top: 10px; right: 10px; width: 10px; height: 80%; background: linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(255,255,255,0)); border-radius: 10px; z-index: 10; }
.water-handle { position: absolute; right: 20px; top: 50px; width: 40px; height: 80px; border: 6px solid #cbd5e1; border-left: none; border-radius: 0 20px 20px 0; z-index: 0; }
.dark .water-handle { border-color: #475569; }

.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dark .custom-scrollbar::-webkit-scrollbar-thumb { background: #4b5563; }

/* ==========================================================================
   6. MÓDULOS, CONTEÚDO E ACCORDION
   ========================================================================== */
.accordion-button { width: 100%; text-align: left; background-color: #f8f9fa; color: var(--dark-text); cursor: pointer; padding: 1rem; border: 1px solid var(--border-color); border-radius: 0.5rem; transition: background-color 0.3s ease; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.dark .accordion-button { background-color: #374151; border-color: #374151; }
.accordion-button:hover, .accordion-button.active { background-color: #e9ecef; }
.dark .accordion-button:hover, .dark .accordion-button.active { background-color: var(--secondary); }
.accordion-button .fas { transition: transform 0.3s ease; }
.accordion-button.active .fas { transform: rotate(180deg); }
.accordion-panel { padding: 0 0.5rem; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }

/* NOVO: Estilo para a contagem no sidebar */
.module-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280; /* Gray 500 */
    background-color: #e5e7eb; /* Gray 200 */
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: auto;
    margin-right: 10px;
}
.dark .module-count {
    background-color: #1f2937;
    color: #9ca3af;
}

.module-list-item {
  position: relative; padding: 1rem 1.25rem; margin: 0.5rem 0; border-radius: 0.75rem;
  background: linear-gradient(145deg, #ffffff, #f7f7f7); border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); cursor: pointer; transition: all 0.3s ease;
  display: flex; align-items: center; font-size: 0.95rem; color: var(--dark-text); font-weight: 500;
}
.dark .module-list-item { background: linear-gradient(145deg, #1f2937, #111827); border: 1px solid rgba(255, 255, 255, 0.05); color: #e5e7eb; }
.module-list-item:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); border-color: var(--accent); background: linear-gradient(145deg, #fff9f3, #ffffff); }
.module-list-item.active { background: linear-gradient(145deg, #fef6e4, #ffffff); border: 2px solid var(--accent); color: var(--dark-text); font-weight: 600; box-shadow: 0 4px 10px rgba(247, 127, 0, 0.2); }
.dark .module-list-item:hover { background: linear-gradient(145deg, #374151, #1f2937); border-color: var(--accent); }
.dark .module-list-item.active { background: linear-gradient(145deg, #2d3748, #1f2937); border: 2px solid var(--accent); color: #fff; }
.module-list-item .completion-icon { margin-left: auto; font-size: 1rem; color: var(--success); }

#mobile-module-container .accordion-panel, #desktop-module-container .accordion-panel { display: grid; grid-template-columns: repeat(2, 1fr); padding: 0; gap: 0.75rem; padding-top: 0.75rem; }
#mobile-module-container .module-list-item, #desktop-module-container .module-list-item { margin: 0; flex-direction: column; align-items: center; padding: 1rem 0.5rem; font-size: 0.85rem; min-height: 100px; word-break: break-word; text-align: center; justify-content: center; border-radius: 1rem !important; }
#mobile-module-container .module-list-item .module-icon, #desktop-module-container .module-list-item .module-icon { margin-right: 0; margin-bottom: 0.5rem; font-size: 1.5rem; align-self: center; }
#mobile-module-container .module-list-item .completion-icon, #desktop-module-container .module-list-item .completion-icon { position: absolute; top: 0.5rem; right: 0.5rem; font-size: 0.8rem; margin-left: 0; }

#content-area { background-color: var(--panel-bg); color: var(--light-text); }
#content-area h3 { color: var(--secondary); border-bottom: 2px solid var(--border-color); }
#content-area h4 { color: var(--secondary); font-size: 1.375rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; }
#content-area h5 { font-size: 1.2rem; font-weight: 700; margin-top: 1.75rem; margin-bottom: 0.5rem; }
#content-area p { color: var(--light-text); font-size: 0.925rem; line-height: 1.6; margin-bottom: 1.25rem; }
#content-area ul, #content-area ol { padding-left: 1.75rem; margin-bottom: 1.25rem; color: var(--light-text); font-size: 0.925rem; line-height: 1.6; }
#content-area ul { list-style-type: disc; }
#content-area ol { list-style-type: decimal; }
#content-area strong { color: var(--secondary); font-weight: 700; }
.dark #content-area h3 { color: var(--accent); }
.dark #content-area h4 { color: #93c5fd; }
.dark #content-area h5 { color: #bfdbfe; }
.dark #content-area p, .dark #content-area ul, .dark #content-area li { color: var(--light-text); }
.dark #content-area strong { color: var(--accent); }

@media (min-width: 1024px) { 
    #content-area > div > p, #content-area > div > ul li, #content-area > div > ol li { font-size: 1rem; line-height: 1.75; } 
    #content-area > div > h4 { font-size: 1.75rem; margin-top: 2.25rem; margin-bottom: 1rem; } 
    #content-area > div > h5 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; } 
    #content-area > div > hr { margin-top: 4rem; margin-bottom: 3rem; } 
}
#content-area > div > h4:first-child { margin-top: 0; }

.key-concept { background-color: var(--info-bg); border-left: 4px solid var(--info-border); padding: 1rem; margin-bottom: 1rem; border-radius: 0.5rem; }
.key-concept h5 { color: #2c5282 !important; font-weight: 700; margin-top: 0 !important; }
.dark .key-concept h5 { color: #bfdbfe !important; }
.warning-box { background-color: #fffbeb; border-left: 4px solid #f59e0b; padding: 1rem; margin-bottom: 1rem; border-radius: 0.5rem; color: #b45309; }
.dark .warning-box { background-color: #451a03; border-color: #d97706; color: #fdba74; }

.custom-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.custom-table th, .custom-table td { border: 1px solid var(--border-color); padding: 0.75rem; text-align: left; }
.custom-table th { background-color: #e9ecef; font-weight: bold; }
.dark .custom-table th { background-color: #374151; }
.dark .custom-table th, .dark .custom-table td { border-color: #4b5563; }

.quiz-option { 
    cursor: pointer; padding: 1rem; border-radius: 0.5rem; margin-bottom: 0.75rem; 
    transition: all 0.3s ease; background-color: #f8f9fa; border: 2px solid #e9ecef; 
    color: var(--dark-text); display: flex; align-items: flex-start; position: relative; overflow: hidden;
}
.dark .quiz-option { background-color: #374151; border-color: #4b5563; color: var(--dark-text); }
.quiz-option:hover { background-color: #e9ecef; transform: translateX(5px); }
.dark .quiz-option:hover { background-color: #4b5563; }
.quiz-option.correct { background-color: var(--success) !important; color: white !important; border-color: var(--success) !important; }
.quiz-option.incorrect { background-color: var(--primary) !important; color: white !important; border-color: var(--primary) !important; }
.quiz-option.correct .option-key, .quiz-option.incorrect .option-key { color: white !important; }
.quiz-option .option-key { font-weight: 700; margin-right: 0.75rem; color: var(--secondary); }
.dark .quiz-option .option-key { color: var(--accent); }

.modal { 
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); 
    z-index: 20000 !important; 
    background-color: var(--panel-bg); padding: 2.5rem; border-radius: 1.5rem; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); text-align: center; 
    max-width: 32rem; width: 90%; 
    opacity: 0; pointer-events: none; 
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); 
    max-height: 90vh; display: flex; flex-direction: column;
}
#name-prompt-modal, #expired-modal { padding: 0; overflow: hidden; }
.modal.show { opacity: 1 !important; transform: translate(-50%, -50%) scale(1) !important; pointer-events: auto !important; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); z-index: 19999 !important; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.modal-overlay.show { opacity: 1 !important; pointer-events: auto !important; }

#toast-container { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 1000; }
.toast { background-color: #1f2937; color: white; padding: 1rem 1.5rem; border-radius: 0.5rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); display: flex; align-items: center; margin-bottom: 1rem; opacity: 0; transform: translateX(100%); animation: toast-in 0.5s forwards, toast-out 0.5s 4s forwards; }
.toast i { color: var(--accent); font-size: 1.5rem; margin-right: 0.75rem; }
@keyframes toast-in { to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(100%); } }

.achievement-card { background: var(--panel-bg); border-radius: 1rem; padding: 1.5rem 1rem; text-align: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 2px solid transparent; box-shadow: 0 4px 6px rgba(0,0,0,0.05); position: relative; overflow: hidden; border-color: var(--border-color); opacity: 0.8; transform: scale(0.98); filter: grayscale(1); }
.achievement-card.unlocked { opacity: 1; transform: scale(1); filter: grayscale(0); border-color: var(--accent); background: linear-gradient(145deg, #ffffff, #fff7ed); box-shadow: 0 10px 25px rgba(247, 127, 0, 0.15); }
.dark .achievement-card.unlocked { background: linear-gradient(145deg, #1f2937, #111827); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); }
.achievement-icon { font-size: 3.5rem; margin-bottom: 1rem; transition: all 0.5s ease; color: #d1d5db; display: inline-block; }
.dark .achievement-icon { color: #4b5563; }
.achievement-card.unlocked .achievement-icon { color: var(--accent); filter: drop-shadow(0 0 10px rgba(247, 127, 0, 0.4)); animation: floatIcon 3s ease-in-out infinite; }
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.achievement-title { font-size: 0.85rem; font-weight: 700; color: var(--light-text); text-transform: uppercase; letter-spacing: 0.5px; }
.achievement-card.unlocked .achievement-title { color: var(--accent); }

#achievement-modal-overlay { z-index: 101; } 
#achievement-modal { z-index: 102; }
#ach-modal-icon-container i { font-size: 5rem; color: var(--accent); animation: pop-glow 1s ease-out; filter: drop-shadow(0 0 10px rgba(247, 127, 0, 0.5)); }
.dark #ach-modal-icon-container i { filter: drop-shadow(0 0 15px var(--accent)); }
@keyframes pop-glow { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 25px var(--accent)); } 100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 10px rgba(247, 127, 0, 0.5)); } }

#content-area > div > p, #content-area > div > ul, #content-area > div > ol, #content-area > div > .key-concept, #content-area > div > .warning-box { margin-bottom: 1.25rem; }
#content-area > div > hr { margin-top: 2.5rem; margin-bottom: 2rem; border-color: var(--border-color); }
#content-area > div > ul, #content-area > div > ol { padding-left: 1.75rem; list-style-type: disc; }
#content-area > div > ol { list-style-type: decimal; }
#content-area > div > p:not(.text-lg), #content-area > div > ul li, #content-area > div > ol li { font-size: 0.925rem; line-height: 1.6; }
#content-area > div > h4 { font-size: 1.375rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; }
#content-area > div > h5 { font-size: 1.2rem; font-weight: 700; margin-top: 1.75rem; margin-bottom: 0.5rem; }
@media (min-width: 1024px) { #content-area > div > p:not(.text-lg), #content-area > div > ul li, #content-area > div > ol li { font-size: 1rem; line-height: 1.75; } #content-area > div > h4 { font-size: 1.75rem; margin-top: 2.25rem; margin-bottom: 1rem; } #content-area > div > h5 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; } #content-area > div > hr { margin-top: 4rem; margin-bottom: 3rem; } }
#content-area > div > h4:first-child { margin-top: 0; }

@media print { body > *:not(#print-watermark) { display: none !important; } #print-watermark { display: block !important; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: white; color: #000; font-family: 'Arial', sans-serif; font-size: 8vw; font-weight: bold; opacity: 0.15; display: flex; justify-content: center; align-items: center; text-align: center; transform: rotate(-30deg); line-height: 1.2; letter-spacing: 2px; z-index: 99999; } }

.notes-textarea { width: 100%; min-height: 150px; padding: 1rem; margin-top: 1.5rem; border-radius: 0.5rem; border: 2px solid var(--border-color); background-color: var(--light-bg); color: var(--dark-text); transition: all 0.3s ease; -webkit-user-select: auto; -moz-user-select: auto; -ms-user-select: auto; user-select: auto; }
.notes-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(247, 127, 0, 0.3); }
.dark .notes-textarea { background-color: #1a202c; border-color: var(--border-color); color: var(--light-text); }
.dark .notes-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 158, 0, 0.3); }

#focus-menu-desktop { display: none; position: fixed; top: 1rem; right: 1rem; z-index: 50; }
#focus-nav-bar { display: none; }
body.focus-mode header, body.focus-mode footer, body.focus-mode nav:not(#focus-nav-bar), body.focus-mode #back-to-top, body.focus-mode #welcome-greeting-container, body.focus-mode aside, body.focus-mode #sticky-progress-wrapper { display: none; }
body.focus-mode #focus-nav-bar { display: block; }
@media (min-width: 1024px) { body.focus-mode #focus-menu-desktop { display: flex; } body.focus-mode #focus-nav-bar { display: none; } body.focus-mode #sidebar-overlay { display: block; } }
body.focus-mode .container.mx-auto { padding-top: 2rem !important; }
body.focus-mode .lg\:w-2\/3 { width: 100% !important; max-width: 80rem; margin: 0 auto; }
body.focus-mode #main-wrapper { padding-bottom: 2rem; }

.loader { border: 4px solid rgba(0, 0, 0, 0.1); border-left-color: var(--primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto; }
.dark .loader { border-left-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

#dark-mode-toggle-desktop { background-color: var(--secondary); border: none; width: 50px; height: 28px; border-radius: 14px; padding: 0; position: relative; cursor: pointer; box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); transition: background 0.3s; }
#dark-mode-toggle-desktop i { background-color: white; color: var(--secondary); width: 22px; height: 22px; border-radius: 50%; font-size: 14px; display: flex; align-items: center; justify-content: center; position: absolute; top: 3px; left: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.4); transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.dark #dark-mode-toggle-desktop { background-color: var(--accent); }
.dark #dark-mode-toggle-desktop i { transform: translateX(22px) rotate(360deg); color: var(--accent); }
    
#bottom-nav-theme { position: relative; overflow: visible; color: #4b5563; }
.dark #bottom-nav-theme { color: #9ca3af; }
#bottom-nav-theme i { background-color: var(--secondary); width: 50px; height: 28px; border-radius: 14px; position: relative; transition: background-color 0.3s ease; font-size: 0; color: transparent; margin-bottom: 4px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); }
#bottom-nav-theme i::after { content: '\f186'; font-family: "Font Awesome 6 Free"; font-weight: 900; background-color: white; color: var(--secondary); width: 22px; height: 22px; border-radius: 50%; font-size: 14px; display: flex; align-items: center; justify-content: center; position: absolute; top: 3px; left: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.4); transform: rotate(0deg); transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
#bottom-nav-theme:active i::after { transform: scale(0.9); }
.dark #bottom-nav-theme:active i::after { transform: translateX(22px) scale(0.9); }
.dark #bottom-nav-theme i { background-color: var(--accent); }
.dark #bottom-nav-theme i::after { content: '\f185'; transform: translateX(22px) rotate(360deg); color: var(--accent); }

.survival-life-heart { filter: drop-shadow(0 0 5px red); animation: beat 1s infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.border-l-4 { border-left-width: 4px; }
.animate-fade-in { animation: fadeIn 0.5s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.bg-gradient-card { background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%); }
.card-shine { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(125deg, rgba(255,255,255,0) 40%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 60%); pointer-events: none; }

/* ==========================================================================
   7. NOVOS ESTILOS (PLAYER, SIMULADO MODERNO, RPG)
   ========================================================================== */

/* 7.1 Player de Áudio Moderno */
.modern-audio-player {
    background-color: #1f2937; /* Dark background */
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    width: fit-content;
}
.audio-main-btn {
    background-color: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}
.audio-main-btn:hover { background-color: #1d4ed8; }
.audio-main-btn.playing { background-color: #dc2626; } /* Red for stop */

.audio-icon-btn {
    width: 2rem; height: 2rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background-color: #374151;
    color: #d1d5db;
    transition: all 0.2s;
}
.audio-icon-btn:hover { background-color: #4b5563; color: white; }

.audio-speed-select {
    background-color: transparent;
    color: #d1d5db;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.audio-speed-select option { background-color: #1f2937; }

/* 7.2 Simulado Moderno (Sticky Header) - CORREÇÃO PEDIDO 2 */
/* Removida margem negativa que causava sobreposição */
.simulado-header-modern {
    position: sticky;
    top: 5.5rem;
    z-index: 38;
    background-color: #111827; /* Dark Gray 900 */
    border-bottom: 2px solid #f97316; /* Orange */
    padding: 1rem 1.5rem;
    border-radius: 0.5rem; /* Adicionado para não ficar quadrado demais */
    margin-bottom: 2rem; /* Espaço abaixo do timer */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    gap: 1rem;
}
@media (max-width: 1024px) { 
    .simulado-header-modern { top: 20px; } /* Ajuste top para mobile no modo exame */
}

.sim-timer-box {
    display: flex; align-items: center; gap: 0.75rem; 
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fb923c;
    flex-shrink: 0;
}
.sim-count-badge {
    background-color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #e5e7eb;
    white-space: nowrap; 
}

/* 7.3 Cartões de Resposta (Quiz Moderno) */
.quiz-card-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #374151; /* Dark border */
    background-color: #111827; /* Dark bg by default for cards in example */
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #e5e7eb;
}
:root:not(.dark) .quiz-card-option {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.quiz-card-option:hover {
    border-color: #f97316; /* Orange hover */
    transform: translateX(4px);
}
.quiz-card-option.selected {
    background-color: #f97316;
    border-color: #f97316;
    color: white;
}
:root:not(.dark) .quiz-card-option.selected {
    background-color: #f97316;
    color: white;
}

.quiz-letter-box {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background-color: #374151; /* Dark gray */
    color: #f97316; /* Orange text */
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}
:root:not(.dark) .quiz-letter-box {
    background-color: #e2e8f0;
    color: #ea580c;
}
.quiz-card-option.selected .quiz-letter-box {
    background-color: white;
    color: #f97316;
}

/* 7.4 Resultado (Gráfico Circular) */
.circle-chart {
    position: relative;
    width: 120px; height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    background: conic-gradient(
        var(--brand-orange) calc(var(--percentage) * 1%), 
        #374151 0deg
    );
    display: flex; align-items: center; justify-content: center;
}
.circle-chart::after {
    content: attr(data-score);
    position: absolute;
    width: 100px; height: 100px;
    background-color: #1f2937; /* Match parent container bg */
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; color: white;
}
:root:not(.dark) .circle-chart::after {
    background-color: #ffffff;
    color: #111827;
}
:root:not(.dark) .circle-chart {
    background: conic-gradient(
        #ea580c calc(var(--percentage) * 1%), 
        #e2e8f0 0deg
    );
}

.result-progress-bar {
    height: 0.75rem;
    background-color: #374151;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 2rem;
}
:root:not(.dark) .result-progress-bar { background-color: #e2e8f0; }
.result-progress-fill {
    height: 100%;
    background-color: #3b82f6; /* Blue */
    width: 0; /* JS animates this */
    transition: width 1s ease-out;
}

/* 7.5 Feedback Boxes (Gabarito) */
.feedback-box {
    background-color: #1f2937;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid #374151;
}
:root:not(.dark) .feedback-box {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.feedback-header {
    padding: 0.75rem 1rem;
    font-weight: bold;
    font-size: 0.95rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #374151;
}
:root:not(.dark) .feedback-header { border-bottom-color: #e2e8f0; }

.feedback-correct .feedback-header { color: #10b981; }
.feedback-wrong .feedback-header { color: #ef4444; }

.feedback-body { padding: 1rem; }

.answer-row {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}
.answer-row.user-wrong {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
}
:root:not(.dark) .answer-row.user-wrong {
    background-color: #fef2f2;
    color: #991b1b;
}

.answer-row.correct-ref {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 3px solid #10b981;
    color: #6ee7b7;
}
:root:not(.dark) .answer-row.correct-ref {
    background-color: #ecfdf5;
    color: #065f46;
}

.explanation-text {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #9ca3af;
}
:root:not(.dark) .explanation-text { color: #4b5563; }

/* 7.6 RPG Cards */
.rpg-card-btn {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-left: 4px solid #3b82f6;
    padding: 1.25rem;
    width: 100%; text-align: left;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
    color: white;
}
.rpg-card-btn:hover {
    background-color: #374151;
    transform: translateX(5px);
}
:root:not(.dark) .rpg-card-btn {
    background-color: white;
    border-color: #e2e8f0;
    border-left-color: #3b82f6;
    color: #1f2937;
}
:root:not(.dark) .rpg-card-btn:hover { background-color: #f8fafc; }
/* ==========================================================================
   8. NOVOS ESTILOS (TIMER FLUTUANTE & AUDIO CONTROLS) - ADICIONADO AGORA
   ========================================================================== */

/* Timer "Sticky" (Cola no topo, mas respeita o layout) */
.simulado-floating-timer {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 1rem; /* Distância do teto quando "grudar" */
    z-index: 40;
    
    /* Centralização usando margens automáticas (já que não é mais fixed) */
    margin: 0 auto 2rem auto; 
    width: fit-content;
    
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    border: 1px solid #ea580c;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-family: monospace;
    font-weight: bold;
    font-size: 1.1rem;
}

/* No mobile, mantemos ele no topo (sticky) para não atrapalhar botões embaixo */
@media (max-width: 768px) {
    .simulado-floating-timer {
        top: 0.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Ajuste para os botões do player de áudio ficarem alinhados */
.audio-controls-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
/* ==========================================================================
   9. ESTILO DO TOUR GUIADO (DRIVER.JS)
   ========================================================================== */
/* Personaliza o popover para combinar com o tema Bravo Charlie */
.driver-popover.driverjs-theme {
    background-color: #1f2937; /* Cinza Escuro */
    color: #ffffff; /* Texto Branco */
    border: 1px solid #ea580c; /* Borda Laranja */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.driver-popover.driverjs-theme .driver-popover-title {
    font-family: 'Lora', serif;
    color: #fb923c; /* Laranja Claro */
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.driver-popover.driverjs-theme .driver-popover-description {
    color: #d1d5db; /* Cinza texto */
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Botões do Tour */
.driver-popover.driverjs-theme button {
    background-color: #ea580c; /* Laranja */
    color: white;
    text-shadow: none;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 0.8rem;
}
.driver-popover.driverjs-theme button:hover {
    background-color: #c2410c; /* Laranja Escuro */
}
.driver-popover.driverjs-theme button.driver-popover-prev-btn {
    background-color: #374151; /* Cinza para o botão 'Anterior' */
    color: #9ca3af;
}
/* --- CORREÇÃO DO TOUR (DRIVER.JS) --- */

/* Força o container da IA a ter tamanho e posição para o Tour achar */
#voiceflow-chat {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    width: 60px !important;
    height: 60px !important;
    z-index: 45 !important; /* Abaixo do menu, acima do conteúdo */
    pointer-events: none; /* Deixa o clique passar para o botão real dentro dele */
}

/* Garante que o botão de acessibilidade fique acima do overlay do tour se necessário */
#accessibility-fab {
    z-index: 10001 !important; /* Valor alto para garantir destaque */
}

/* Ajuste fino do popover do tour */
.driver-popover.driverjs-theme {
    max-width: 250px; /* Evita que fique muito largo no mobile */
}

