/* ==========================================================================
   VARIABLES Y CONFIGURACIÓN GENERAL (Paleta Pastel Verde, Azul y Grises)
   ========================================================================== */
:root {
    --primary-blue: #2c3e50;
    --accent-blue: #3498db;
    --pastel-green-bg: #e8f8f5;
    --accent-green: #2ecc71;
    --dark-green: #16a085;
    --bg-light-gray: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #34495e;
    --text-muted: #7f8c8d;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-light-gray);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   MODAL DE REGISTRO INICIAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    background-color: var(--bg-card);
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
}

.modal-card h2 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 22px;
}

.modal-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--primary-blue);
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-main);
    background-color: #fff;
}

.form-group input[readonly] {
    background-color: #edf2f7;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ==========================================================================
   ESTRUCTURA DE TRES COLUMNAS (ESCRITORIO)
   ========================================================================== */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    padding: 20px;
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* BARRA LATERAL IZQUIERDA */
.sidebar-left {
    background-color: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.student-badge {
    background-color: var(--pastel-green-bg);
    border-left: 4px solid var(--dark-green);
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
}

.student-badge p {
    margin-bottom: 4px;
}

.progress-section h3, .step-nav h3, .sidebar-right h3 {
    font-size: 16px;
    color: var(--primary-blue);
    margin-bottom: 12px;
    font-weight: 700;
}

.progress-bar-container {
    background-color: #edf2f7;
    border-radius: 20px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    background-color: var(--accent-green);
    height: 100%;
    color: white;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    font-weight: bold;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--text-muted);
}

.step-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: var(--bg-light-gray);
}

.nav-item.active {
    background-color: #ebf5fb;
    border-left: 3px solid var(--accent-blue);
}

.nav-item label {
    cursor: pointer;
    font-size: 14px;
    flex-grow: 1;
}

/* COLUMNA CENTRAL (MÁXIMA PRIORIDAD) */
.content-center {
    background-color: var(--bg-card);
    border-radius: 10px;
    padding: 30px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.practice-section {
    display: none;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.practice-section.active {
    display: flex;
}

.practice-section h2 {
    color: var(--primary-blue);
    font-size: 22px;
    border-bottom: 2px solid var(--pastel-green-bg);
    padding-bottom: 8px;
}

.practice-section p, .practice-section ol, .practice-section ul {
    font-size: 15px;
    line-height: 1.6;
}

.practice-section ol, .practice-section ul {
    padding-left: 20px;
}

.practice-section li {
    margin-bottom: 8px;
}

.highlight {
    background-color: #fef9e7;
    color: #b7950b;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
}

.path-box {
    background-color: #eaecee;
    padding: 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    border-left: 4px solid var(--text-muted);
}

.instruction-note {
    background-color: var(--pastel-green-bg);
    border-left: 4px solid var(--accent-green);
    padding: 12px;
    border-radius: 4px;
    font-style: italic;
}

pre {
    background-color: var(--code-bg);
    color: var(--code-text);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
    margin: 10px 0;
    max-height: 400px;
    overflow-y: auto;
}

/* CONTENEDORES DE IMÁGENES FUTURAS */
.image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background-color: var(--bg-light-gray);
    border-radius: 6px;
    border: 1px dashed #bdc3c7;
}

.practice-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    object-fit: contain;
    display: block;
}

/* BOTONES DE NAVEGACIÓN INTERNA */
.flow-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* BARRA LATERAL DERECHA (NOTAS) */
.sidebar-right {
    background-color: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

#student-notes {
    width: 100%;
    flex: 1;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: none;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.5;
    background-color: #fffdec;
}

/* ELEMENTOS DE BOTONES */
button {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background-color: #e2e8f0 !important;
    color: #a0aec0 !important;
    cursor: not-allowed;
    transform: none;
}

.btn-primary { background-color: var(--accent-blue); color: white; }
.btn-primary:hover { background-color: #2980b9; }

.btn-secondary { background-color: #e2e8f0; color: var(--text-main); }
.btn-secondary:hover { background-color: #cbd5e1; }

.btn-success { background-color: var(--accent-green); color: white; }
.btn-success:hover { background-color: #27ae60; }

/* ==========================================================================
   PIE DE PÁGINA (CRÉDITOS VISIBLES)
   ========================================================================== */
footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    margin-top: auto;
}

footer p {
    font-size: 13px;
    font-weight: 600;
    color: #1b4f72; /* Azul marino explícito */
}

/* ==========================================================================
   DISEÑO RESPONSIVO (MÓVILES - ORDEN ESTRICTO)
   ========================================================================== */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 15px;
    }

    /* Orden 1: Barra de navegación y medidor de progreso */
    .sidebar-left {
        order: 1;
    }

    /* Orden 2: Descripción de la práctica (Central) */
    .content-center {
        order: 2;
        padding: 20px;
    }

    /* Orden 3: Panel de notas y comentarios */
    .sidebar-right {
        order: 3;
        min-height: 350px;
    }
    
    #student-notes {
        min-height: 150px;
    }
}