
/* css para  quiz corregido*/

/* Contenedor principal del quiz */
.quiz-container {
    max-width: 1250px;   /* centrado en pantallas grandes */
    margin: 0 auto;
    padding: 15px;
}

/* Tarjeta de cada pregunta */
.question-card {
    background: #ffffff;   /* fondo blanco */
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0px 2px 6px rgba(0,0,0,0.1);
}

/* Encabezado de la pregunta */
.question-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap; /* para que no se rompa en móvil */
    font-size: 15px;
    margin-bottom: 15px;    
    gap: 20px;
}

/* Opciones */
.options p {
    margin: 6px 0;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    color: #7e7777;
}

/* Respuesta correcta */
.option.correct-option {
    color: #155724;
    font-weight: bold;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

/* Respuesta incorrecta */
.option.wrong-option {
    color: #721c24;
    font-weight: bold;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Estado de respuesta */
.answer-section {
    margin-top: 15px;
}

.correct {
    color: green;
    font-weight: bold;
}

.incorrect {
    color: red;
    font-weight: bold;
}

.final-grade {
    text-align: center;
    color: #0056b3;
    margin: 20px 0;
    font-size: 18px;
    font-weight: bold;
}

/* RESPONSIVE: se ajusta en móviles */
@media (max-width: 768px) {
    .quiz-container {
        padding: 10px;
    }
    .question-card {
        padding: 15px;
    }
    .question-header {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* css para respuesta del quiz */

/* Marcar preguntas incompletas */
.question-card.incompleta {
    border: 2px solid #ef4444;
    background: #fef2f2;
}

/* Opciones */
.option-label {
    display: block;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-size: 15px;
}
.option-label:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}
.option-label input {
    margin-right: 8px;
}

/* Textarea */
textarea.form-control {
    border-radius: 8px;
    font-size: 15px;
}


/* css para listas los quiz */

/* Contenedor de pestañas */
.nav-tabs {
    border: none;
    margin-bottom: 0px;
    display: flex;
    padding-bottom: 0;
    position: relative;
}

/* Todas las pestañas unidas y mismo tamaño con borde */
.nav-tabs .nav-link {
    font-weight: 600;
    color: #444;
    background: #f5f7fa;
    padding: 12px 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    position: relative;
    flex: 1;
    justify-content: center;
    margin: 0; 
    margin-bottom: 1px; /* aqui para bajar la linea */
    border: 1px solid #e0e6ed; /* borde agregado */
    border-left: none; /* eliminamos borde izquierdo para unirse */
}
.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{
    color:#fff;
    cursor:default;
    background-color:#337ab7;
    border:1px solid #ddd;
    border-bottom-color:transparent
}

/* Primer y último borde */
.nav-tabs .nav-link:first-child {
    border-radius: 10px 0 0 10px;
    border-left: 1px solid #e0e6ed; /* añadir borde izquierdo solo al primero */
}

.nav-tabs .nav-link:last-child {
    border-radius: 0 10px 10px 0;
}

/* Iconos dentro de pestañas */
.nav-tabs .nav-link i {
    font-size: 16px;
}

/* Hover */
.nav-tabs .nav-link:hover {
    background: #e6ebf3;
    color: #0047FF;
}

/* Activa */
.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #0047FF, #2563eb);
    color: #fff;
    font-weight: bold;
}

/* Línea debajo de todas las pestañas (opcional si quieres borde solo arriba) */
.nav-tabs::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e0e6ed;
    z-index: 0;
}

/* Input buscar más compacto */
.search-box {
    width: 40%;   /* más pequeño */
    margin: 0 auto 20px;
    position: relative;
    padding: 10px;
}

.search-box input {
    width: 100%;
    padding: 6px 12px; /* menos alto y compacto */
    border-radius: 8px;
    border: 1px solid #ccd3db;
    font-size: 13px;
    transition: 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #0047FF;
    box-shadow: 0 0 6px rgba(0,71,255,0.3);
}

#evaluacion-container {
    display: none;
    height: auto;
    margin-top: 15px;
}

/* Ocultar completamente las pestañas inactivas */
.tab-pane {
    display: none !important; /* No ocupa espacio */
}

.tab-pane.active {
    display: block !important; /* Solo la activa visible */
}

