/* ==========================================
   ESTILOS GENERALES Y DISEÑO DE LA PLATAFORMA
   ========================================== */

:root {
    --primary-color: #4f46e5;      /* Indigo moderno */
    --primary-hover: #4338ca;
    --success-color: #10b981;      /* Esmeralda */
    --danger-color: #ef4444;       /* Rojo suave */
    --warning-color: #f59e0b;      /* Ámbar */
    --background-color: #f3f4f6;   /* Gris claro */
    --card-background: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease-in-out;
}

/* Reset de estilos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 640px;
    background: var(--card-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Pantallas y Estados */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: flex;
}

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

h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    text-align: center;
}

p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
    margin-bottom: 24px;
}

/* Inputs y Botones */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 16px;
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

button {
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    border: none;
    border-radius: 8px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 14px 24px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.unit-btn {
    background-color: #ffffff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    width: 100%;
    margin-bottom: 12px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.unit-btn:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    transform: translateX(2px);
}

/* Secciones de Examen */
.exam-section {
    width: 100%;
    background-color: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.exam-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.exam-section p {
    text-align: left;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Pantalla del Quiz */
.header-info {
    width: 100%;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

#progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.card {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#question-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.4;
}

#options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.option-btn {
    background-color: #ffffff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    border-radius: 8px;
}

.option-btn:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.option-btn:disabled {
    cursor: not-allowed;
}

/* Colores para respuestas */
.option-btn.correct {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: var(--success-color) !important;
    color: #065f46 !important;
    font-weight: 600;
}

.option-btn.incorrect {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: var(--danger-color) !important;
    color: #991b1b !important;
    font-weight: 600;
}

/* Botones de Navegación del Quiz */
#next-btn, #finish-btn {
    padding: 14px 24px;
    width: 100%;
    color: white;
    background-color: var(--primary-color);
}

#next-btn:hover, #finish-btn:hover {
    background-color: var(--primary-hover);
}

/* Pantalla de Resultados */
.score-result {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

#feedback-message {
    font-size: 16px;
    margin-bottom: 24px;
}

/* Clases Utilitarias */
.hidden {
    display: none !important;
}

.error {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
    text-align: center;
}
