/* =====================================================
   TREE
===================================================== */

.tree-js {
    /*font-family: Arial, sans-serif;*/
    list-style: none !important;

    /*padding: 0 !important;*/
    margin: 0;

    flex: 1;
    min-width: 0;

    min-height: 100px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
}

.tree-js li {
    list-style: none !important;
    margin-left : 10px !important;
    padding: 0;
}

[dir=rtl] .tree-js li {
    list-style: none !important;
    margin-right: 10px !important;
    padding: 0;
}

.tree-js ul {
    list-style: none !important;

    padding-left: 18px;
    margin: 4px 0 0 0;

    display: none;
}

.tree-js ul li::before {
    content: none !important;
}

.tree-js .active {
    display: block;
}


/* =====================================================
   TREE NODE
===================================================== */

.tree-node {
    margin-bottom: 4px;
    position: relative;
}


/* =====================================================
   ALL
===================================================== */

.tree-all {
    margin-bottom: 7px;
}


/* All title */

.tree-all > .tree-group-title {
    display: inline-flex;
    align-items: center;

    min-height: 38px;

    padding: 0 12px;

    background: #fff;

    border: 1px solid #e1e5e9;
    border-radius: 6px;

    color: #333;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    user-select: none;

    transition: all 0.2s ease;
}

.tree-all > .tree-group-title:hover {
    background: #f5f8fb;
    border-color: #cfd8df;
}


/* =====================================================
   TRIANGLE
===================================================== */

.tree-toggle {
    cursor: pointer;
    user-select: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    margin-right: 2px;

    vertical-align: middle;
}

.tree-toggle::before {
    content: "▶";
    color: #777;
    display: inline-block;
    font-size: 9px;
    transition: transform 0.2s ease;
}

[dir=rtl] .tree-toggle::before {
    content: "◀";
}

.tree-toggle.open::before {
    transform: rotate(90deg);
}
[dir=rtl] .tree-toggle.open::before {
    transform: rotate(-90deg);
}

/* =====================================================
   GROUP
===================================================== */

.tree-group {
    margin-bottom: 3px;
}


/* Group title */

