/* ========================================================
=== Reset General ===
======================================================== */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #f4f4f4;
    color: #2C3E50;
}

/* Inputs generales */
input[type="text"], input[type="file"] {
    width: 80%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
    background-color: #fff;
    box-sizing: border-box;
}

/* ========================================================
=== Encabezado (Header y Perfil) ===
======================================================== */
header {
    background-color: #1ABC9C;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
}

.perfil {
    position: relative;
    display: inline-block;
}

.perfil-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1em;
}

.perfil-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    color: #2C3E50;
    min-width: 180px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
    z-index: 1;
}

.perfil-menu a {
    display: block;
    padding: 12px;
    text-decoration: none;
    color: #2C3E50;
}

.perfil-menu a:hover {
    background-color: #f1f1f1;
}

/* ========================================================
=== Contenedor Principal ===
======================================================== */
main {
    padding: 10px;
    text-align: left;
}

.container {
    display: flex;
    flex-direction: row;
    min-height: 80vh;
}

.left, .right {
    flex: 1;
    padding: 10px;
}

.left {
    background: linear-gradient(to bottom right, #ECF0F1, #ffffff);
}

.right {
    background-color: #ffffff;
    border-left: 2px solid #ddd;
}

.right h3 {
    margin-bottom: 20px;
    color: #16A085;
}

/* ========================================================
=== Sección de Bienvenida ===
======================================================== */
.bienvenida {
    background-color: #ECF0F1;
    padding: 30px;
    margin: auto;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.bienvenida h2 {
    color: #3498DB;
}

.bienvenida p {
    font-size: 1.1em;
    margin-top: 10px;
}

/* ========================================================
=== Botones y Formularios ===
======================================================== */
.form-group {
    margin-bottom: 15px;
}

button[type="submit"],
button[type="button"] {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
}

button[type="submit"] {
    background-color: #1ABC9C;
    color: white;
}

button[type="submit"]:hover {
    background-color: #16A085;
}

button[type="button"] {
    background-color: #cccccc;
    color: #333;
}

button[type="button"]:hover {
    background-color: #999999;
}

label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #2C3E50;
}

/* ========================================================
=== Alertas y Mensajes ===
======================================================== */
.alert-danger {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

.alert-warning {
    background-color: #fcf8e3;
    color: #8a6d3b;
    border: 1px solid #faebcc;
}

.alert-info {
    background-color: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}

.alert-success {
    background-color: #28a745;
    border: 1px solid #1e7e34;
}

/* Animación popup de alert-success */
.alert.alert-success {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 15px 25px;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    animation: fadeInOut 4s ease-in-out forwards;
    min-width: 280px;
    max-width: 400px;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10%, 90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); pointer-events: none; }
}

/* ========================================================
=== Tablas y Layouts ===
======================================================== */
table {
    width: 95%;
    margin: 0 auto;
    border-collapse: collapse;
}

table tr {
    display: flex;
}

table td {
    flex: 1 1 calc(33.33% - 10px);
    box-sizing: border-box;
}

table td:first-child {
    flex: 0 0 10%;
}

table.class_nivel_1 {
    border-top: 1px solid black;
    border-right: 1px solid black;
}

table tr:nth-child(2) {
    flex: 0 0 100%;
}

table tr:nth-child(2) td.tdnormalSegundafilaSegundacolumna {
    width: 100%;
    display: block;
    padding-left: 30px;
}

.tdnormalSegundafilaSegundacolumna p {
    display: list-item;
    list-style-type: disc;
    margin-left: 20px;
}

/* ========================================================
=== Layout flexible (Flexbox) ===
======================================================== */
.table {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.row {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.rowlista {
    width: 100%;
    display: block;
}

.column {
    flex: 1;
    padding: 5px 10px;
}

.cell, .cellNive1Numero {
    padding: 1px 7px;
    background-color: rgb(200, 227, 238);
    font-weight: bold;
    font-size: 90%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    color: rgb(80,80,80);
}

.cellseparado {
    padding: 10px;
    background-color: rgb(200, 227, 238);
    font-weight: bold;
    font-size: 90%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    color: rgb(80,80,80);
    border-left: 5px solid;
    border-left-style: double;
    border-left-color: rgb(202, 161, 161);
}

.cellseparacionlinea {
    padding: 10px;
    height: 40px;
    background-color: rgb(200, 227, 238);
    box-sizing: border-box;
    width: 100%;
}

.cellseparacionfila {
    padding: 10px;
    height: 10px;
    width: 100%;
}

.cell {
    flex: 1;
    width: 100%;
}

.celllista{
    padding: 1px 7px;
    background-color: rgb(200, 227, 238);
    text-align: left;
    font-weight: bold;
    color: rgb(80, 80, 80);
    font-size: 90%;
    box-sizing: border-box;
    align-items: center; /* Centra verticalmente el contenido */
}

.celllista p {
    display: list-item;
    list-style-type: disc;
    margin-left: 75px;
}

.hrdegradado {
    background: linear-gradient(to right, #c8e3ee, #ffffff, #c8e3ee);
    height: 3px;
    border: none;
}

/* ========================================================
=== Imágenes ===
======================================================== */
.imagenNivel1 {
    padding: 5px 5px 5px 5px;
    max-width: 110px;
    max-height: 80px;
    min-height: 65px;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
}

.imagenNivel4 {
    padding: 5px 5px 5px 5px;
    max-width: 300px;
    max-height: 400px;
    min-height: 65px;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
}

/* ========================================================
   === Popups y Definiciones ===
======================================================== */
.popup-definicion {
    display: none;
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 25px;
    border: 2px solid #3498db;
    border-radius: 10px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 600px;
}

.popup-contenido {
    max-height: 400px;
    overflow-y: auto;
}

.popup-cerrar {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 20px;
    color: #aaa;
}

/* ========================================================
=== Toogle de Secciones ===
======================================================== */
.nivel_1, .nivel_2, .nivel_3, .nivel_4, .nivel_5 {
    display: none;
}

.toggle-trigger {
    cursor: pointer;
}

/* ========================================================
=== Footer ===
======================================================== */
footer {
    background-color: #2D2D2D;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
}
