:root {
    --primary-color: #79A3B1;
    --primary-dark: #456268;
    --secondary-color: #D0E8F2;
    --bg-color: #F4F9F9;
    --text-color: #333333;
    --light-text: #555555;
    --white: #FFFFFF;
    --success-color: #8CC084;
    --footer-text: #000080;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Modal de Registro */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.modal-content h2 { color: var(--primary-dark); margin-bottom: 10px; }
.modal-content p { margin-bottom: 20px; font-size: 0.9em; color: var(--light-text); }
.modal-content form { display: flex; flex-direction: column; gap: 12px; }
.modal-content label { font-weight: bold; font-size: 0.85em; }
.modal-content input, .modal-content select {
    padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em;
}

/* Botones */
button { cursor: pointer; padding: 10px 15px; border: none; border-radius: 5px; font-weight: bold; transition: 0.3s; }
.btn-primary { background-color: var(--primary-dark); color: var(--white); }
.btn-primary:hover { background-color: #2b3e42; }
.btn-secondary { background-color: #ccc; color: #333; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success { background-color: var(--success-color); color: white; width: 100%; margin-top: 10px; }
.btn-success:hover { background-color: #6da365; }

/* Contenedor Principal */
.hidden { display: none !important; }
.app-container { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.app-header {
    background: var(--white); padding: 15px 30px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 3px solid var(--primary-color);
}
.app-header h1 { font-size: 1.5em; color: var(--primary-dark); }
.student-badge { background: var(--secondary-color); padding: 5px 15px; border-radius: 20px; }
.badge-name { font-weight: bold; color: var(--primary-dark); display: block;}
.badge-details { font-size: 0.8em; color: var(--primary-dark); }

/* Layout de 3 Columnas */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    padding: 20px;
    flex: 1;
}

/* Columna Izquierda: Progreso y Navegación clickable */
.sidebar-left { background: var(--white); padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.sidebar-left h3 { margin-bottom: 15px; color: var(--primary-dark); }
.progress-container { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
progress { flex: 1; height: 10px; border-radius: 5px; }
progress::-webkit-progress-bar { background-color: #eee; border-radius: 5px; }
progress::-webkit-progress-value { background-color: var(--success-color); border-radius: 5px; }

.nav-list { list-style: none; }
.nav-list li { 
    margin-bottom: 5px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 0.9em; 
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.nav-list li:hover { background-color: var(--bg-color); }
.nav-list li.active-step { background-color: var(--secondary-color); font-weight: bold; }
.nav-list .step-link { flex: 1; cursor: pointer; display: block; }
.nav-list input[type="checkbox"] { transform: scale(1.1); cursor: pointer; }

/* Columna Central: Contenido */
.content-center {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.step-section { display: none; flex: 1; animation: fadeIn 0.3s ease-out; }
.step-section.active { display: block; }
.step-section h2 { color: var(--primary-dark); margin-bottom: 15px; border-bottom: 2px solid var(--secondary-color); padding-bottom: 5px; }
.step-section h3 { margin: 15px 0 10px 0; color: var(--primary-color); }
.step-section p, .step-section ul, .step-section ol { margin-bottom: 15px; }
.step-section ul, .step-section ol { padding-left: 20px; }

/* Código */
pre {
    background: var(--code-bg); color: var(--code-text);
    padding: 15px; border-radius: 5px; overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace; font-size: 0.9em;
    margin-bottom: 20px;
}

/* Cajas de actividades e imágenes */
.activity-box { background: #f0f7f4; border-left: 4px solid var(--success-color); padding: 15px; margin: 15px 0; border-radius: 4px; }
.image-placeholder { margin: 20px 0; text-align: center; background: #f0f0f0; border: 2px dashed #ccc; padding: 20px; border-radius: 5px; }
.image-placeholder img { max-width: 100%; height: auto; border-radius: 5px; }
.img-caption { font-size: 0.85em; color: var(--light-text); margin-top: 10px; font-style: italic; }

/* Sprint Challenge */
.challenge-section { background: #fffcf0; border: 2px solid #f2db88; padding: 20px; border-radius: 8px; }
.evaluation-table { width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 0.9em; }
.evaluation-table th, .evaluation-table td { border: 1px solid #ccc; padding: 10px; text-align: left; }
.evaluation-table th { background: var(--secondary-color); color: var(--primary-dark); }
.instructions-box { background: #e6f7ff; padding: 15px; border-left: 4px solid var(--primary-color); border-radius: 4px; margin-top: 15px; }

/* Controles de Paginación */
.pagination-controls { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 15px; border-top: 1px solid #eee; }

/* Columna Derecha: Notas */
.sidebar-right { background: var(--white); padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; flex-direction: column; }
.sidebar-right h3 { color: var(--primary-dark); }
.notes-hint { font-size: 0.8em; color: var(--light-text); margin-bottom: 10px; }
textarea { flex: 1; resize: none; width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-family: inherit; font-size: 0.9em; margin-bottom: 15px; background: #fafbfc; }

/* Footer */
.app-footer { text-align: center; padding: 15px; background: var(--white); border-top: 1px solid #ddd; margin-top: auto; }
.app-footer p { color: var(--footer-text); font-size: 0.85em; font-weight: bold; margin: 0; }

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

/* Responsivo (Móviles) */
@media (max-width: 900px) {
    .main-layout { display: flex; flex-direction: column; }
    .sidebar-left { order: 1; }
    .content-center { order: 2; }
    .sidebar-right { order: 3; min-height: 300px; }
    .app-header { flex-direction: column; text-align: center; gap: 10px; }
}