:root {
    /* Color Palette */
    --color-primary: #9c27b0; /* Violeta/Fucsia */
    --color-primary-light: #d05ce3;
    --color-primary-dark: #6a0080;
    --color-secondary: #2196f3; /* Azul Cyber */
    --color-secondary-light: #6ec6ff;
    --color-secondary-dark: #0069c0;
    --color-dark: #121212; /* Negro Elegante - Fondo */
    --color-dark-light: #1e1e1e;
    --color-text-secondary: #e0e0e0; /* Blanco Opaco - Textos secundarios */
    --color-text-primary: #ffffff;
    --color-background: #0a0a0a;
    --color-card-bg: #1a1a1a;
    --color-border: #333333;
    /* Typography */
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Orbitron', sans-serif;
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    /* Animation */
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--color-background);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px;
}

/* Header */
.nav-header {
    background-color: var(--color-background);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.logo {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.world {
    color: var(--color-text-primary);
}

.reactive {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.back-button:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.5s ease;
}

.back-button:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
}

.back-button:hover:before {
    transform: scale(1.5);
    opacity: 0;
}

.back-button i {
    position: relative;
    z-index: 2;
}

/* Contenedor Principal */
.pregunta-container {
    max-width: 800px;
    margin: 9rem auto 3rem;
    background: var(--color-card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: var(--spacing-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.pregunta-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, rgba(156, 39, 176, 0.08), transparent 70%),
                radial-gradient(circle at 30% 70%, rgba(33, 150, 243, 0.08), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Título */
.pildora-title {
    font-family: var(--font-secondary);
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    position: relative;
    text-align: center;
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.05em;
    color: var(--color-text-primary);
}

.quiz-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.gradient-text {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Estilos para el tema combo y preguntas */
.preguntas-lista {
    margin-bottom: var(--spacing-md);
    text-align: left;
    position: relative;
    z-index: 1;
}

/* Estilos para la tabla de resumen */
.resumen-container {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--color-dark-light);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    overflow-x: auto; /* Permitir scroll horizontal en pantallas pequeu00f1as */
}

/* Estilos para respuestas correctas e incorrectas */
.respuesta-correcta {
    background-color: rgba(76, 175, 80, 0.2) !important;
    border-color: rgba(76, 175, 80, 0.6) !important;
    position: relative;
}

.respuesta-correcta::after {
    content: '\2713'; /* Símbolo de check */
    position: absolute;
    right: 10px;
    color: #4CAF50;
    font-weight: bold;
}

.respuesta-incorrecta {
    background-color: rgba(244, 67, 54, 0.2) !important;
    border-color: rgba(244, 67, 54, 0.6) !important;
    position: relative;
}

.respuesta-incorrecta::after {
    content: '\2717'; /* Símbolo de X */
    position: absolute;
    right: 10px;
    color: #F44336;
    font-weight: bold;
}

.era-correcta {
    border: 2px dashed rgba(76, 175, 80, 0.6) !important;
}

.resumen-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--color-primary);
}

.resumen-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.resumen-tabla th, .resumen-tabla td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

/* Estilos responsivos para mu00f3viles */
@media (max-width: 768px) {
    /* Logo más pequeño en móviles */
    .logo {
        font-size: 1.4rem;
    }
    
    /* Ajustar tamaño de la barra de navegación */
    .nav-header {
        padding: 10px 15px;
    }
    
    /* Ajustar tamaño del botón de volver */
    .back-button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .resumen-tabla {
        width: 100%;
        display: block;
        overflow-x: auto;
    }
    
    .resumen-tabla thead {
        display: none; /* Ocultar la cabecera en mu00f3viles */
    }
    
    .resumen-tabla tbody {
        display: block;
        width: 100%;
    }
    
    .resumen-tabla tbody tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius-md);
        padding: 0.5rem;
        background-color: rgba(30, 30, 30, 0.6);
        width: 100%;
    }
    
    .resumen-tabla td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: left;
    }
    
    .resumen-tabla td:last-child {
        border-bottom: none;
    }
    
    .resumen-tabla td:before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--color-primary);
        margin-right: 1rem;
        flex-basis: 40%;
        flex-shrink: 0;
    }
    
    .resumen-tabla td .respuesta-correcta,
    .resumen-tabla td .respuesta-incorrecta {
        margin-left: auto;
    }
    
    /* Ajustar colores y visibilidad de respuestas correctas/incorrectas */
    .respuesta-correcta-fila {
        border-left: 3px solid rgba(76, 175, 80, 0.6) !important;
    }
    
    .respuesta-incorrecta-fila {
        border-left: 3px solid rgba(244, 67, 54, 0.6) !important;
    }
}

.resumen-tabla th {
    background-color: rgba(156, 39, 176, 0.1);
    color: var(--color-primary);
    font-weight: bold;
}

.resumen-tabla tr:nth-child(even) {
    background-color: rgba(33, 150, 243, 0.05);
}

.resumen-tabla tr:hover {
    background-color: rgba(156, 39, 176, 0.08);
}

/* Estilos para el paginador */
.paginador {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
    gap: 0.5rem;
}

.pagina-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-dark-light);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagina-btn:hover {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-secondary-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.pagina-btn.activa {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(156, 39, 176, 0.5);
}

.pagina-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagina-info {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.tema-select {
    width: 80%;
    max-width: 400px;
    margin: 0 auto var(--spacing-md);
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    background-color: var(--color-dark-light);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.tema-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.2), 0 3px 10px rgba(0, 0, 0, 0.2);
}

.tema-select option {
    padding: 10px;
    background-color: var(--color-dark-light);
}

/* Estilos para las preguntas */
.preguntas-container {
    position: relative;
    z-index: 1;
}

.preguntas-resumen {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(26, 26, 38, 0.7);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
}

.pregunta-contador {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.nivel-badge {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 10px;
}

.contador-texto {
    color: var(--color-text-secondary);
}

.progreso-contenedor {
    width: 100%;
    height: 6px;
    background: var(--color-dark-light);
    border-radius: 3px;
    overflow: hidden;
}

.progreso-barra {
    height: 100%;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    width: 0;
    transition: width 0.4s ease-out;
}

.pregunta-card {
    background: var(--color-dark-light);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pregunta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.pregunta-numero {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.pregunta-texto {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.opciones-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opcion-item {
    position: relative;
}

.opcion-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(30, 30, 42, 0.6);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
}

.opcion-label:hover {
    background: rgba(40, 40, 56, 0.8);
    border-color: rgba(156, 39, 176, 0.4);
}

.opcion-label input[type="radio"] {
    opacity: 0;
    position: absolute;
}

.opcion-texto {
    position: relative;
    padding-left: 30px;
}

.opcion-texto:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.opcion-label input[type="radio"]:checked + .opcion-texto:before {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: inset 0 0 0 4px var(--color-dark-light);
}

.respuesta-libre {
    margin-top: var(--spacing-sm);
}

.respuesta-texto {
    width: 100%;
    min-height: 80px;
    background: rgba(30, 30, 42, 0.6);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text-primary);
    padding: 12px;
    font-family: var(--font-primary);
    font-size: 1rem;
    resize: vertical;
    transition: all 0.2s ease;
}

.respuesta-texto:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.2);
}

.btn-container {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-md);
}

.verificar-btn {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.verificar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(156, 39, 176, 0.4);
}

.verificar-btn:active {
    transform: translateY(1px);
}
