

/* CONFIG  GLOBAL --- */
:root {
    --primary-cyan: #00e5ff;
    --dark-cyan: #00b8d4;
    --bg-color: #f4f7f6;
    --text-color: #2c3e50;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    color: var(--text-color);
}

/*                              ENCABEZADO                        */

header {
    position: relative;
    width: 100%;
    height: 180px; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; 
    background-color: #00e5ff; 
    margin-bottom: 30px;
}

#videoFondo {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0; /* Al fondo */
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Oscurece levemente el video para leer el título */
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2; 
    display: flex;
    align-items: center;
    gap: 25px;
    color: white;
}

.logo-uni {
    width: 80px;
    height: auto;
}
/*                                CONTENEDORES Y TARJETAS                 */
.container {
    max-width: 2100px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.info-card {
    border-left: 5px solid #2ecc71;
    background-color: #f0fff4;
}

/* --- PANEL DE CONTROLES (GRID) --- */
.controles-principales {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.select-group, .input-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

label {
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
}

input, select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

/*                     BOTENES CIAN                     */
button {
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.btn-cyan {
    background-color: blue;
    color: white;
}

.btn-cyan-outline {
    background-color: white;
    color: var(--dark-cyan);
    border: 2px solid var(--primary-cyan);
}

.btn-primary {
    background-color: #ff0000;
    color: white;
    width: 100%;
    margin-top: 10px;
    font-size: 1rem;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    filter: brightness(1.05);
}

/*                          VISUALIZACIÓN                  */
.visualizacion-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
}

/* --- LADO IZQUIERDO: CÓDIGO --- */
.seccion-codigo {
    background-color: #ffffff;
}

.codigo-wrapper {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
}

pre {
    margin: 0;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

#codigoVisual span {
    display: block;
    padding: 0 5px;
    border-radius: 4px;
}

/* Clase que se activa con JS */
.linea-activa {
    background-color: #fff9c4;
    border-left: 4px solid #f1c40f;
    font-weight: bold;
}

.leyenda {
    margin-top: 15px;
    font-size: 0.8rem;
    display: flex;
    gap: 15px;
}

.dot { height: 10px; width: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.naranja { background-color: #e67e22; }
.rojo { background-color: #e74c3c; }

/*                         LADO DERECHO                       */
.bar-chart {
    /* Aumentamos el margen inferior para dar espacio a los números de los índices */
    margin-bottom: 50px; 
    position: relative;
    height: 300px; /* O la altura que prefieras */
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    border-bottom: 2px solid #ddd;
}

.barra {
    width: 35px;
    background: linear-gradient(to top, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    border-radius: 6px 6px 0 0;
    transition: all 0.4s ease; /* Para que el intercambio sea suave */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    font-size: 10px;
    font-weight: bold;
    padding-bottom: 5px;
}


/* Colores dinámicos del algoritmo */
.barra.comparando { background: #e67e22 !important; color: white; transform: scale(1.1); }
.barra.intercambiando { background: #e74c3c !important; color: white; }

/* --- TABLA --- */
.tabla-wrapper {
    max-height: 200px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    background-color: #f8f9fa;
    padding: 10px;
    border-bottom: 2px solid var(--primary-cyan);
}

td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    text-align: center;
}