:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --success-color: #4cc9f0;
    --error-color: #f72585;
    --warning-color: #f8961e;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --white: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.app-header h1 {
    font-family: 'Roboto Slab', serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.app-header .subtitle {
    font-size: 1.1rem;
    color: var(--gray-color);
    font-weight: 300;
}

.card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.08);
}

.form-container {
    text-align: center;
    max-width: 500px;
    margin: 0 auto 30px;
}

.form-container h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="text"] {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
}

input[type="text"]:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

button {
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: #f0f4ff;
    transform: translateY(-2px);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
}

.student-header {
    text-align: center;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#welcome-message {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin: 0;
}

.score-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.score-badge .score-value {
    font-size: 1.2rem;
}

.exercises-card {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    min-width: 600px;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 500;
    position: sticky;
    top: 0;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #f1f3f5;
}

.answer-radio {
    transform: scale(1.3);
    margin-right: 8px;
}

.hidden {
    display: none;
}

.results-card {
    text-align: center;
    padding: 20px;
}

#score-message {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

#feedback-message {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.correct {
    color: var(--success-color);
    font-weight: bold;
}

.incorrect {
    color: var(--error-color);
    font-weight: bold;
}

.correct-row {
    background-color: rgba(76, 201, 240, 0.1) !important;
}

.incorrect-row {
    background-color: rgba(247, 37, 133, 0.1) !important;
}

.correct-option {
    color: var(--success-color);
    font-weight: bold;
}

.incorrect-option {
    color: var(--error-color);
}

button:disabled {
    background-color: #adb5bd !important;
    color: #6c757d !important;
    cursor: not-allowed;
    transform: none !important;
    border: none !important;
}

/* Estilos para móviles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 15px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    input[type="text"] {
        padding: 12px;
    }
    
    .student-header {
        flex-direction: column;
        align-items: center;
    }
    
    #welcome-message {
        font-size: 1.3rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Estilos para las ecuaciones matemáticas */
.math-container {
    text-align: center;
    margin: 10px 0;
}

/* Asegurar que las ecuaciones matemáticas se vean bien en la tabla */
td .MathJax {
    display: inline-block;
    margin: 0;
    font-size: 1.1rem;
}