.tree-group > .tree-group-title {
    display: inline-flex;
    align-items: center;

    min-height: 34px;
    max-width: 100%;

    padding: 0 10px;

    border-radius: 5px;

    color: #333;
    font-size: 13px;
    font-weight: 500;

    cursor: pointer;
    user-select: none;

    transition: all 0.2s ease;

    /* Text wrap */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tree-group > .tree-group-title:hover {
    background: #f1f5f8;
    color: #0277bd;
}


/* =====================================================
   GROUP CHILDREN
===================================================== */

.tree-group > .tree-children {
    position: relative;

    margin-left: 10px;

    padding-left: 18px;
}



/* =====================================================
   UNIT
===================================================== */

.tree-leaf {
    position: relative;

    display: inline-flex;
    align-items: center;

    min-height: 30px;
    max-width: 100%;

    padding: 0 10px 0 8px;

    font-size: 12px;
    color: #555;

    border-radius: 5px;

    cursor: pointer;
    user-select: none;

    transition: all 0.2s ease;

    /* Text wrap */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Unit hover */

.tree-leaf:hover {
    background: #f1f5f8;
    color: #0277bd;
}


/* =====================================================
   SELECTED
===================================================== */


/* Selected All */

.tree-all.selected > .tree-group-title {
    background-color: #0277bd;
    border-color: #0277bd;

    color: #fff;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}


/* Selected Group */

.tree-group.selected > .tree-group-title {
    background-color: #eaf4fb;

    color: #0277bd;

    font-weight: 600;
}


/* Selected Unit */

.tree-unit.selected .tree-leaf {
    background-color: #eaf4fb;

    color: #0277bd;

    font-weight: 600;
}

/* =====================================================
   UNITS VIEW LAYOUT
===================================================== */

.units-view-layout {
    width: 100%;

    display: flex;
    align-items: flex-start;
}


/* =====================================================
   LEFT SIDE - FILTER + TREE
===================================================== */

.launch-groups-container {
    width: 25%;
    flex: 0 0 20%;

    margin-top: 25px;

    display: block;
}


/* =====================================================
   STATUS FILTER
===================================================== */

.unit-status-filter-wrapper {
    width: 100%;

    margin-bottom: 12px;
}

.unit-status-filter {
    width: 100%;

    min-height: 38px;

    padding: 8px 12px;

    border: 1px solid #ddd;
    border-radius: 6px;

    background: #fff;

    color: #333;

    font-size: 14px;

    cursor: pointer;

    box-sizing: border-box;

    outline: none;

    margin-bottom: 5px;
    transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease;
}

.unit-status-filter:hover {
    border-color: #c8cfd5;
}

.unit-status-filter:focus {
    border-color: #0277bd;

    box-shadow: 0 0 0 2px rgba(2, 119, 189, 0.08);
}


/* =====================================================
   TREE
===================================================== */

.launch-groups-container .tree-js {
    width: 100%;

    min-width: 0;
}


/* =====================================================
   RIGHT SIDE - UNIT CARDS
===================================================== */

.selected-unit-container {
    width: 100%;

    display: flex;
    flex-wrap: wrap;

    align-items: flex-start;
    justify-content: flex-start;
}

.full-unit-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;

    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}


.unit-status-filter:hover {
    border-color: #c8cfd5;
}

.unit-status-filter:focus {
    border-color: #0277bd;

    box-shadow: 0 0 0 2px rgba(2, 119, 189, 0.08);
}


/* =====================================================
   TREE WIDTH
===================================================== */

.launch-groups-container .tree-js {
    min-width: 0;
}


/* =====================================================
   SMOOTH TRANSITIONS
===================================================== */

.tree-group-title,
.tree-leaf {
    transition:
            background-color 0.2s ease,
            color 0.2s ease,
            border-color 0.2s ease;
}

.unit-status-filter-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* =====================================================
   RESPONSIVE
   DO NOT MODIFY DESKTOP VIEW
===================================================== */


/* =====================================================
   TABLET
   768px - 991px
===================================================== */

@media (min-width: 768px) and (max-width: 991px) {

    /* Main layout */
    .units-view-layout {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
    }

    /* Tree */
    .launch-groups-container {
        width: 30%;
        flex: 0 0 30%;
        min-width: 0;
        margin-top: 20px;
    }

    .launch-groups-container .tree-js {
        width: 100%;
        min-width: 0;
    }

    /* Cards */
    .selected-unit-container {
        width: 70%;
        flex: 0 0 70%;

        display: flex;
        flex-wrap: wrap;

        align-items: flex-start;
        justify-content: flex-start !important;

        min-width: 0;
    }

    .selected-unit-container .full-unit-card {
        width: 50% !important;
        max-width: 50% !important;
        min-width: 0 !important;

        box-sizing: border-box;
    }

    /* Filter */
    .unit-status-filter {
        width: 100%;
        max-width: 200px;
    }

    /* Tree text */
    .tree-group > .tree-group-title,
    .tree-leaf {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}


/* =====================================================
   MOBILE
   0px - 767px
===================================================== */

@media (max-width: 767px) {

    /* =================================================
       MAIN LAYOUT
    ================================================= */

    .units-view-layout {
        width: 100%;

        display: flex;
        flex-direction: column;

        align-items: stretch;

        gap: 15px;

        box-sizing: border-box;
    }


    /* =================================================
       TREE CONTAINER
    ================================================= */

    .launch-groups-container {
        width: 100%;
        flex: 0 0 100%;

        min-width: 0;

        margin-top: 10px;

        box-sizing: border-box;
    }

    .launch-groups-container .tree-js {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        box-sizing: border-box;
    }


    /* =================================================
       FILTER
    ================================================= */

    .unit-status-filter-wrapper {
        width: 100%;
        box-sizing: border-box;
    }

    .unit-status-filter {
        width: 100%;
        max-width: 100%;

        min-height: 38px;

        box-sizing: border-box;
    }


    /* =================================================
       ALL
    ================================================= */

    .tree-all {
        width: 100%;
        min-width: 0;
    }

    .tree-all > .tree-group-title {
        max-width: calc(100% - 28px);

        box-sizing: border-box;

        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;

        vertical-align: top;
    }


    /* =================================================
       GROUP
    ================================================= */

    .tree-group {
        width: 100%;
        min-width: 0;

        position: relative;
    }

    /*
     * IMPORTANT:
     * toggle and title are siblings in the HTML.
     * Keep them on the same line.
     */

    .tree-group > .tree-toggle {
        display: inline-flex;

        width: 22px;
        min-width: 22px;
        max-width: 22px;

        height: 22px;
        min-height: 22px;

        margin-right: 2px;

        vertical-align: top;

        flex-shrink: 0;
    }

    .tree-group > .tree-group-title {
        display: inline-flex;

        width: auto;
        max-width: calc(100% - 28px);

        min-width: 0;

        min-height: 34px;

        padding: 5px 8px;

        box-sizing: border-box;

        vertical-align: top;

        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }


    /* =================================================
       GROUP CHILDREN
    ================================================= */

    .tree-group > .tree-children {
        width: 100%;
        max-width: 100%;

        box-sizing: border-box;

        margin-left: 5px;
        padding-left: 12px;
    }


    /* =================================================
       TREE UNITS
    ================================================= */

    .tree-leaf {
        display: inline-flex;

        max-width: 100%;

        box-sizing: border-box;

        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }


    /* =================================================
       CARDS CONTAINER
    ================================================= */

    .selected-unit-container {
        width: 100%;
        flex: 0 0 100%;

        display: flex;

        flex-direction: column;
        flex-wrap: nowrap;

        align-items: stretch;
        justify-content: flex-start !important;

        gap: 12px;

        min-width: 0;

        box-sizing: border-box;
    }


    /* =================================================
       CARDS
    ================================================= */

    .selected-unit-container .full-unit-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        flex: 0 0 100% !important;

        float: none !important;

        box-sizing: border-box;

        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }


    /* =================================================
       CARD TEXT
    ================================================= */

    .full-unit-card .card-lanches-title,
    .full-unit-card .card-lanches-details,
    .full-unit-card .card-lanches-details p {
        max-width: 100%;
        min-width: 0;

        box-sizing: border-box;

        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}


/* =====================================================
   SMALL MOBILE
   320px - 480px
===================================================== */

@media (max-width: 480px) {

    .units-view-layout {
        gap: 10px;
    }

    .launch-groups-container {
        margin-top: 5px;
    }

    /* Tree */
    .tree-js ul {
        padding-left: 10px;
    }

    .tree-group > .tree-children {
        margin-left: 3px;
        padding-left: 10px;
    }

    .tree-group > .tree-group-title {
        font-size: 12px;

        padding: 5px 6px;

        max-width: calc(100% - 26px);
    }

    .tree-leaf {
        font-size: 11px;

        padding: 5px 6px;
    }

    .tree-toggle {
        width: 20px;
        min-width: 20px;
        max-width: 20px;

        height: 20px;
    }

    /* Filter */
    .unit-status-filter {
        font-size: 13px;
    }

    /* Cards */
    .selected-unit-container {
        gap: 10px;
    }

    .selected-unit-container .full-unit-card {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}
