@import "styles/base.scss";
@import "styles/custom_variables.scss";

// link rgb(132, 159, 188)
// hover rgb(0, 118, 163)

// This is an absolute mess. TODO: clean up.

.contacts-profile {
    position: absolute;
    top: 0;
    right: 0;
    width: 250px;
    z-index: 9001;

    display: flex;
    flex-direction: row;

    @include media("<tablet") {
        width: 155px;
    }

    .item {
        display: table-cell;
        text-align: center;
        vertical-align: middle;
        padding: 8px 0 7px;

        &.title {
            background-color: $blue;
            padding: 0 15px;

            img {
                max-width: 100%;
            }

            &.phone {
                @include media(">=tablet") {
                    display: none;
                }
            }

            &.tablet {
                background-color: white;
                display: none;
                text-align: right;
                padding-left: 105px;

                @include media(">=tablet") {
                    display: table-cell;
                }

                @include media(">=1600px") {
                    padding-left: 160px;
                }
            }

            h1 {
                color: $blue;
                margin: 0;
                font-size: 18px;
                font-weight: 700;
                line-height: 1;
                float: left;
                text-transform: uppercase;

                @include media(">=1600px") {
                    font-size: 24px;
                    line-height: 0.8;
                }
            }
        }

        &.chat,
        &.contacts,
        &.user,
        &.menu {
            cursor: pointer;
        }

        &.chat,
        &.help,
        &.contacts {
            background-color: white;
            text-transform: uppercase;
            font-weight: 700;
            width: 80px;

            span {
                display: block;
            }

            .icon {
                color: $blue;
                font-size: 35px;

                .svg {
                    width: 45px;
                    height: 35px;
                    margin: -5px auto 5px;
                }
            }
        }

        &.help {
            box-shadow: -5px 0px 0px 0px rgba(0, 0, 0, 0.1);

            @include media(">=tablet") {
                border-left: 1px solid $dropdown-grey-border;
                box-shadow: none;
            }
        }

        &.contacts {
            border-left: 1px solid $dropdown-grey-border;
            display: none;

            @include media(">=tablet") {
                display: table-cell;
            }

            @include media(">=1600px") {
                display: none;
            }
        }

        &.chat {
            border-left: 1px solid $dropdown-grey-border;
            display: none;

            @include media(">=tablet") {
                display: table-cell;
            }
        }

        &.user {
            border-left: 1px solid $dropdown-grey-border;
            background-color: white;
            width: 80px;
            position: relative;

            @include media(">=tablet") {
                border-left: none;
                background-color: $headers-color;
                box-shadow: inset 10px 0 0 -5px rgba(0, 0, 0, 0.33);
                width: 50%;
            }

            @include media(">=1600px") {
                width: 250px;
            }

            img {
                border-radius: 50px;
                width: 50px;
                height: 50px;

                @include media(">=1600px") {
                    margin-right: 10px;
                }
            }

            .open-close-icon.mobile {
                background-color: $blue;
                border-radius: 32px;
                box-shadow: 0 5px 0 0 rgba(0, 0, 0, 0.25);
                position: absolute;
                top: 5px;
                right: 5px;
                width: 32px;
                height: 32px;
                -webkit-transform: rotate(45deg);
                transform: rotate(45deg);
                display: none;

                &:before,
                &:after {
                    background-color: white;
                }
            }

            .user-info {
                display: none;
                vertical-align: middle;
                // margin-right: 10px;

                @include media(">=1600px") {
                    display: inline-block;
                }

                p {
                    color: white;
                    margin: 0;
                    font-weight: 400;
                    line-height: 1.1;
                    text-transform: none;
                    text-align: left;
                }

                .position {
                    color: $blue;
                    font-size: 12px;
                }
            }

            .dropdown-icon {
                display: none;
                border-right: 2px solid $blue;
                border-bottom: 2px solid $blue;
                width: 15px;
                height: 15px;
                margin-left: 10px;
                -webkit-transform: rotate(45deg);
                transform: rotate(45deg);

                @include media(">=tablet") {
                    display: inline-block;
                }
            }

            &.active {
                background-color: $dropdown-grey-border;

                @include media(">=tablet") {
                    background-color: $headers-color;
                }

                img {
                    border: 2px solid $blue;

                    @include media(">=tablet") {
                        border: none;
                    }
                }

                .open-close-icon {
                    display: block;

                    @include media(">=tablet") {
                        display: none;
                    }
                }
            }
        }

        &.menu {
            background-color: $headers-color;
            width: 75px;

            .bar {
                background-color: $blue;
                display: block;
                width: 30px;
                height: 2px;
                margin: 7px auto;
                position: relative;
                transition: all 0.3s;
            }

            .open,
            .close {
                text-transform: uppercase;
                font-weight: 700;
            }

            .close {
                display: none;
            }

            @include media(">=tablet") {
                display: none;
            }

            &.active {
                .bar-top {
                    top: 9px;
                    -webkit-transform: rotate(45deg);
                    transform: rotate(45deg);
                }

                .bar-middle {
                    opacity: 0;
                }

                .bar-bottom {
                    top: -9px;
                    -webkit-transform: rotate(-45deg);
                    transform: rotate(-45deg);
                }

                .open {
                    display: none;
                }

                .close {
                    display: inline;
                    float: none;
                    font-size: inherit;
                    text-shadow: none;
                    color: $light-blue;
                    opacity: 1;
                }
            }
        }
    }

    .contacts,
    .user,
    .menu {
        cursor: pointer;
    }

    .contacts {
        background-color: white;
        text-transform: uppercase;
        font-weight: 700;
        width: 80px;

        span {
            display: block;
        }

        .icon {
            color: $blue;
            font-size: 35px;

            .svg {
                width: 45px;
                height: 35px;
                margin: -5px auto 5px;
            }
        }
    }

    .contacts {
        border-left: 1px solid $dropdown-grey-border;
        display: none;

        @include media(">=tablet") {
            display: table-cell;
        }

        @include media(">=1600px") {
            display: none;
        }
    }

    /* open contacts sidebar */
    #help-toggle {
        position: relative;
        width: 50%;
        cursor: pointer;

        border-left: 1px solid rgb(190, 202, 213);

        @include media(">1600px") {
            display: none;
        }

        .help {
            
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content:center;

            onguard-icomoon-icon {
                font-size: 40px;
                height: 45px;
            }
            
            span {
                color: #7e95ac;
                text-transform: uppercase;
                font-weight: 700;
                font-size:14px;
            }
        }

        &.show-sidebar {
            .open-close-icon {
                display: block;
            }
        }
    }

    /* user menu and submenu */
    #user-menu {
        //   @include user-select(none);

        &:before {
            content: "";
            display: none;
            background-color: $user-menu;
            width: 16px;
            height: 16px;
            position: absolute;
            left: 50%;
            margin-left: -8px;
            bottom: -8px;
            -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
        }

        .open-close-icon.tablet {
            position: static;
            margin: 0 0 0 5px;
            vertical-align: middle;
            display: inline-block;
            -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
        }

        #user-submenu {
            background-color: $user-menu;
            position: absolute;
            right: 0;
            top: 100%;
            width: 250px;
            text-align: left;
            //height: 0;

            // &:not()

            .select-wrapper {
                margin: 5px;
            }

            @include media(">=1600px") {
                width: 250px;
            }

            a {
                font-weight: 700;
                display: block;
                padding: 15px 10px;
                border-top: 1px solid $dark-gray;

                &:first-child {
                    border-bottom: 1px solid $light-blue;
                    border-top: 0px solid $dark-gray;
                }

                .icon {
                    color: $light-blue;
                    font-size: 24px;
                    vertical-align: middle;
                    margin-right: 5px;
                    border-left: 0;
                    display: inline-block;
                }
            }
            .sidebar-help {
                box-shadow: inset 10px 0 0 -5px rgba(0, 0, 0, 0.15);
                background-color: #e5eaee;
                height: 100vh;
                padding-top: 30px;
                .icon {
                    margin: 0px auto;
                    background-color: #f2f5f7;
                    border: 5px solid rgba(0, 0, 0, 0.15);
                    border-radius: 100px;
                    display: block;
                    font-size: 40px;
                    width: 100px;
                    height: 100px;
                    padding-top: 7.5px;
                    div {
                        width: 80%;
                        height: auto;
                        margin: 0 auto;
                    }
                }
                .helpTopics {
                    font-family: "Source Sans Pro";
                    font-size: 18px;
                    font-weight: 700;
                    line-height: 47.99px;
                    text-align: center;
                    border-bottom: 2px solid #cad3de;
                }
            }
        }
    }

    .user {
        height: 75px;
        border-left: 1px solid $dropdown-grey-border;
        background-color: white;
        width: 80px;
        position: relative;

        @include media(">=tablet") {
            border-left: none;
            background-color: $headers-color;
            box-shadow: inset 10px 0 0 -5px rgba(0, 0, 0, 0.33);
            width: 50%;
        }

        @include media(">=1600px") {
            width: 250px;
        }

        img {
            border-radius: 50px;
            width: 50px;
            height: 50px;

            @include media(">=1600px") {
                margin-right: 10px;
            }
        }

        .open-close-icon.mobile {
            background-color: $blue;
            border-radius: 32px;
            box-shadow: 0 5px 0 0 rgba(0, 0, 0, 0.25);
            position: absolute;
            top: 5px;
            right: 5px;
            width: 32px;
            height: 32px;
            -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
            display: none;

            &:before,
            &:after {
                background-color: white;
            }
        }

        .user-info {
            display: none;
            vertical-align: middle;
            margin-right: 10px;

            @include media(">=1600px") {
                display: inline-block;
            }

            p {
                color: white;
                margin: 0;
                font-weight: 400;
                line-height: 1.1;
                text-transform: none;
                text-align: left;
            }

            .position {
                color: $blue;
                font-size: 12px;
            }
        }

        .dropdown-icon {
            display: none;
            border-right: 2px solid $blue;
            border-bottom: 2px solid $blue;
            width: 15px;
            height: 15px;
            margin-left: 10px;
            -webkit-transform: rotate(45deg);
            transform: rotate(45deg);

            &.rotated {
                transform: rotate(-135deg);
            }

            @include media(">=tablet") {
                display: inline-block;
            }
        }

        &.active {
            background-color: $dropdown-grey-border;

            @include media(">=tablet") {
                background-color: $headers-color;
            }

            img {
                border: 2px solid $blue;

                @include media(">=tablet") {
                    border: none;
                }
            }

            .open-close-icon {
                display: block;
                @include media(">=tablet") {
                    display: none;
                }
            }
        }
    }

    .menu {
        background-color: $headers-color;
        width: 75px;

        .bar {
            background-color: $blue;
            display: block;
            width: 30px;
            height: 2px;
            margin: 7px auto;
            position: relative;
            transition: all 0.3s;
        }

        .open,
        .close {
            text-transform: uppercase;
            font-weight: 700;
        }

        .close {
            display: none;
        }

        @include media(">=tablet") {
            display: none;
        }

        &.active {
            .bar-top {
                top: 9px;
                -webkit-transform: rotate(45deg);
                transform: rotate(45deg);
            }

            .bar-middle {
                opacity: 0;
            }

            .bar-bottom {
                top: -9px;
                -webkit-transform: rotate(-45deg);
                transform: rotate(-45deg);
            }

            .open {
                display: none;
            }

            .close {
                display: inline;
                float: none;
                font-size: inherit;
                text-shadow: none;
                color: $light-blue;
                opacity: 1;
            }
        }
    }
}

