/* estructura_funcional_style.css */

.estructura-funcional { padding: 40px 0; }

.section-grafico h1 {
    color: var(--color-primary);
    font-weight: bold;
    margin-bottom: 40px;
}

.container-mapa {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.organigrama {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 600px;
}

.nivel {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

/* Override de Bootstrap Cards para el organigrama */
.organigrama .card {
    background-color: var(--color-primary) !important;
    color: white !important;
    padding: 10px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    width: 200px;
    max-width: 100%;
    position: relative;
    z-index: 2;
    border: none;
}

/* LÍNEAS CONECTORAS */
.linea {
    width: 2px;
    background-color: var(--color-primary);
    position: absolute;
    top: 0;
    height: calc(70%);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.nivel:nth-child(3) + .linea { display: none; }
.nivel-4 + .linea { display: none; }

.nivel:first-child::after, .nivel:nth-child(3)::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--color-primary);
    top: 100%;
    height: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.linea-horizontal, .linea-horizontal-larga {
    height: 2px;
    background-color: var(--color-primary);
    position: relative;
    z-index: 1;
}
.linea-horizontal { width: 250px; }
.linea-horizontal-larga { width: 150px; }

/* Auxiliar Contable */
.nivel-5 { display: flex; justify-content: flex-start; width: 100%; padding-left: 14%; position: relative; }
.nivel-4 { position: relative; }

.nivel-4::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--color-primary);
    top: 50%;
    bottom: -20px;
    left: calc(14% + 100px);
    z-index: 1;
}

.nivel-4::before {
    content: '';
    position: absolute;
    height: 2px;
    background-color: var(--color-primary);
    width: calc(36% - 100px);
    top: 50%;
    left: calc(14% + 100px);
    z-index: 1;
}

/* Info Extra */
.contenido-extra {
    margin-top: 50px;
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    background-color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.contenido-extra h2 {
    color: var(--color-primary);
    font-weight: bold;
    font-size: 1.8rem;
    margin-bottom: 20px;
    position: relative;
    text-align: center;
}
.contenido-extra h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 15px auto 0;
}

.contenido-extra h3 { color: var(--color-primary); font-size: 1.5rem; margin: 30px 0 15px; }
.contenido-extra p { color: var(--text-muted); margin-bottom: 15px; }

.organ-description {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    background-color: var(--bg-light);
    border-radius: 10px;
    padding: 25px;
    border-left: 5px solid var(--color-primary);
    transition: all 0.3s ease;
}
.organ-description:hover { box-shadow: var(--shadow-sm); transform: translateY(-3px); }

.icon-container {
    flex: 0 0 70px;
    height: 70px;
    width: 70px;
    background-color: var(--bg-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-primary);
    margin-right: 25px;
}

.organ-description .content { flex: 1; }

@media (max-width: 768px) {
    .container-mapa { padding: 15px; }
    .card { width: 180px; font-size: 14px; }
    .linea-horizontal, .linea-horizontal-larga { width: 120px; }
    .nivel-5 { padding-left: 10%; }
    .nivel-4::after { left: calc(10% + 90px); }
    .organ-description { flex-direction: column; text-align: center; }
    .icon-container { margin-right: 0; margin-bottom: 15px; }
}