/* ============================================
   ESTILOS PARA EL FRONTEND (VISITANTES)
   ============================================ */

/* Lista de cursos */
.cursos-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.curso-item {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.curso-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-color: #007cba;
}

.curso-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #007cba, #00a0d2);
}

.curso-item h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.curso-item .curso-descripcion {
    color: #5d6d7e;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 15px;
}

/* Botones */
.curso-item .button {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    margin-top: 10px;
}

.curso-item .button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.2);
}

/* Contenedor del Quiz */
.quiz-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
}

.quiz-container h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    text-align: center;
}

/* Preguntas */
.pregunta {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 25px 0;
    padding: 25px;
    transition: all 0.3s ease;
}

.pregunta:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
}

.pregunta h3 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 1.5;
}

.pregunta label {
    display: block;
    padding: 12px 15px;
    margin: 8px 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.pregunta label:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.pregunta label input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.1);
}

.pregunta label.selected {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

/* Bot贸n enviar quiz */
button[name="lms_quiz_submit"] {
    display: block;
    width: 100%;
    background: linear-gradient(to right, #28a745, #20c997);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button[name="lms_quiz_submit"]:hover {
    background: linear-gradient(to right, #218838, #1ba37e);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

button[name="lms_quiz_submit"]:active {
    transform: translateY(0);
}

/* Resultados del quiz */
.quiz-resultado {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.quiz-resultado h3 {
    margin-top: 0;
    font-size: 24px;
    margin-bottom: 15px;
}

.quiz-resultado p {
    font-size: 18px;
    margin-bottom: 20px;
}

.quiz-resultado .puntaje-final {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.quiz-resultado .volver-intentar {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    border: 2px solid white;
    transition: all 0.3s ease;
}

.quiz-resultado .volver-intentar:hover {
    background: white;
    color: #764ba2;
}

/* Mensajes de error */
.lms-error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #c33;
    margin: 20px 0;
}

/* Loading spinner */
.lms-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 124, 186, 0.3);
    border-radius: 50%;
    border-top-color: #007cba;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .cursos-lista {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quiz-container {
        padding: 20px;
        margin: 20px;
    }
    
    .pregunta {
        padding: 20px;
    }
    
    .quiz-resultado {
        padding: 20px;
    }
    
    .quiz-resultado .puntaje-final {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .curso-item {
        padding: 20px;
    }
    
    .pregunta label {
        padding: 10px;
        font-size: 14px;
    }
}