#sidebar-menu {
    background-color: #e5eaee;
    position: absolute;
    top: -100%;
    right: 0;
    left: 0;
    width: 100%;
    z-index: 1999;
    font-family: "Source Sans Pro";
    color: rgb(126, 149, 172);
    transition: right 0.3s;

    @include media(">=tablet") {
        border-left: 1px solid #cad3dd;
        box-shadow: inset 11px 0 0 -7px rgba(0, 0, 0, 0.075);
        top: 0 !important;
        left: auto;
        right: -250px;
        width: 250px;

        &.show {
            right: 0 !important;
        }
    }

    

    @include media(">=1600px") {
        right: 0 !important;
        width: 250px;
    }

    #close-sidebar {
        border-bottom: 1px solid #cad3dd;
        background-color: #d8dfe6;
        box-shadow: inset 0 10px 0 -5px rgba(0, 0, 0, 0.075);
        padding: 20px 15px;
        position: relative;
        cursor: pointer;

        @include media(">=tablet") {
            box-shadow: inset 11px 0 0 -7px rgba(0, 0, 0, 0.075);
        }

        @include media(">=1600px") {
            display: none;
        }

        strong {
            color: $dark-blue;
            text-transform: uppercase;
        }

        .close-sidebar-icon {
            display: block;
            position: absolute;
            height: 31px;
            width: 31px;
            top: 13px;
            right: 7px;
            -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
        }

        .close-sidebar-icon:before,
        .close-sidebar-icon:after {
            content: " ";
            position: absolute;
            top: 50%;
            left: 50%;
            -webkit-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
            background: $blue;
        }

        .close-sidebar-icon:before {
            height: 1px;
            width: 21px;
        }

        .close-sidebar-icon:after {
            height: 21px;
            width: 1px;
        }
    }

    .sidebar-search {
        display: none;
        border-bottom: 1px solid #cad3dd;
        background-color: #d8dfe6;
        padding: 15px;

        @include media(">=tablet") {
            box-shadow: inset 11px 0 0 -7px rgba(0, 0, 0, 0.075);
        }

        @include media(">=1600px") {
            display: block;
        }

        .icon-search {
            display: inline-block;
            color: $blue;
            font-size: 26px;
            width: 26px;
            height: 26px;
            vertical-align: middle;
            margin-right: 5px;
        }

        input {
            color: $dark-blue;
            border: none;
            background-color: transparent;
            font-size: 14px;
            font-style: italic;
            width: 180px;
        }
    }

    .sidebar-items-list {
        .item {
            border-bottom: 1px solid #cad3dd;
            background-color: #e5eaee;
            position: relative;
            padding: 0;
            margin-bottom: 0;

            @include media(">=tablet") {
                box-shadow: inset 11px 0 0 -7px rgba(0, 0, 0, 0.075);
            }

            .item-header {
                cursor: pointer;
                padding: 20px 50px 20px 0;

                .lable {
                    color: $dark-blue;
                    font-size: 16px;
                    font-weight: bold;
                    margin: 0;
                    padding-left: 50px;
                    overflow: hidden;
                }

                .lable:before {
                    border-radius: 16px;
                    content: " ";
                    display: block;
                    width: 16px;
                    height: 16px;
                    position: absolute;
                    top: 20px;
                    left: 18px;
                }
            }

            .open-close-icon {
                top: 18px;
                right: 13px;
            }
        }

        .item.red {
            .lable:before {
                background-color: $red;
            }
        }

        .item.yellow {
            .lable:before {
                background-color: $yellow;
            }
        }

        .item.green {
            .lable:before {
                background-color: $green;
            }
        }

        .item:before {
            content: " ";
            display: block;
            background-color: #becad5;
            width: 1px;
            height: 1px;
            position: absolute;
            top: 27px;
            left: 25px;
            transition: height 0.3s;
        }

        .item.active:before {
            height: 31px;
        }

        .item-dropdown {
            .inner-item-holder {
                background-color: #d8dfe6;
                padding-left: 25px;
                position: relative;
                cursor: pointer;

                @include media(">=tablet") {
                    box-shadow: inset 11px 0 0 -7px rgba(0, 0, 0, 0.075);
                }

                .inner-item {
                    border-left: 1px solid #becad5;
                    position: relative;
                    padding: 17px 0;

                    .lable {
                        font-size: 16px;
                        margin: 0;
                        padding-left: 20px;
                    }

                    .lable:before {
                        border-radius: 16px;
                        content: " ";
                        display: block;
                        width: 16px;
                        height: 16px;
                        position: absolute;
                        top: 17px;
                        left: -8px;
                    }
                }
            }

            .inner-item-holder.red {
                .lable:before {
                    background-color: $red;
                }
            }

            .inner-item-holder.yellow {
                .lable:before {
                    background-color: $yellow;
                }
            }

            .inner-item-holder.green {
                .lable:before {
                    background-color: $green;
                }
            }

            .inner-item-holder:first-child {
                border-top: 1px solid #cad3dd;
            }

            .inner-item-holder:last-child {
                .inner-item {
                    border: none;
                }
            }

            .inner-item-holder:last-child:before {
                content: " ";
                display: block;
                background-color: #becad5;
                width: 1px;
                height: 1px;
                position: absolute;
                bottom: 25px;
                left: 25px;
                transition: height 0.3s;
            }

            .inner-item-holder:last-child:hover,
            .inner-item-holder:last-child:focus {
                .inner-item {
                    border: none;
                }
            }

            .inner-item-holder:hover,
            .inner-item-holder:focus {
                background-color: #becad5;

                .inner-item {
                    border-left: 1px solid #7e95ac;
                }
            }
        }

        .item.active {
            .inner-item-holder:last-child:before {
                content: " ";
                display: block;
                background-color: #becad5;
                width: 1px;
                height: 27px;
                position: absolute;
                bottom: 25px;
                left: 25px;
                transition: height 0.3s;
            }

            .inner-item-holder:last-child:hover:before {
                background-color: #7e95ac;
            }

            .open-close-icon {
                -webkit-transform: rotate(45deg);
                transform: rotate(45deg);
            }
        }
    }
}

