html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
font,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

#TreeWrapper {
    /* colors */
    --root-node: #fff;
    --root-node-bg: #11afc7;
    --root-listItem: #ffffff;
    --child-node: #000;
    --child-node-bg: #80decd;
    --link-bg: #ffa500;
    --link-anchor: #000;
    --link-anchor-bg: #33c6ac;
    --link-anchor-bg-hover: #279682;
    --root-link-anchor: #000;
    --root-link-anchor-bg: #0e92a6;
    --root-link-anchor-bg-hover: #0b707f;
    /* border and box-shadow */
    --shadow: 0 0 5px -1px #000;
}


/* All the margin and padding have to be "0", refer App.css file */
*::before,
*::after {
    margin: 0;
    padding: 0;
}

.tree {
    display: flex;
    justify-content: center;
    /*background-color: #f0fffc;*/
    min-height: 100vh;
}

    .tree ul {
        list-style: none;
        position: relative;
    }

        .tree ul::before {
            content: "";
            width: 1em;
            position: absolute;
            top: 0;
            bottom: 50%;
            left: -1em;
            border-bottom: 1px solid var(--link-bg);
        }

    .tree li {
        position: relative;
        display: flex;
        align-items: center;
    }

        .tree li::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            border-left: 1px solid var(--link-bg);
        }

        .tree li:first-child::before {
            top: 50%;
        }

        .tree li:last-child::before {
            bottom: 50%;
        }

        .tree li:only-child::before {
            display: none;
        }

        .tree li div {
            margin: 0.5em 0 0.5rem 1rem;
            padding: 0;
            /* min-width: 70px;
            min-height: 30px; */
            border-radius: 5px;
            transition: all 100ms ease-in-out;
        }

            .tree li div span {
                color: var(--child-node) !important;
                background-color: var(--child-node-bg);
                min-height: 4rem;
                min-width: 5rem;
                font-weight: 500;
                border-radius: 5px;
                display: flex;
                justify-content: center;
                align-items: center;
                padding: 0.5rem;
                flex-flow: column nowrap;
            }

                .tree li div span:hover .action_btn_par {
                    display: flex;
                }

                .tree li div span .action_btn_par {
                    width: 100%;
                    margin: 0 auto;
                    display: flex;
                    flex-direction: row;
                    flex-wrap: nowrap;
                    justify-content: center;
                    align-items: center;
                    gap: 0.5rem;
                    padding: 0 !important;
                    display: none;
                }

                    .tree li div span .action_btn_par .action_btn {
                        color: var(--link-anchor);
                        background-color: var(--link-anchor-bg);
                        padding: 0 0.25rem;
                        border-radius: 3px;
                        cursor: pointer;
                        transition: all 0.1s ease-in-out;
                        animation: actionBtnTransition 0.25s ease-in-out forwards;
                    }

                        .tree li div span .action_btn_par .action_btn:hover {
                            background-color: var(--link-anchor-bg-hover);
                        }

            .tree li div::before {
                content: "";
                width: 1em;
                border-bottom: 1px solid var(--link-bg);
                position: absolute;
                top: 0;
                bottom: 50%;
                left: 0;
            }

    @keyframes actionBtnTransition {
        0%{
            opacity: 0;
        }
        100%{
            opacity: 1;
        }
    }   

    /* Root item start */
    .tree ul.root::before {
        display: none;
    }

    .tree ul.root:first-child > li::before {
        display: none;
    }

    .tree > ul.root > li > div::before {
        display: none;
    }

    .tree ul.root {
        width: 98%;
        overflow: hidden;
    }

        .tree ul.root > li {
            background-color: var(--root-listItem);
            padding: 1rem 0;
            margin: 0.5rem 0;
            border-radius: 0.25rem;
            overflow-x: scroll;
        }

    .tree > ul.root > li > div > span {
        color: var(--root-node) !important;
        background-color: var(--root-node-bg) !important;
        font-weight: 600;
        font-size: 1.15rem;
        color: #e8e7e7;
        min-width: 6rem;
        min-height: 5rem;
    }

        .tree > ul.root > li > div > span > div::before{
            border-bottom: 1px solid transparent;
        }

        .tree > ul.root > li > div > span .action_btn_par .action_btn {
            color: var(--root-link-anchor);
            background-color: var(--root-link-anchor-bg) !important;
        }

            .tree > ul.root > li > div > span .action_btn_par .action_btn:hover {
                background-color: var(--root-link-anchor-bg-hover) !important;
            }
        
        /* Root item End */
        /* Scrollbar styles ⬇*/
        /* Scrollbar styles for chrome and safari browser ⬇*/
        .tree ul.root > li::-webkit-scrollbar {
            border-radius: 1rem;
            background-color: #fff;
            margin-inline: 1rem;
            margin-block: 5rem;
            height: 0.5rem;
            cursor: pointer;
        }

        .tree ul.root > li::-webkit-scrollbar:hover {
            background-color: #f0f0f0;
        }

    .tree ul.root > li::-webkit-scrollbar-thumb {
        background-color: #fff;
        border-radius: 0.5rem;
    }

    .tree ul.root > li:hover::-webkit-scrollbar-thumb {
        background-color: #a7a7a7;
        cursor: pointer;
    }

    .tree ul.root > li::-webkit-scrollbar-thumb:hover {
        height: 2rem;
        background-color: rgb(117, 117, 117);
    }

    /* Scrollbar styles for chrome and safari browser ⬆*/

    /* Scrollbar styles for Firefox browser ⬇*/
    .tree ul.root > li {
        scrollbar-color: #fff #fff;
        scrollbar-width: none;
    }

        .tree ul.root > li:hover {
            scrollbar-color: #a7a7a7 #fff;
            scrollbar-width: thin;
        }


    /* Connecting line styles Start */
    .tree li div span:hover {
        box-shadow: var(--shadow);
    }

    .tree li div:hover ~ div li div::before {
        border-bottom: 2px solid black;
    }

    .tree li div:hover ~ div ul::before {
        border-bottom: 2px solid black;
    }

    .tree li div:hover ~ div li::before {
        border-left: 2px solid black;
    }
/* Connecting line styles End */