/* Si quieres conservar el efecto fade */
.tab-pane.fade {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.tab-pane.fade.active {
    opacity: 1;
}





/* ====== GRID OPCIONES MÚLTIPLES ====== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .options-grid { grid-template-columns: 1fr; }
}

/* ====== TARJETA OPCIÓN ====== */
.option-card {
    border: 2px solid #E8EDF5;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card:hover {
    border-color: #2d6cdf;
    background: #F8FBFF;
    box-shadow: 0 4px 14px rgba(45,108,223,.12);
}

.option-card:has(input:checked) {
    border-color: #2d6cdf;
    background: linear-gradient(135deg, #EEF4FF, #F4F8FF);
    box-shadow: 0 0 0 3px rgba(45,108,223,.18);
}

.option-card::after {
    content: "✓";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    background: #2d6cdf;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 0.2s ease;
}

.option-card:has(input:checked)::after { transform: scale(1); }

/* ====== LETRA OPCIÓN (badge circular) ====== */
.option-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #E8EDF5;
    color: #374A6D;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}

.option-card:has(input:checked) .option-letter {
    background: #2d6cdf;
    color: #fff;
}

.option-text {
    flex: 1;
    line-height: 1.5;
    font-size: 13px;
    color: #374A6D;
    padding-top: 5px;
}

/* ====== IMÁGENES OPCIÓN ====== */
.img-option {
    display: block;
    margin: 6px auto 0;
    max-width: 100%;
    max-height: 130px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-in;
    transition: box-shadow 0.2s;
}

.img-option:hover { box-shadow: 0 6px 18px rgba(0,0,0,.18); }

/* ====== IMÁGENES PREGUNTA ====== */
.img-question {
    display: block;
    margin: 10px auto;
    max-width: 280px;
    max-height: 180px;
    object-fit: contain;
    border-radius: 10px;
    cursor: zoom-in;
    border: 1px solid #E8EDF5;
}

.img-question:hover { box-shadow: 0 8px 22px rgba(0,0,0,.18); }



/* ===== VERDADERO/FALSO ===== */
.vf-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .vf-group { grid-template-columns: 1fr; }
}

.vf-card {
    position: relative;
    padding: 16px 20px;
    border-radius: 12px;
    border: 2px solid #E8EDF5;
    background: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #374A6D;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.vf-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vf-card:hover {
    border-color: #2d6cdf;
    background: #F8FBFF;
    box-shadow: 0 4px 14px rgba(45,108,223,.1);
}

.vf-card:has(input:checked) {
    border-color: #2d6cdf;
    background: linear-gradient(135deg, #EEF4FF, #F4F8FF);
    box-shadow: 0 0 0 3px rgba(45,108,223,.18);
    color: #2d6cdf;
}

.vf-card::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 12px;
    width: 20px;
    height: 20px;
    background: #2d6cdf;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 0.2s ease;
}

.vf-card:has(input:checked)::after { transform: scale(1); }

/* ===== TARJETA PREGUNTA ===== */
.question-card {
    background: #fff;
    border: 1px solid #E8EDF5;
    border-left: 4px solid #2d6cdf;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.question-card.incompleta {
    border-left-color: #ef4444;
    background: #fef2f2;
}

/* Cabecera pregunta */
.question-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.question-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2d6cdf, #1a4fb5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.question-text {
    line-height: 1.6;
    font-size: 14px;
    color: #263238;
    padding-top: 4px;
}