#sidebar-menu {
    margin-top: 75px;
    height: calc(100% - 75px);

    &.contacts-sidebar {
        text-align: center;

        h5 {
            font-weight: bold;
        }

        @include media("<tablet") {
            // display: none !important;
        }

        .header {
            padding: 15px 15px 25px;
            border-bottom: 2px solid #cad3de;

            .icon {
                background-color: $icon-bg;
                border: 5px solid rgba(0, 0, 0, 0.15);
                border-radius: 100px;
                display: inline-block;
                font-size: 40px;
                width: 100px;
                height: 100px;
                padding-top: 12px;

                .svg {
                    width: 60px;
                    height: auto;
                    margin-left: 15px;
                    margin-right: 15px;
                }
            }

            h2 {
                margin: 0;
                font-size: 22px;
                font-weight: 700;
            }
        }

        .item {
            border-bottom: 1px solid $darker-grey-border;
            display: table;
            width: 100%;
            padding: 15px 0;

            &:first-child {
                border-top: 1px solid $darker-grey-border;
                box-shadow: inset 11px 0 0 -7px rgba(0, 0, 0, 0.05);
                background-color: $grey-border;
                padding: 10px 0;
                position: relative;

                h3 {
                    color: $dark-blue;
                    font-weight: 700;
                }

                &:before {
                    content: "";
                    border-left: 1px solid $darker-grey-border;
                    border-top: 1px solid $darker-grey-border;
                    background-color: $grey-border;
                    display: block;
                    width: 16px;
                    height: 16px;
                    position: absolute;
                    left: 50%;
                    margin-left: -8px;
                    top: -9px;
                    -webkit-transform: rotate(45deg);
                    transform: rotate(45deg);
                }
            }

            .text {
                display: table-cell;
                vertical-align: middle;
                text-align: left;
                padding: 0 15px;

                h3 {
                    margin: 0;
                    font-size: 18px;
                    color: $blue;
                }

                .position {
                    text-transform: uppercase;
                    font-size: 12px;
                    font-weight: 700;
                    margin: 0;
                }

                .phone {
                    color: $light-blue;
                    font-size: 16px;
                    font-weight: 700;
                    margin: 0;
                    a {
                        color: $light-blue;
                    }
                }
            }

            .icon {
                color: $blue;
                border-left: 1px solid $darker-grey-border;
                display: table-cell;
                font-size: 30px;
                width: 50px;
                vertical-align: middle;
            }
        }

        .footer {
            padding: 20px 15px;

            a {
                color: $dark-blue;
                text-transform: uppercase;
                font-weight: 700;

                .icon {
                    color: $blue;
                    margin-left: 10px;
                }
            }
        }

        //  Profile
    }
}

