:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --success-color: #4cc9f0;
    --error-color: #f72585;
    --warning-color: #f8961e;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --text-color: #2b2d42;
    --bg-color: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f0f2f5;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.screen {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

.hidden {
    display: none;
}

/* Pantalla de inicio */
#start-screen {
    align-items: center;
    text-align: center;
    padding: 30px 20px;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 30px;
}

.input-container {
    width: 100%;
    max-width: 350px;
}

/* Elementos de formulario */
input[type="text"], 
input[type="number"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

input[type="text"]:focus, 
input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Botones */
button {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    width: 100%;
}

.primary-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.action-btn {
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    flex: 1;
}

.verify-btn {
    background-color: var(--success-color);
    color: white;
}

.help-btn {
    background-color: var(--accent-color);
    color: white;
}

.back-btn {
    background: none;
    color: var(--primary-color);
    padding: 10px;
    font-size: 0.9rem;
}

/* Header principal */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.user-info i {
    font-size: 1.4rem;
    color: var(--primary-color);
}

.score-container {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: white;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.score-container i {
    color: var(--warning-color);
}

/* Tarjeta de ecuación */
.equation-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.card-header {
    margin-bottom: 15px;
}

.card-header p {
    font-size: 0.9rem;
    color: #6c757d;
}

.equation-display {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
    color: var(--primary-color);
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}

.answer-section {
    margin-top: 25px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.next-btn {
    margin-top: 20px;
}

/* Barra de progreso */
.progress-container {
    margin-top: 25px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 5px;
    width: 0%;
    transition: width 0.5s ease;
}

/* Feedback */
.feedback-message {
    min-height: 50px;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
}

.correct {
    background-color: rgba(76, 201, 240, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 201, 240, 0.3);
}

.incorrect {
    background-color: rgba(247, 37, 133, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(247, 37, 133, 0.3);
}

/* Pantalla de ayuda */
.help-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

#help-title {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.help-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.example-equation {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 15px 0;
    text-align: center;
    color: var(--secondary-color);
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}

.help-card ol {
    padding-left: 20px;
    margin: 15px 0;
}

.help-card li {
    margin-bottom: 10px;
}

/* Efectos de deshabilitado */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Media queries para móviles pequeños */
@media (max-width: 400px) {
    .app-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .equation-display {
        font-size: 1.5rem;
        padding: 10px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

@media (max-height: 700px) {
    .app-container {
        justify-content: flex-start;
        padding-top: 30px;
    }
}