/* =========================================
   ESTILOS DE EXAMEN (GOLDEN RATIO & MOODLE STYLE)
========================================= */

/* Contenedor Principal */
.exam-paper {
    background: white; 
    padding: var(--space-xl); 
    border-radius: 16px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.06); 
    width: 95%;
    max-width: 1100px; 
    margin: var(--space-lg) auto; 
}

/* Intro */
.exam-intro-box { text-align: center; padding: var(--space-lg); }
.exam-intro-box h1 {
    font-family: var(--font-head);
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: var(--space-sm);
}
.exam-intro-box p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: var(--space-xl);
}

/* Tarjetas Meta (Diseño Profesional Minimalista) */
.exam-meta-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    background: #f8fafc;
    padding: 15px 30px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.exam-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 0;
}
.exam-meta-item i { 
    font-size: 1.2rem; 
    color: var(--primary-main); 
    margin-bottom: 0; 
}
.exam-meta-info { 
    font-family: var(--font-head); 
    font-size: 1rem; 
    font-weight: 700; 
    color: var(--secondary); 
}
.exam-meta-label { 
    font-family: var(--font-ui); 
    font-size: 0.9rem; 
    color: var(--text-gray); 
    text-transform: none; 
    letter-spacing: 0; 
    margin-top: 0; 
}

/* Examen en curso */
.exam-header-row { 
    display: flex; justify-content: space-between; align-items: center; 
    border-bottom: 2px solid #f4f4f4; padding-bottom: var(--space-lg); margin-bottom: var(--space-xl); 
}
.exam-header-row h2 { font-family: var(--font-head); font-size: 1.6rem; color: var(--secondary); }

/* Temporizador Flotante (Sticky Moodle) */
.sticky-timer-container {
    position: sticky;
    top: 20px;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    pointer-events: none; /* Evita que estorbe al hacer clics */
}
.sticky-timer {
    background: #fff8e1;
    color: #f39c12;
    padding: 10px 25px;
    border-radius: 50px;
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 1.3rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border: 2px solid #fdebd0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Preguntas */
.exam-question { margin-bottom: var(--space-xl); }
.question-text { 
    font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; 
    margin-bottom: var(--space-lg); color: var(--text-dark); 
}

.question-options { display: flex; flex-direction: column; gap: var(--space-md); }
.question-option { 
    display: flex; align-items: center; padding: var(--space-lg); 
    border: 1px solid #e0e0e0; border-radius: 10px; 
    cursor: pointer; transition: 0.2s; background: white; 
    font-family: var(--font-body); font-size: 1rem; color: var(--text-gray);
}
.question-option:hover { 
    background: #fdfdfd; border-color: var(--primary-main); color: var(--primary-darkest); transform: translateX(5px); 
}
.question-option input { width: 20px; height: 20px; margin-right: var(--space-lg); accent-color: var(--primary-main); }

/* Backoffice (Para crear/editar preguntas) */
.new-question-block { background: #fbfbfb; padding: var(--space-lg); border: 1px solid #eee; border-radius: 12px; margin-bottom: var(--space-lg); position: relative; }
.delete-q-btn { position: absolute; top: 20px; right: 20px; color: var(--danger); cursor: pointer; font-size: 1.2rem; }
.option-row { display: flex; align-items: center; margin-bottom: 10px; gap: 12px; }
.option-text-input { flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 6px; }
.btn-delete-option { color: var(--danger); background: white; border: 1px solid #fadbd8; border-radius: 6px; width: 40px; height: 40px; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.btn-delete-option:hover { background: var(--danger); color: white; }
.btn-add-option { background: white; border: 1px dashed var(--primary-main); color: var(--primary-main); padding: 12px 20px; border-radius: 8px; cursor: pointer; font-family: var(--font-ui); font-weight: 600; margin-top: 10px; display: inline-block; }
.btn-add-option:hover { background: #f0f7ff; }

/* =========================================
   RESULTADOS Y REVISIÓN TIPO MOODLE
========================================= */

/* Cajas de Revisión (Correcto / Incorrecto) */
.review-box {
    padding: 25px; 
    border-radius: 12px; 
    margin-bottom: 25px; 
    border: 1px solid #eee;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.review-correct { border-left: 6px solid var(--success) !important; background: #f9fffb; }
.review-wrong { border-left: 6px solid var(--danger) !important; background: #fffdfd; }

.option-correct { 
    background: #d4edda !important; 
    border-color: #c3e6cb !important; 
    color: #155724 !important; 
    font-weight: 700; 
}
.option-wrong { 
    background: #f8d7da !important; 
    border-color: #f5c6cb !important; 
    color: #721c24 !important; 
    font-weight: 600;
}

.result-box { text-align: center; padding: var(--space-xl); background: #fcfcfc; border-radius: 16px; margin-bottom: var(--space-xl); border: 1px solid #eee; }
.result-score { font-family: var(--font-head); font-size: 5rem; font-weight: 900; color: var(--primary-main); display: block; line-height: 1; margin-bottom: 10px; }
.result-msg { font-family: var(--font-ui); font-size: 1.4rem; color: #555; }

/* Tabla de Historial de Intentos (Intro Moodle) */
.attempts-table-container {
    margin-top: 35px;
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.attempts-table { 
    width: 100%; 
    border-collapse: collapse; 
    text-align: center; 
}
.attempts-table th { 
    background: #f8faff; 
    padding: 15px; 
    color: var(--secondary); 
    font-family: var(--font-ui); 
    font-size: 0.95rem; 
    border-bottom: 1px solid #eee;
}
.attempts-table td { 
    padding: 15px; 
    border-bottom: 1px solid #eee; 
    font-size: 0.95rem; 
    vertical-align: middle; 
}
.attempts-table tr:last-child td { border-bottom: none; }
.attempts-table tr:hover td { background: #fcfcfc; }