.sidebar-accordion-wrapper {
    .panel-group {
        margin-bottom: 0px;
        .panel {
            margin-bottom: 0px;
            background-color: transparent;
            border-bottom: 2px solid #cad3de;
            border-left: 0px solid #cad3de;
            border-right: 0px solid #cad3de;
            border-top: 0px solid #cad3de;
            border-radius: 0px;
            -webkit-box-shadow: none;
            box-shadow: none;
            position: relative;

            + .panel {
                margin-top: 0;
            }
            .panel-heading {
                color: #849fbc;
                background-color: transparent;
                border-color: transparent;
                border-top-left-radius: 0px;
                border-top-right-radius: 0px;
                padding: 0;
                .panel-title {
                    text-align: left;
                    font-weight: bold;
                    margin-top: 0;
                    margin-bottom: 0;
                    font-size: 16px;
                    a {
                        color: #849fbc;
                        border-bottom: 0px solid #7e95ac !important;
                        border-top: 0px solid #4c6c8c !important;
                        transition: all 0.3s ease-in-out;
                        transition-delay: 0.3s;
                        padding: 20px 15px;
                        display: inline-block;
                        width: 100%;
                        &:hover {
                            color: rgb(0, 118, 163);
                        }
                        &:first-child {
                            border-bottom: 0px solid #7e95ac !important;
                            border-top: 0px solid #4c6c8c !important;
                        }
                        span {
                            right: 15px;
                            &:before {
                                content: "";
                                position: absolute;
                                width: 1px;
                                height: 22px;
                                top: 18px;
                                right: 23px;
                                -webkit-transform: rotate(0deg);
                                -ms-transform: rotate(0deg);
                                transform: rotate(0deg);
                                -webkit-transition: 0.3s;
                                transition: 0.3s;
                                background-color: #cad3de;
                            }
                            &:after {
                                content: "";
                                position: absolute;
                                width: 1px;
                                height: 22px;
                                top: 18px;
                                right: 23px;
                                -webkit-transform: rotate(-90deg);
                                -ms-transform: rotate(-90deg);
                                transform: rotate(-90deg);
                                -webkit-transition: 0.3s;
                                transition: 0.3s;
                                background-color: #cad3de;
                            }
                        }
                        &.expanded {
                            color: #002c59;
                            background-color: #d8dfe7;
                            span {
                                &:before {
                                    -webkit-transform: rotate(-45deg);
                                    -ms-transform: rotate(-45deg);
                                    transform: rotate(-45deg);
                                    background-color: #00aeef;
                                }
                                &:after {
                                    -webkit-transform: rotate(45deg);
                                    -ms-transform: rotate(45deg);
                                    transform: rotate(45deg);
                                    background-color: #00aeef;
                                }
                            }
                        }
                    }
                }
            }
            .panel-collapse {
                transition: all 0.3s ease-in-out;
                background-color: #e5eaed;

                .panel-body {
                    padding: 15px;
                    border-top: 1px solid #cad3de;
                    text-align: left;
                    color: #002c59;
                }
                &.collapsing {
                    background-color: red;
                }
                &.show {
                    background-color: #d8dfe7;
                }
            }
        }
    }
}
