body {
    font-family: Arial, sans-serif;
}

.tree ul {
    padding-top: 20px;
    position: relative;
    transition: all 0.5s;
    display: flex;
    justify-content: unset;
}

.tree li {
    list-style-type: none;
    text-align: center;
    position: relative;
    padding: 1em 0 0 0;
    transition: all 0.5s;
}

.tree li::before, .tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid #ccc;
    width: 50%;
    height: 20px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid #ccc;
}

.tree li:only-child::after, .tree li:only-child::before {
    display: none;
}

.tree li:only-child {
    padding-top: 0;
}

.tree li:first-child::before, .tree li:last-child::after {
    border: 0 none;
}

.tree li:last-child::before {
    border-right: 2px solid #ccc;
    border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
    border-radius: 5px 0 0 0;
}

.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid #ccc;
    width: 0;
    height: 20px;
}

.tree li a {
    border: 2px solid #ccc;
    padding: 0.5em 0.75em;
    margin: 5px 5px 0 0;
    text-decoration: none;
    color: #666;
    background-color: #fff;
    display: inline-block;
    border-radius: 5px;
    transition: all 0.5s;
}

.parents-container {
    border: 2px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    display: flex;
    justify-content: space-around;
    margin:0px 20px 0px 20px;
}

.tree li a:hover, .tree li a:hover+ul li a {
    background: #e9453f;
    color: #fff;
    border: 2px solid #e9453f;
}

.tree .parents-container:hover, .tree .parents-container:hover+ul li a {
    background: #e9453f;
    color: #fff;
    border: 2px solid #e9453f;
}

.tree li a:hover+ul li::after, .tree li a:hover+ul li::before, .tree li a:hover+ul::before, .tree li a:hover+ul ul::before {
    border-color: #e9453f;
}
.tree .parents-container:hover+ul li::after, .tree .parents-container:hover+ul li::before, .tree .parents-container:hover+ul::before, .tree .parents-container:hover+ul ul::before {
    border-color: #e9453f;
}


#info-box {
    position: fixed;
    top: 10px;
    left: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ccc;
    display: none;
    max-height: 90vh; /* Limitar la altura máxima */
    overflow-y: auto; /* Hacer el contenido desplazable */
    width: 300px; /* Ajusta el ancho según tus necesidades */
}

#info-box .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e9453f;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    text-align: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 25px;
    z-index: 1001;
}

.info-content {
    display: flex;
    flex-direction: column;
}

.info-content img {
    max-width: 500px;
    margin: 5px 0;
    cursor: pointer;
}

.small-img {
    max-width: 80px;
    border-radius: 50%;
    margin-bottom: 5px;
}

.image-item {
    max-width: 300px;
    margin-bottom: 10px;
}

.image-item img {
    max-width: 300px;
    display: block;
}

.image-item p {
    margin: 5px 0 0 0;
    font-size: 0.9em;
}

/* Media query para dispositivos móviles */
@media (max-width: 800px) {
    #info-box {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 20px;
    }

    #info-box .close-btn {
        top: 15px;
        right: 80px;
        width: 30px;
        height: 30px;
        font-size: 20px;
        line-height: 30px;
        
    }

    .image-item  img {
        max-width: 100%;
    }

    .image-item {
        max-width: 100%;
        padding-right:30px;
        padding-bottom:100px;
    }
    .tree ul {
        justify-content: unset;
    }
    .small-img{
        max-width: 120px;
    }
    .name{
        font-size: 1.2em;
    }
}


.target{
    border:4px solid #e9453f;
}