.question-score {
    background: #FFF8E1;
    color: #F57F17;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Centrar imagen */
.option-card img {
    display: block;
    margin: 0 auto;
}


/* Fondo oscuro */
.image-viewer {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    text-align: center;
}

/* Imagen grande */
.viewer-content {
    max-width: 85%;
    max-height: 80%;
    border-radius: 12px;
    animation: zoomIn 0.3s ease;
}

/* Animación */
@keyframes zoomIn {
    from {transform: scale(0.7); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* Botón cerrar */
.close-viewer {
    position: absolute;
    top: 25px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-viewer:hover {
    color: #ff4d4d;
}


/* ===== WRAPPER FLOTANTE ===== */
.quiz-progress-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    padding: 10px 10px 8px 10px;
    border-bottom: 1px solid #f0f2f5;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.quiz-progress-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

/* Texto progreso */
.quiz-progress-text {
    font-size: 13px;
    font-weight: 600;
    color: #546E7A;
}

/* Badge countdown */
.quiz-countdown-badge {
    font-size: 15px;
    font-weight: 700;
    color: #1976D2;
    background: #e8f0fe;
    border: 2px solid #1976D2;
    border-radius: 8px;
    padding: 5px 16px;
    transition: color .4s, background .4s, border-color .4s;
    white-space: nowrap;
}
.quiz-countdown-badge.urgent {
    color: #fff;
    background: #e74c3c;
    border-color: #c0392b;
    animation: pulse-cd .6s infinite alternate;
    box-shadow: 0 0 8px rgba(231,76,60,.5);
}
@keyframes pulse-cd { from { opacity:1; transform:scale(1); } to { opacity:.85; transform:scale(1.03); } }

/* Barra base */
.quiz-progress-container {
    width: 100%;
    height: 10px;
    background: #eef1f6;
    border-radius: 20px;
    overflow: hidden;
}

/* Barra dinámica */
.quiz-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff4d4d, #ff884d);
    transition: width 0.4s ease, background 0.4s ease;
}


/* quiz corregido */

.options-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.question-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.question-title2 {
    display: block;
    width: 100%;
    text-align: justify;
    white-space: normal;
    color:  #375269;
}

.question-title2 {
    flex: 1;
    text-align: justify;
}

/* ═══════════════════════════════════════════════════
   LISTA DE EVALUACIONES (alumquiz-view.php)
   ═══════════════════════════════════════════════════ */

/* Header */
.aq-header {
    background: linear-gradient(135deg,#1976D2,#1565C0);
    border-radius:10px; padding:14px 20px; margin-bottom:16px;
    display:flex; align-items:center; gap:14px; color:#fff; flex-wrap:wrap;
}
.aq-header-icon {
    width:40px; height:40px; border-radius:50%;
    background:rgba(255,255,255,.18);
    display:flex; align-items:center; justify-content:center;
    font-size:18px; flex-shrink:0;
}
.aq-header h2 { margin:0; font-size:15px; font-weight:700; }
.aq-header p  { margin:2px 0 0; font-size:11px; opacity:.85; }
.aq-countdown-box {
    margin-left:auto; background:rgba(255,255,255,.15);
    border-radius:8px; padding:7px 14px; font-size:12px;
    display:flex; align-items:center; gap:6px;
}
.aq-countdown-time { font-weight:700; font-size:13px; }

/* Stats */
.aq-stats { display:flex; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.aq-stat  { flex:1; min-width:100px; background:#fff; border-radius:8px; padding:10px 14px; box-shadow:0 1px 6px rgba(0,0,0,.08); display:flex; align-items:center; gap:10px; }
.aq-stat-icon { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0; }
.aq-stat.encurso    .aq-stat-icon { background:#FFF8E1; color:#F57F17; }
.aq-stat.proximas   .aq-stat-icon { background:#E3F2FD; color:#1565C0; }
.aq-stat.finalizadas .aq-stat-icon { background:#E8F5E9; color:#2E7D32; }
.aq-stat-num { font-size:20px; font-weight:700; color:#263238; line-height:1; }
.aq-stat-lbl { font-size:11px; color:#78909C; margin-top:2px; }

/* Toolbar */
.aq-toolbar { display:flex; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.aq-tabs    { border:none; margin:0; flex-wrap:nowrap; }
.aq-search-wrap { position:relative; flex:1; min-width:200px; }
.aq-search-wrap i { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:#1976D2; font-size:13px; }
.aq-search { width:100%; padding:8px 10px 8px 30px; border:1px solid #E0E0E0; border-radius:8px; font-size:13px; outline:none; transition:border-color .2s; }
.aq-search:focus { border-color:#1976D2; }

/* Cards de evaluación */
.aq-tab-content { background:transparent; max-height:calc(100vh - 280px); overflow-y:auto; padding-right:2px; }
.aq-cards { display:flex; flex-direction:column; gap:10px; }
.aq-card {
    background:#fff; border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,.07);
    display:flex; align-items:center; gap:14px;
    padding:14px 16px; border-left:4px solid #E0E0E0;
    transition:box-shadow .2s;
}
.aq-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.12); }
.aq-card.encurso    { border-left-color:#F57F17; }
.aq-card.proxima    { border-left-color:#1976D2; }
.aq-card.finalizada { border-left-color:#2E7D32; }

.aq-card-icon { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.aq-card-icon.encurso    { background:#FFF8E1; color:#F57F17; }
.aq-card-icon.proxima    { background:#E3F2FD; color:#1565C0; }
.aq-card-icon.finalizada { background:#E8F5E9; color:#2E7D32; }

.aq-card-body    { flex:1; min-width:0; }
.aq-card-materia { font-size:13px; font-weight:700; color:#1565C0; margin-bottom:2px; }
.aq-card-desc    { font-size:12px; color:#546E7A; margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aq-card-dates   { display:flex; gap:14px; font-size:11px; color:#90A4AE; flex-wrap:wrap; }
.aq-card-dates span { display:flex; align-items:center; gap:4px; }
.aq-card-action  { flex-shrink:0; }

.aq-btn { border:none; border-radius:7px; padding:7px 16px; font-size:12px; font-weight:700; cursor:pointer; display:flex; align-items:center; gap:6px; transition:opacity .2s; }
.aq-btn.iniciar    { background:#F57F17; color:#fff; }
.aq-btn.finalizada { background:#2E7D32; color:#fff; }
.aq-btn.aq-btn-enviado { background:#E8F5E9; color:#2E7D32; border:1.5px solid #A5D6A7; cursor:default; }
.aq-btn:hover      { opacity:.85; }
.aq-card.enviada   { border-left-color:#2E7D32; }
.aq-card-icon.enviada { background:#E8F5E9; color:#2E7D32; }

.aq-badge-prox { background:#E3F2FD; color:#1565C0; padding:6px 12px; border-radius:20px; font-size:11px; font-weight:700; display:flex; align-items:center; gap:5px; }
.aq-btn-back   { background:#546E7A; color:#fff; border:none; border-radius:7px; padding:7px 14px; font-size:12px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:6px; margin-bottom:14px; }

.aq-empty   { text-align:center; padding:40px 20px; color:#90A4AE; }
.aq-empty i { font-size:36px; margin-bottom:10px; display:block; }
.aq-empty p { font-size:14px; }

@media(max-width:600px){
    .aq-stats { gap:8px; }
    .aq-stat  { min-width:calc(50% - 8px); flex:unset; }
    .aq-toolbar { flex-direction:column; align-items:stretch; }
    .aq-card { flex-wrap:wrap; }
    .aq-card-action { width:100%; }
    .aq-btn { width:100%; justify-content:center; }
    .aq-countdown-box { margin-left:0; width:100%; }
}