/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Contenedor principal */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 20px;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.2em;
    margin-bottom: 10px;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Ejercicios */
.exercise {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    border-left: 6px solid #667eea;
    transition: all 0.3s ease;
}

.exercise:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.exercise-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.exercise-number {
    background: #667eea;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.exercise-title {
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: bold;
}

/* Indicadores de dificultad */
.difficulty {
    margin-left: auto;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
}

.easy { 
    background: #d4edda; 
    color: #155724; 
}

.medium { 
    background: #fff3cd; 
    color: #856404; 
}

.hard { 
    background: #f8d7da; 
    color: #721c24; 
}

/* Problema */
.problem {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #17a2b8;
    font-size: 1.1em;
    line-height: 1.6;
}

.problem code {
    background: #f8f9fa;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #e83e8c;
    font-size: 0.9em;
}

/* Botón de solución */
.show-solution-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 15px 0;
    font-size: 14px;
}

.show-solution-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Solución */
.solution {
    background: #e3f2fd;
    border: 2px solid #bbdefb;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    display: none;
}

.solution.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.solution-code {
    background: #263238;
    color: #eeffff;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    margin: 15px 0;
    border-left: 4px solid #667eea;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

/* Caja de conceptos */
.concept-box {
    background: #e8f5e8;
    border: 2px solid #c3e6cb;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border-left: 6px solid #28a745;
}

.concept-title {
    font-weight: bold;
    color: #155724;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* Badge de tipo */
.type-badge {
    background: #6f42c1;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 10px;
}

/* Sistema de autenticación */
.password-screen {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 9999;
}

.password-box {
    background: white; 
    padding: 40px; 
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); 
    text-align: center; 
    max-width: 400px; 
    width: 90%;
}

.password-input { 
    width: 100%; 
    padding: 15px; 
    border: 2px solid #ddd; 
    border-radius: 8px; 
    font-size: 16px; 
    margin: 20px 0; 
}

.password-btn { 
    background: #667eea; 
    color: white; 
    border: none; 
    padding: 15px 30px; 
    border-radius: 8px; 
    font-size: 16px; 
    cursor: pointer; 
    width: 100%; 
}

.password-error { 
    color: #e74c3c; 
    margin-top: 10px; 
    display: none; 
}

.page-content { 
    display: none; 
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .exercise {
        padding: 20px;
        margin: 20px 0;
    }
    
    .exercise-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .difficulty {
        margin-left: 0;
    }
    
    .solution-code {
        font-size: 12px;
        padding: 15px;
    }
    
    .password-box {
        padding: 30px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .exercise {
        padding: 15px;
    }
    
    .solution-code {
        font-size: 11px;
        padding: 10px;
    }
}