/* CABECERA INSTITUCIONAL PORTAL */
.header-portal {
    background-color: #9f2340;
    color: #ffffff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Plus Jakarta Sans', sans-serif;
    z-index: 100;
    position: relative;
}

.header-izquierda {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-volver:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateX(-2px);
}

.icono-volver {
    width: 14px;
    height: 14px;
}

.header-divisor {
    width: 1px;
    height: 28px;
    background-color: rgba(255, 255, 255, 0.2);
}

.header-titulo-area {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-titulo {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.header-subtitulo {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 500;
}

.header-derecha {
    display: flex;
    align-items: center;
}

.badge-autor {
    background-color: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* DISEÑO GENERAL DEL SIMULADOR */
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #0f172a;
    color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contenedor-principal {
    display: flex;
    height: calc(100vh - 70px);
    width: 100%;
    box-sizing: border-box;
}

/* COLUMNA IZQUIERDA: TERMINAL DE COMANDOS ESTRICTA (EXCEPTUADA DE REDISEÑO) */
.columna-terminal {
    width: 45%;
    background-color: #000000; /* Negro absoluto */
    border-right: 2px solid #1e293b;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-header {
    font-size: 12px;
    color: #888888;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-cuerpo {
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-cuerpo p {
    margin: 4px 0;
    white-space: pre-wrap;
}

/* EL TRUCO DE LA SIMULACIÓN: Input invisible que parece texto de consola */
.linea-comando {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.linea-comando input {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-family: 'Courier New', monospace !important;
    font-size: 14px !important;
    flex-grow: 1;
    outline: none !important;
    padding-left: 5px;
}

/* COLUMNA DERECHA: APARIENCIA IDE / EDITOR DE CÓDIGO (ESTILO PREMIUM ALINEADO) */
.columna-codigo {
    width: 55%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #0f172a; /* Slate 900 */
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.codigo-header {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* VENTANA DEL EDITOR main.c */
.ide-contenedor {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(159, 35, 64, 0.25);
    background-color: #0b0f19;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.ide-pestana {
    background-color: #111827;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(159, 35, 64, 0.2);
}

.archivo-activo {
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    position: relative;
}

.archivo-activo::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #9f2340;
    border-radius: 3px 3px 0 0;
}

.btn-ide {
    background: #9f2340;
    color: #ffffff;
    border: 1px solid #bc2d4e;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(159, 35, 64, 0.15);
}

.btn-ide:hover {
    background: #b22c4a;
    border-color: #cc3959;
    box-shadow: 0 4px 8px rgba(159, 35, 64, 0.25);
    transform: translateY(-1px);
}

.ide-cuerpo {
    display: flex;
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    background-color: #0b0f19;
}

.numeracion-lineas {
    color: #4b5563;
    text-align: right;
    padding-right: 15px;
    border-right: 1px solid #1f2937;
    user-select: none;
    font-size: 13px;
    line-height: 1.6;
    font-family: 'JetBrains Mono', monospace;
}

pre {
    margin: 0 0 0 15px;
    white-space: pre;
    flex-grow: 1;
    overflow-x: auto;
    overflow-y: hidden;
    align-self: flex-start;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e5e7eb;
}

/* RESALTADO DE SINTAXIS PROFESIONAL */
.c-comment {
    color: #6b7280;
    font-style: italic;
}

.c-keyword {
    color: #f472b6;
    font-weight: bold;
}

.c-type {
    color: #fde047;
}

.c-struct {
    color: #fb923c;
    font-weight: bold;
}

.c-function {
    color: #60a5fa;
}

.c-string {
    color: #4ade80;
}

.c-macro {
    color: #f87171;
    font-weight: bold;
}

/* INSPECTOR DE MEMORIA RAM EN TIEMPO REAL */
.memoria-contenedor {
    border: 1px solid rgba(159, 35, 64, 0.2);
    background-color: #111827;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.memoria-header {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    border-left: 3.5px solid #9f2340;
    padding-left: 10px;
}

.fila-nodos {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #0b0f19;
    padding: 12px;
    border-radius: 8px;
    min-height: 45px;
    border: 1px solid #1f2937;
}

.nodo {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.nodo:hover {
    transform: scale(1.04);
}

.nodo-lista {
    background-color: #fef08a; /* Amarillo pastel */
    color: #1c1917;
    border: 1px solid #eab308;
}

.nodo-cola {
    background-color: #bbf7d0; /* Verde pastel */
    color: #14532d;
    border: 1px solid #22c55e;
}

.flecha {
    color: #38bdf8; /* Azul cielo */
    font-weight: 800;
    font-size: 14px;
}

.reporte-archivo {
    color: #9ca3af;
    font-size: 13px;
}

.sub-seccion-memoria h5 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin: 15px 0 8px 0;
}

.btn-ide-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}