/* Test Personalizado - Estilos Frontend */

/* Single Test Page */
.tpo-single-test-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.tpo-single-test {
    background: transparent;
}

/* Archive Tests Page */
.tpo-archive-tests-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.tpo-archive-tests-page .page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tpo-archive-tests-page .page-title {
    font-size: 36px;
    margin: 0 0 15px 0;
    color: #1a1a1a;
}

.tpo-archive-tests-page .archive-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* Contenedor principal del test */
.tpo-test-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Cabecera del test */
.tpo-test-header {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.tpo-test-title {
    font-size: 28px;
    margin: 0 0 15px 0;
    color: #1a1a1a;
}

.tpo-test-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.tpo-test-info {
    display: flex;
    gap: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tpo-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
}

.tpo-info-item .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Aviso de login */
.tpo-login-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.tpo-login-notice p {
    margin: 0 0 15px 0;
    color: #856404;
}

/* Cronómetro */
.tpo-timer-wrapper {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

.tpo-timer {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 600;
    color: #2271b1;
}

.tpo-timer.warning {
    color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Tarjetas de preguntas */
.tpo-pregunta-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.tpo-pregunta-numero {
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.tpo-pregunta-texto {
    font-size: 18px;
    color: #1a1a1a;
    line-height: 1.6;
    margin-bottom: 25px;
}

.tpo-pregunta-texto p {
    margin: 0;
}

/* Respuestas */
.tpo-respuestas {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tpo-respuesta-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tpo-respuesta-label:hover {
    border-color: #2271b1;
    background: #f7f9fc;
}

.tpo-respuesta-label input[type="radio"] {
    margin-top: 3px;
    cursor: pointer;
}

.tpo-respuesta-label input[type="radio"]:checked + .tpo-respuesta-texto {
    color: #2271b1;
    font-weight: 600;
}

.tpo-respuesta-label:has(input:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
}

.tpo-respuesta-texto {
    flex: 1;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.tpo-respuesta-letra {
    font-weight: 700;
    color: #2271b1;
    margin-right: 8px;
}

/* Estados de respuesta (tras enviar) */
.tpo-respuesta-label.correcta {
    border-color: #28a745;
    background: #d4edda;
}

.tpo-respuesta-label.incorrecta {
    border-color: #dc3545;
    background: #f8d7da;
}

.tpo-respuesta-label.no-seleccionada {
    opacity: 0.5;
}

/* Barra de progreso */
.tpo-progress-bar {
    position: relative;
    height: 40px;
    background: #e0e0e0;
    border-radius: 20px;
    margin: 30px 0;
    overflow: hidden;
}

.tpo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #50b3ff 100%);
    border-radius: 20px;
    transition: width 0.3s ease;
}

.tpo-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

/* Botones de acción */
.tpo-test-actions {
    text-align: center;
    padding: 30px 0;
}

.tpo-submit-btn {
    font-size: 18px;
    padding: 12px 40px;
    height: auto;
}

.tpo-submit-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* Resultados */
.tpo-test-results {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.tpo-resultado-header {
    margin-bottom: 30px;
}

.tpo-resultado-estado {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.tpo-resultado-estado.aprobado {
    color: #28a745;
}

.tpo-resultado-estado.suspendido {
    color: #dc3545;
}

.tpo-puntuacion-grande {
    font-size: 64px;
    font-weight: 800;
    color: #2271b1;
    margin: 20px 0;
}

.tpo-resultado-detalles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.tpo-detalle-item {
    padding: 20px;
    border-radius: 8px;
    background: #f7f9fc;
}

.tpo-detalle-numero {
    font-size: 36px;
    font-weight: 700;
    color: #2271b1;
    display: block;
}

.tpo-detalle-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.tpo-detalle-item.correctas .tpo-detalle-numero {
    color: #28a745;
}

.tpo-detalle-item.incorrectas .tpo-detalle-numero {
    color: #dc3545;
}

/* Lista de tests */
.tpo-lista-tests-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Filtros */
.tpo-filtros-wrapper {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.tpo-filtros-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.tpo-filtro-item {
    flex: 1;
    min-width: 200px;
}

.tpo-filtro-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tpo-filtro-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Grid de tests */
.tpo-tests-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

.tpo-tests-grid.tpo-columnas-1 {
    grid-template-columns: 1fr;
}

.tpo-tests-grid.tpo-columnas-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tpo-tests-grid.tpo-columnas-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tpo-tests-grid.tpo-columnas-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Tarjeta de test en lista */
.tpo-test-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tpo-test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.tpo-test-thumbnail {
    overflow: hidden;
    height: 200px;
}

.tpo-test-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tpo-test-content {
    padding: 25px;
}

.tpo-test-card-title {
    font-size: 20px;
    margin: 0 0 15px 0;
}

.tpo-test-card-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tpo-test-card-title a:hover {
    color: #2271b1;
}

.tpo-test-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.tpo-test-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tpo-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.tpo-meta-item .dashicons {
    color: #2271b1;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Badges de taxonomía */
.tpo-test-taxonomies {
    margin-bottom: 20px;
}

.tpo-taxonomies-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.tpo-tax-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tpo-materia-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.tpo-tema-badge {
    background: #f3e5f5;
    color: #7b1fa2;
}

.tpo-test-link {
    width: 100%;
    text-align: center;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Paginación */
.tpo-pagination {
    text-align: center;
    padding: 20px 0;
}

.tpo-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #2271b1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tpo-pagination .page-numbers:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.tpo-pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Mensaje sin resultados */
.tpo-no-tests {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tpo-no-tests p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

/* Mensajes de error */
.tpo-error {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .tpo-tests-grid.tpo-columnas-3,
    .tpo-tests-grid.tpo-columnas-4 {
        grid-template-columns: 1fr;
    }
    
    .tpo-tests-grid.tpo-columnas-2 {
        grid-template-columns: 1fr;
    }
    
    .tpo-test-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .tpo-filtros-form {
        flex-direction: column;
    }
    
    .tpo-filtro-item {
        width: 100%;
    }
    
    .tpo-resultado-detalles {
        grid-template-columns: 1fr;
    }
}
