
/* TREE COMPONENT */
.tree-component{
    width: 100%;
    height: 100%;
    overflow: auto;
    scroll-behavior: smooth;
    position: relative;
}

.tree-component .scroll-indicator{
    position: absolute;
    top: 0;
    right: 0;
    height: 30px;
    width: 30px;
    border: 2px solid grey;
    background: white;
    border-radius: 4px;
}

.tree-component .tree-branch .branch-main-item{
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #e0f0ff;
    border-radius: 4px;
    margin-bottom: 5px;
    padding: 2px 5px;
    transition: all 0.25s ease;
    cursor: pointer;
    overflow: hidden;
}
.tree-component .tree-branch .branch-main-item::before{
    width: 6px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    content: '';
}

.tree-component .tree-branch .branch-main-item:hover{
    background-color: #c8e3ff;
}

.tree-component .tree-branch .branch-main-item .icon{
    width: 14px;
    height: 14px;
}

.tree-component .tree-branch .branch-main-item .text{
    flex: 1;
    /* On met des '...' pour éviter d'avoir des retours à la ligne si le texte est trop long */
    /* white-space: nowrap; */
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10pt;
}

.tree-component .tree-branch .branch-main-item .text .complementary-text{
    margin-left: 10px;
    font-style: italic;
}

.tree-component .tree-branch .branch-main-item:has(+.branch-content>.tree-branch){
    /* Pour que le contenu de la branche ne morde pas sous l'icon de dropdown */
    padding-right: 22px;
}

.tree-component .tree-branch .branch-main-item:has(+.branch-content>.tree-branch)::after{
    content: " ";
    position: absolute;
    right: 8px;
    height: 14px;
    width: 14px;
    top: calc(50% - 7px);
    /* background-color: red; */
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTI0IDI0SDBWMGgyNHYyNHoiIGZpbGw9Im5vbmUiIG9wYWNpdHk9Ii44NyIvPjxwYXRoIGQ9Ik03LjM4IDIxLjAxYy40OS40OSAxLjI4LjQ5IDEuNzcgMGw4LjMxLTguMzFjLjM5LS4zOS4zOS0xLjAyIDAtMS40MUw5LjE1IDIuOThjLS40OS0uNDktMS4yOC0uNDktMS43NyAwcy0uNDkgMS4yOCAwIDEuNzdMMTQuNjIgMTJsLTcuMjUgNy4yNWMtLjQ4LjQ4LS40OCAxLjI4LjAxIDEuNzZ6Ii8+PC9zdmc+);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: ease 0.2s all
}


.tree-component .tree-branch:not(.open)>.branch-main-item + :is(.branch-content, .branch-content > .tree-branch){
    height: auto;
    font-size: 0;
    margin: 0;
    opacity: 0;
    padding: 0;
    /* fade out, then shrink */
    transition: opacity .25s,
                font-size .5s .25s,
                margin .5s .25s,
                padding .5s .25s;
}
.tree-component .tree-branch .branch-content{
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    
  /* -webkit-transition: max-height 1s; 
  -moz-transition: max-height 1s; 
  -ms-transition: max-height 1s; 
  -o-transition: max-height 1s; 
  transition: max-height 1s;   */
  transition: font-size .25s,
                margin .25s,
                padding .25s,
                opacity .5s .25s;
}

.tree-component .tree-branch.open>.branch-main-item::after{
    transform: rotate(90deg);
}

.tree-component .tree-branch.open>.branch-main-item + .branch-content{
    max-height: 100%;
    transition: max-height 0.3s ease-in;
    
  -webkit-transition: max-height 1s; 
  -moz-transition: max-height 1s; 
  -ms-transition: max-height 1s; 
  -o-transition: max-height 1s; 
  transition: max-height 1s;  
}


.tree-component .tree-branch .branch-content{
    padding-inline-start: 10px;
    padding-inline-end: 5px;
}




/* ----- CAS PARTICULIERS ----- */

/* Réprésentations (CD74) */
/* class CSS : 'representations-liste-organismes' */

.representations-liste-organismes .tree-component{
    padding-inline: 10px;
    width: calc(100% - 20px);
}

.representations-liste-organismes .tree-component .tree-branch .branch-main-item{
    min-height: 24px;
    height: auto;
    background-color: #e9e9e9;
}

.representations-liste-organismes .tree-component .tree-branch .branch-main-item:hover{
    background-color: #d9d9d9;
}

.representations-liste-organismes .tree-component .tree-branch .branch-main-item.selected{
    background-color: #bbd0ff;
}

.representations-liste-organismes .tree-component .tree-branch .branch-main-item.highlight{
    font-weight: bold;
}

.representations-liste-organismes .tree-component .tree-branch .branch-main-item:not(.highlight){
    min-height: 20px
}