: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;
    --green-color: #4df755;
    --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(--green-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(--green-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="text"], input[type="number"] {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
}

input[type="text"]:focus, input[type="number"]: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(--green-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(--green-color);
    font-size: 1.5rem;
    margin: 0;
}

.highlight-name {
    color: var(--green-color);
    font-weight: 600;
}

.score-badge {
    background: linear-gradient(135deg, var(--green-color) 0%, var(--success-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;
}

.exercise-item {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--light-color);
    position: relative;
}

.exercise-equation {
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.solution-input {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.solution-input label {
    font-weight: 500;
}

.solution-input input {
    max-width: 150px;
}

.exercise-feedback {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}

.correct-feedback {
    background-color: rgba(76, 201, 240, 0.2);
    color: var(--success-color);
    display: block;
}

.incorrect-feedback {
    background-color: rgba(247, 37, 133, 0.1);
    color: var(--error-color);
    display: block;
}

.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;
}

button:disabled {
    background-color: #adb5bd !important;
    color: #6c757d !important;
    cursor: not-allowed;
    transform: none !important;
    border: none !important;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.pulse {
    animation: pulse 1s ease infinite;
}

.error-shake {
    animation: errorShake 0.5s ease;
    border-color: var(--error-color) !important;
}

.score-up {
    animation: pulse 0.5s ease;
}

/* 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"], input[type="number"] {
        padding: 12px;
    }
    
    .student-header {
        flex-direction: column;
        align-items: center;
    }
    
    #welcome-message {
        font-size: 1.3rem;
    }
    
    .solution-input {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .solution-input input {
        max-width: 100%;
        width: 100%;
    }
}