/* ==========================================================================
   CONFIGURAÇÃO BASE (PADRÃO LIGHT - FUNDO CINZA CLARO DAS FERRAMENTAS)
   ========================================================================== */
.typing-tool-page {
    font-family: Arial, sans-serif;
    max-width: 1300px;
    margin: 0 auto;
    padding-bottom: 2rem;
    color: #24292f;
}

/* Dashboard Superior */
.typing-dashboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.stats-panel { display: flex; gap: 2rem; font-size: 1.1rem; color: #24292f; }
.action-panel { display: flex; gap: 0.75rem; align-items: center; }

/* Grid Estrutural */
.typing-layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
}

/* Sidebar de Lições */
.sidebar {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #d0d7de;
    max-height: 70vh;
    overflow-y: auto;
}
.module-group { margin-bottom: 1.2rem; }
.module-title { font-size: 0.8rem; text-transform: uppercase; color: #0969da; margin-bottom: 0.5rem; font-weight: bold; }

.lesson-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem; background: #ffffff; margin-bottom: 0.3rem;
    border-radius: 4px; cursor: pointer; font-size: 0.85rem; color: #24292f;
    border: 1px solid #d0d7de;
}
.lesson-item.active { background: #eaeef2; border-color: #1a7f37; color: #24292f; }
.lesson-item.locked { opacity: 0.35; cursor: not-allowed; }

/* Tela do Visor de Texto */
.text-display-container {
    background: #ffffff; border-radius: 8px; padding: 2.5rem;
    border: 1px solid #d0d7de; min-height: 150px; position: relative;
    margin-bottom: 1.5rem;
}
#text-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.65rem; line-height: 2.4rem; white-space: pre-wrap; letter-spacing: 1px;
    color: #57606a;
}
.char { color: #57606a; }
.char.current { color: #24292f; background: #eaeef2; border-bottom: 3px solid #0969da; }
.char.correct { color: #0969da; }
.char.incorrect { color: #ffffff; background: #da3633; }

.pause-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.98); display: none; justify-content: center;
    align-items: center; font-size: 1.3rem; color: #57606a; border-radius: 8px; z-index: 10;
}

/* Teclado Virtual */
.keyboard-viewport {
    background: #f6f8fa; border-radius: 8px; padding: 1.5rem;
    border: 1px solid #d0d7de; display: flex; gap: 1.5rem; justify-content: center;
    margin-bottom: 1.5rem;
}
.keyboard-main { display: flex; flex-direction: column; gap: 0.4rem; }
.keyboard-numpad { display: flex; flex-direction: column; gap: 0.4rem; border-left: 2px solid #d0d7de; padding-left: 1.5rem; }
.kb-row { display: flex; gap: 0.4rem; }

.key {
    background: #ffffff; border: 1px solid #d0d7de; color: #24292f;
    border-radius: 4px; height: 46px; min-width: 42px; display: flex;
    justify-content: center; align-items: center; font-family: monospace;
    font-size: 0.9rem; user-select: none;
}
.key.space { width: 310px; }
.key.backspace { width: 85px; }
.key.tab { width: 65px; }
.key.caps { width: 80px; }
.key.enter { width: 95px; }
.key.shift { width: 105px; }

/* Injeções de Feedback Dinâmico */
.key.pressed-correct { background: #238636 !important; color: white !important; border-color: #2ea043 !important; box-shadow: none !important; }
.key.pressed-fast { background: #2ea043 !important; color: white !important; box-shadow: 0 0 12px #2ea043 !important; border-color: #2ea043 !important; }
.key.pressed-incorrect { background: #da3633 !important; color: white !important; border-color: #f85149 !important; box-shadow: none !important; }

/* Inputs e Seções Auxiliares */
.custom-text-box { background: #f6f8fa; border-radius: 8px; border: 1px solid #d0d7de; padding: 1.2rem; }
.custom-text-box textarea {
    width: 100%; height: 80px; background: #ffffff; border: 1px solid #d0d7de;
    color: #24292f; padding: 0.7rem; border-radius: 6px; resize: none; margin-bottom: 0.7rem;
}
.custom-actions { display: flex; gap: 1rem; }

.action-btn {
    background: #ffffff; color: #24292f; border: 1px solid #d0d7de;
    padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
}
.action-btn:hover { background: #f3f4f6; }
.danger-btn { color: #f85149; border-color: rgba(248, 81, 73, 0.4); }
.success-btn { background: #238636; color: white; border-color: #2ea043; }
.select-field { background: #ffffff; color: #24292f; border: 1px solid #d0d7de; padding: 0.5rem; border-radius: 6px; }
.sales-cta-btn { background: linear-gradient(135deg, #ff8c00, #e52d27); color: white; padding: 0.5rem 1rem; border-radius: 6px; font-weight: bold; text-decoration: none; font-size: 0.85rem; }


/* ==========================================================================
   MAPEAMENTO DO MODO ESCURO (SINCRONIZADO EXCLUSIVAMENTE COM .dark-mode DO SEU SITE)
   ========================================================================== */
body.dark-mode .typing-tool-page {
    color: #f2f2f2;
}

body.dark-mode .typing-dashboard {
    background: #1f1f1f;
    border-color: #333333;
}
body.dark-mode .stats-panel { color: #f5f5f5; }

body.dark-mode .sidebar {
    background: #1f1f1f;
    border-color: #333333;
}
body.dark-mode .module-title { color: #ffcc66; }

body.dark-mode .lesson-item {
    background: #1e1e1e;
    color: #f5f5f5;
    border-color: #333333;
}
body.dark-mode .lesson-item.active {
    background: #333333;
    border-color: #238636;
    color: #fff;
}

body.dark-mode .text-display-container {
    background: #1e1e1e;
    border-color: #333333;
}
body.dark-mode #text-display { color: #cccccc; }
body.dark-mode .char { color: #888888; }
body.dark-mode .char.current { color: #ffffff; background: #333333; border-bottom-color: #ffcc66; }
body.dark-mode .char.correct { color: #ffcc66; }

body.dark-mode .pause-overlay { background: rgba(30, 30, 30, 0.98); color: #f5f5f5; }

body.dark-mode .keyboard-viewport {
    background: #1e1e1e;
    border-color: #333333;
}
body.dark-mode .keyboard-numpad { border-left-color: #333333; }

body.dark-mode .key {
    background: #121212;
    border-color: #444444;
    color: #f5f5f5;
}

body.dark-mode .custom-text-box { background: #1f1f1f; border-color: #333333; }
body.dark-mode .custom-text-box textarea { background: #1e1e1e; border-color: #444444; color: #f5f5f5; }

body.dark-mode .action-btn { background: #333333; color: #f5f5f5; border-color: #555555; }
body.dark-mode .action-btn:hover { background: #444444; }
body.dark-mode .select-field { background: #1e1e1e; color: #f5f5f5; border-color: #444444; }

/* Modais de Resultados */
.modal-mask { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); z-index: 1000; display: none; justify-content: center; align-items: center; }
.modal-content { background: #1e1e1e; border: 1px solid #444444; border-radius: 12px; padding: 2rem; width: 92%; max-width: 410px; text-align: center; color: #f5f5f5; }
body:not(.dark-mode) .modal-content { background: #ffffff; border-color: #d0d7de; color: #24292f; }

.conquest-card { background: linear-gradient(180deg, #1f2937 0%, #0d1117 100%); border: 2px solid #4b5563; border-radius: 12px; padding: 2rem 1.5rem; width: 310px; height: 460px; margin: 0 auto 1.2rem auto; color: white; display: flex; flex-direction: column; justify-content: space-between; }
.card-header h4 { font-size: 1.3rem; color: #f39c12; text-transform: uppercase; }
.card-metrics { display: flex; flex-direction: column; gap: 0.9rem; margin: 1.5rem 0; }
.card-metric-row { display: flex; justify-content: space-between; border-bottom: 1px dashed #374151; padding-bottom: 0.3rem; }
.card-metric-row .val { font-weight: bold; font-size: 1.15rem; }
.modal-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.btn-capture { background: #f39c12; color: black; font-weight: bold; border: none; padding: 0.6rem; width: 100%; border-radius: 6px; cursor: pointer; }
.btn-buy-exe { display: inline-block; background: linear-gradient(135deg, #ff8c00, #e52d27); color: white; padding: 0.5rem 1rem; border-radius: 4px; text-decoration: none; font-weight: bold; margin-top: 0.5rem; }

/* Bloqueio Mobile */
#mobile-block { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #0d1117; z-index: 9999; display: none; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; text-align: center; color: #fff; }
#mobile-block p { color: #8b949e; max-width: 450px; margin: 1rem 0; }
.bypass-hint { font-size: 0.8rem; color: #2ea043; }
.alert-banner { background: #232113; border-left: 4px solid #d4a373; color: #dbab79; padding: 0.8rem 1.2rem; border-radius: 4px; font-size: 0.85rem; display: none; margin-bottom: 1rem; }

@media (max-width: 1250px) { .keyboard-numpad { display: none !important; } }