/* ========================= */
/* BASE */
/* ========================= */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 20px;
    background-color: #f9f9f9;
    color: #333;
    text-align: justify;
}

p, ol, ul {
    margin: 20px 33px;
}

/* ========================= */
/* ENLACES GENERALES */
/* ========================= */

/* Enlace normal (azul) */
a:link {
    color: #d00000;
    text-decoration: none;
}

/* Enlace visitado (un tono más apagado o morado suave) */
a:visited {
    color: #5630ee;
}

/* Al pasar el ratón */
a:hover {
    text-decoration: underline;
}




/* ========================= */
/* HEADINGS */
/* ========================= */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 10px;
    line-height: 1.25;
    margin: 20px 33px;
}

/* Jerarquía */
h1 {
    font-size: 32px;
    border-bottom: 3px solid #d00000;   /* coherente con menú */
    padding-bottom: 6px;
}

h2 {
    font-size: 26px;
    border-bottom: 2px solid #e2e8f0;   /* más sutil */
    padding-bottom: 4px;
}

h3 {
    font-size: 21px;
    color: #d00000;                     /* acento visual */
}

h4 {
    font-size: 18px; text-align: center;
}

h5 {
    font-size: 16px;
    font-weight: 500;
}

h6 {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

/* Espaciado coherente con párrafos */
h1 + p,
h2 + p,
h3 + p,
h4 + p {
    margin-top: 10px;
}

/* Opcional: mejor legibilidad en bloques largos */
h2, h3 {
    margin-top: 30px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* <-- sombra */
}

/* ========================= */
/* CONTROLES */
/* ========================= */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    background: #f1f5f9;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
}

.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    flex-grow: 1;
    margin-right: 20px;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
}

/* ========================= */
/* TABLAS PRINCIPALES */
/* ========================= */
table {
    width: 95%;
    border-collapse: collapse;
    font-size: 16px;
    table-layout: fixed;
    font-family: 'Segoe UI', Arial, sans-serif;
}

th, td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
    vertical-align: middle;
    /* Corrección para que el texto no se corte y baje de línea */
    white-space: normal; 
    word-break: break-word; 
}

th {
    background-color: #2c3e50;  /* unificado */
    color: white;
    position: sticky;
    top: 0;
    font-weight: bold;
}

tr:hover td {
    filter: brightness(0.95);
}

/* ========================= */
/* TABLAS ALTERNATIVAS (.table2) */
/* ========================= */
.table2 {
    font-family: 'Segoe UI', Arial, sans-serif;
    width: 95%;
    border-collapse: collapse;
    font-size: 16px;
    table-layout: fixed;
}

.table2 th, .table2 td {
    text-align: left; /* Sobrescribe el centrado solo para esta tabla */
}

.table2 th {
    background-color: #d91d1d; /* Cabecera roja */
}

/* Elementos internos de las tablas */
.color-box {
    display: inline-block;
    width: 0.25cm;
    height: 0.25cm;
    margin-right: 4px;
    border: 1px solid #333;
    vertical-align: middle;
}

.segment-text {
    margin-right: 15px;
    vertical-align: middle;
}

/* ========================= */
/* BOTONES */
/* ========================= */
.btn {
    cursor: pointer;
    padding: 10px 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
}

.btn:hover {
    background: #2980b9;
}

/* ========================= */
/* DETALLE */
/* ========================= */
#detail-view { display: none; }

.field-row {
    display: flex;
    border-bottom: 1px solid #eee;
    padding: 10px 5px;
}

.field-name {
    font-weight: bold;
    width: 40%;
}

.field-value {
    width: 60%;
    word-break: break-all;
}

/* ========================= */
/* VISOR */
/* ========================= */
#mol-viewer-container {
    max-width: 800px;
    height: 400px;
    margin: 0 auto 30px;
    border: 2px solid #3498db;
    border-radius: 8px;
}

/* ========================= */
/* MENÚ */
/* ========================= */
.menu-wrapper {
    width: 95%;
    margin: 0 auto;
}

.menu {
    background-color: #D83336;
    display: flex;
    justify-content: left;
    gap: 35px;
    padding: 12px 20px;
    border-radius: 12px;
}

.menu a {
    font-family: Arial, sans-serif;
    font-size: 21px;
    color: white;
    text-decoration: underline;
    text-decoration-color: #D83336;
    text-underline-offset: 6px;
}


.menu a:hover {
    text-decoration-color: white;
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */
.menu-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }

    .menu {
        display: none;
        flex-direction: column;
        gap: 15px;
    }

    .menu.active {
        display: flex;
    }
}

/* ========================= */
/* CODE python */
/* ========================= */
/* Estilos adicionales para la caja del código (Ajustados a tema claro) */
.code-container { margin-left: 30px; margin-right: 30px; margin-top: 30px; margin-bottom: 30px; border-radius: 8px; overflow: hidden; border: 1px solid #ddd; font-size: 16px; box-shadow: 0 2px 4px rgba(0,0,0,0.05);}

.code-header { background-color: #0070C0; color: #ffffff; padding: 10px 15px; font-weight: bold; font-size: 16px; border-bottom: 1px solid #ddd; font-family: 'Segoe UI', Arial, sans-serif;}

pre[class*="language-"] { margin: 0 !important; border-radius: 0 0 8px 8px !important; background-color: #fcfcfc !important; font-size: 14px; line-height: 1.5;}

.charts-container { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.chart-box { background-color: white; padding: 15px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); width: 48%; }

/* ========================= */
/* TABLA download */
/* ========================= */

    .tabla-download{
        width:100%;
        display:flex;
        justify-content:center;
    }

    table.tabla-central{
        width:80%;
        margin:auto;
        border-collapse:collapse;
    }

    table.tabla-central td{
        border:1px solid #dc3636;

        /* importante */
        text-align:center;
        vertical-align:middle;

        padding:10px;
    }

    /* La imagen define automáticamente la altura */
    table.tabla-central img{
        display:block;
        margin:auto;
        max-width:100%;
        height:auto;
    }

    /* contenedor interno para centrar verticalmente */
    .contenido-celda{
        display:flex;
        flex-direction:column;
        justify-content:center;
        align-items:center;
        gap:10px;
    }

    .contenido-celda{
        display:flex;
        flex-direction:column;
        justify-content:center;
        align-items:center;
        gap:10px;
    }

    /* imágenes en horizontal */
    .grupo-imagenes{
        display:flex;
        flex-direction:row;
        justify-content:center;
        align-items:center;
        gap:8px;
    }

    .grupo-imagenes img{
        width:30px;
    }

.dragon-ima {
    float: right;
    max-width: 550px;
    width: 100%;
    height: auto;
    margin-left: 30px;
    margin-bottom: 3px;
}

@media (max-width: 768px) {
    .dragon-ima {
        float: none;
        display: block;
        margin: 0 auto 20px;
    }
}


.servatrix-ima {
    float: right;
    max-width: 350px;
    width: 100%;
    height: auto;
    margin-left: 30px;
    margin-bottom: 3px;
}

@media (max-width: 768px) {
    .servatrix-ima {
        float: none;
        display: block;
        margin: 0 auto 20px;
    }
}