/* =========================================
   STYLE.CSS (SPANISH MODULE)
   ========================================= */

:root { 
  --primary: #2563eb; 
  --secondary: #db2777; 
  --bg: #f8fafc; 
  --text: #1e293b; 
}
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); padding: 20px; margin: 0; }
.container { max-width: 800px; margin: 0 auto; background: white; padding: 25px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); min-height: 90vh; display: flex; flex-direction: column; }

/* HEADER */
header { text-align: center; margin-bottom: 20px; }
h1 { margin: 0; color: var(--primary); font-size: 2.2rem; letter-spacing: -1px; }
.subtitle { color: var(--secondary); margin-top: 5px; font-size: 0.95rem; font-weight: 700; }

.info-toggle { background: #e0f2fe; color: #0369a1; border: none; padding: 8px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; cursor: pointer; margin-top: 15px; display: inline-flex; align-items: center; gap: 5px; }
.info-box { display: none; background: #f0f9ff; border: 1px solid #bae6fd; padding: 15px; border-radius: 12px; margin-bottom: 20px; text-align: left; font-size: 0.9rem; color: #334155; }

/* TABS SYSTEM */
.tabs-container { display: flex; gap: 10px; margin-bottom: 25px; padding: 5px; background: #f1f5f9; border-radius: 15px; }
.tab-btn { flex: 1; padding: 12px; border: none; border-radius: 10px; font-weight: 800; cursor: pointer; transition: 0.2s; color: #64748b; background: transparent; }
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* SECTION: CONVERSATION STYLES */

/* FILA 1: Botones de Nivel (OL/HL) */
.level-selector { display: flex; background: #f8fafc; padding: 5px; border-radius: 12px; margin-bottom: 10px; border: 1px solid #e2e8f0; align-items: stretch; }

.level-btn { flex: 1; padding: 10px; border: none; border-radius: 8px; cursor: pointer; font-weight: 700; transition: 0.3s; font-size: 0.9rem; color: #64748b; background: transparent; }
.level-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.level-btn.hl.active { color: var(--secondary); }

/* FILA 2: Botones de Modo (Exam/Study) */
.mode-selector { display: flex; background: #f3f4f6; padding: 5px; border-radius: 12px; margin-bottom: 25px; border: 1px solid #e5e7eb; gap: 5px; }

.mode-btn { flex: 1; padding: 10px; border: none; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 0.9rem; color: #64748b; background: transparent; transition: all 0.2s ease; }
.mode-btn:hover { background: #ede9fe; color: #7c3aed; }
.mode-btn.active { background: white; color: #7c3aed; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid #ddd6fe; }

.mock-btn { width: 100%; padding: 15px; margin-bottom: 25px; background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); color: white; border: none; border-radius: 12px; font-weight: 800; font-size: 1.1rem; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); transition: transform 0.2s; }
.mock-btn:hover { transform: scale(1.02); }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 25px; }
.topic-btn { padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: white; cursor: pointer; font-size: 0.85rem; font-weight: 600; text-align: center; color: #475569; transition: 0.2s; }
.topic-btn:hover { background: #f1f5f9; }
.topic-btn.active { border-color: var(--primary); background: #eff6ff; color: var(--primary); transform: scale(1.02); }

.question-card { background: #fdf2f8; border-left: 5px solid var(--secondary); padding: 25px; border-radius: 0 12px 12px 0; margin-bottom: 20px; }

/* SECTION: ROLEPLAY STYLES */
.rp-selector { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 10px; margin-bottom: 20px; scrollbar-width: none; }
.rp-btn-select { min-width: 130px; padding: 10px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 50px; font-size: 0.85rem; font-weight: 700; cursor: pointer; color: #475569; text-align: center; }
.rp-btn-select.active { background: var(--primary); color: white; border-color: var(--primary); }

.chat-container { flex-grow: 1; background: #f8fafc; border-radius: 15px; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; border: 1px solid #e2e8f0; max-height: 500px; min-height: 300px; margin-bottom: 15px; }
.bubble { max-width: 85%; padding: 12px 16px; border-radius: 18px; font-size: 0.95rem; line-height: 1.5; }
.ex { align-self: flex-start; background: white; border: 1px solid #e2e8f0; color: #334155; border-bottom-left-radius: 4px; }
.st { align-self: flex-end; background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.rp-context { font-size: 0.85rem; color: #64748b; margin-bottom: 10px; font-style: italic; text-align: center; }

.rp-controls { display: flex; gap: 10px; border-top: 1px solid #e2e8f0; padding-top: 15px; }
.rp-input { flex: 1; padding: 12px 20px; border-radius: 50px; border: 2px solid #e2e8f0; background: white; font-size: 1rem; outline: none; }
.rp-input:focus { border-color: var(--primary); }
.btn-send { background: var(--primary); color: white; border: none; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.btn-send:disabled { background: #cbd5e1; }

.next-audio-btn { width: 100%; padding: 12px; background: #ec4899; color: white; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; margin-bottom: 10px; display: none; }
.feedback-rp { font-size: 0.9em; background: #fffbeb; color: #92400e; padding: 10px; border-radius: 10px; border-left: 4px solid #f59e0b; margin-top: 5px; }
.model-answer-btn { background: none; border: none; color: #64748b; font-size: 0.8rem; cursor: pointer; text-decoration: underline; display: block; margin: 0 auto; }

/* SHARED COMPONENTS */
.audio-btn { margin-top: 15px; background: white; border: 1px solid #e2e8f0; padding: 8px 16px; border-radius: 50px; font-size: 0.9rem; font-weight: 600; cursor: pointer; color: var(--text); }
textarea { width: 100%; border: 2px solid #e2e8f0; border-radius: 15px; padding: 15px; min-height: 120px; box-sizing: border-box; font-size: 1rem; margin-bottom: 15px; font-family: inherit; }
textarea:focus { border-color: var(--secondary); outline: none; }
.btn-main { width: 100%; padding: 16px; background: var(--text); color: white; border: none; border-radius: 15px; font-weight: 800; cursor: pointer; font-size: 1.1rem; }
.btn-main:disabled { opacity: 0.5; cursor: wait; }

/* RESULT & FOOTER */
#result { margin-top: 30px; display: none; }
.student-response-box { background: #f1f5f9; padding: 15px; border-radius: 10px; margin-bottom: 20px; border-left: 4px solid #94a3b8; font-style: italic; color: #475569; }
.feedback-box { padding: 25px; border-radius: 15px; background: #fff; border: 1px solid #e2e8f0; }
.error-item { margin-bottom: 15px; padding: 15px; background: #fff1f2; border-radius: 10px; border-left: 4px solid #ef4444; }

.footer-section { margin-top: auto; padding: 40px 20px 20px; border-top: 1px solid #e2e8f0; background: #fafafa; border-radius: 20px; text-align: center; }
.profile-img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); margin-bottom: 15px; }
.bio-text { max-width: 600px; margin: 0 auto 25px auto; font-size: 0.95rem; line-height: 1.6; color: #475569; text-align: justify; }
.revolut-btn { background: #000; color: white; text-decoration: none; padding: 14px 28px; border-radius: 50px; font-weight: 700; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: 0.2s; }
.revolut-btn:hover { transform: translateY(-2px); }

/* SUPPORT BOX STYLES */
.support-box {
    background: #fffbeb; 
    border: 1px solid #fcd34d; 
    border-radius: 12px;
    padding: 15px;
    margin: 20px auto 15px auto; 
    max-width: 500px;
    text-align: center;
}

.support-title { font-weight: 800; color: #92400e; margin-bottom: 5px; display: block; font-size: 0.95rem; }
.support-text { font-size: 0.85rem; color: #78350f; line-height: 1.5; margin: 0; }

/* MODO ESTUDIO */
.study-box {
    background: #f0fdf4; /* Verde muy clarito */
    border: 2px solid #16a34a;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.check-btn {
    background: white;
    border: 1px solid #16a34a;
    color: #15803d;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
    text-align: left;
}

.check-btn:hover { background: #dcfce7; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.ai-box {
    margin-top: 15px;
    background: white;
    border-left: 4px solid #9333ea; /* Borde morado para diferenciar IA */
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

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

/* Estilo para botones TOP (Checkpoints especiales) */
.btn-top {
    background: #fffbeb; /* Fondo amarillo muy claro */
    border: 1px solid #f59e0b; /* Borde dorado */
    color: #b45309;
    font-weight: bold;
}

.btn-top:hover {
    background: #fcd34d; /* Amarillo más intenso al pasar ratón */
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); /* Resplandor dorado */
}

/* =========================================
   FOOTER LEGAL & EXTRAS (NUEVO)
   ========================================= */
.feedback-section {
    margin-top: 35px; 
    border-top: 1px dashed #cbd5e1; 
    padding-top: 25px;
}

.legal-section {
    margin-top: 50px; 
    border-top: 1px solid #e2e8f0; 
    padding-top: 20px; 
    font-size: 0.75rem; 
    color: #94a3b8; 
    line-height: 1.5;
}

.legal-section p {
    margin: 5px 0;
}
/* =========================================
   NUEVO: ESTILOS PARA LA TARJETA DE CANDIDATO
   ========================================= */

.instruction-box {
    background: #fff;
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: fadeIn 0.3s ease-in;
    display: none; /* Se oculta por defecto y se muestra con JS */
}

.instruction-label {
    display: block;
    font-weight: 800;
    color: var(--primary); /* Usará el rojo definido arriba */
    margin-bottom: 5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}
