/* Frontend Styles - Based on your original code */
.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.parent {
    text-align: center;
    position: relative;
}

.parent::after {
    content: none!important;
}

.parent::before {
    content: none!important;
}

.parent::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: #007cba;
    top: 100%;
    left: 0;
    transform: translateY(10px);
}

.children {
    display: flex;
    flex-wrap: nowrap; 
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
    position: relative;
    align-items: center; 
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    max-width: 150px;
    position: relative;
    min-height: 120px; 
    justify-content: center; 
}

.node img {
    width: 50px;
    height: 50px;
    object-fit: cover; 
    border-radius: 10px; 
}

.node span {
    margin-top: 5px;
    font-size: 12px;
    text-align: center;
    line-height: 1;
    word-wrap: break-word;
    color: #007cba;
    font-weight: 600;
}

.node .line {
    width: 1px;
    height: 20px;
    background: #007cba;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.children {
    position: relative;
}

.children::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #007cba;
    z-index: -1;
}

.node::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 1px;
    height: 20px;
    background: #007cba;
    transform: translateX(-50%);
}
    
.node::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 1px;
    height: 20px;
    background: #007cba;
    transform: translateX(-50%);
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1000;
    width: 300px;
    border-radius: 8px;
}

.popup img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
}

.popup-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.popup button {
    padding: 5px 10px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    background: #007cba;
    color: white;
    transition: background 0.3s ease;
}

.popup button:hover {
    background: #005a87;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.popup-people {
    margin-top: 10px;
}

.popup-people div {
    color: #062648;
    display: flex;
    align-items: left!important;
    row-gap: 1px;
    column-gap: 10px;
    margin-bottom: 15px;
}

.popup-people img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.popup-people div div {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.popup-people div div strong {
    font-size: 14px;
}

#popup-people > div > div > strong {
    line-height: 1!important;
    margin-bottom: 10px!important;
}

#popup-people > div > div > span {
    margin-top: -10px!important;
    line-height: 1!important;
}

#popup-title {
    margin-top: 2px!important;
    margin-bottom: 30px!important;
    color: #062648!important;
    font-weight: 700 !important;
}

.parent .node::before {
    content: none;
}

.parent .node::after {
    margin-top: 120px;
    margin-left: 1px;
}

.line {
    width: 1px;
    height: 20px;
    background: #007cba;
    margin: 10px 0;
}

/* Media query para móviles */
@media (max-width: 768px) {
    .children {
        flex-wrap: wrap; 
        justify-content: space-evenly; 
    }

    .node {
        max-width: 120px;
        flex: 1 1 30%; 
    }

    .node img {
        width: 50px; 
        height: 50px;
    }
    
    .popup {
        width: 90%;
        max-width: 300px;
    }
}

@media (max-width: 1300px) {
    .children {
        flex-wrap: wrap;
        justify-content: space-evenly; 
    }

    .node {
        max-width: 120px;
        flex: 1 1 30%; 
    }

    .node img {
        width: 50px; 
        height: 50px;
    }
}