@import "app/styles/variables";

bl-dropdown {
    $dropdown-content-color: map-get($header-color, text);
    $dropdown-content-hover-color: $primary-color-light;
    .dropdown {
        position: relative;
        height: 100%;
    }

    .dropdown-btn-container {
        position: relative;
        padding: 0 5px;
        display: flex;
        height: 100%;
        text-align: center;
        align-items: center;
        justify-content: center;
    }

    .dropdown-btn-container {
        cursor: pointer;

        &:hover, &.active {
            color: map-get($header-color, text-hover);
            background-color: $primary-color-dark;
        }
    }

    .dropdown-content {
        position: absolute;
        z-index: $zindex-dropdown;
        background-color: $dropdown-content-color;
        color: $primary-text;
        overflow: hidden;
        max-height: 80vh;

        &.below {
            top: $header-height;
        }

        &.above {
            bottom: $footer-height;
        }

        &[align=left] {
            left: 0;
        }

        &[align=right] {
            right: 0;
        }

        $dropdown-shadow: 20px 0 rgba(0, 0, 0, 0.3);
        &.below[align=left] {
            box-shadow: 3px 3px $dropdown-shadow;
        }

        &.below[align=right] {
            box-shadow: -3px 3px $dropdown-shadow;
        }


        &.above[align=left] {
            box-shadow: 3px -3px $dropdown-shadow;
        }

        &.above[align=right] {
            box-shadow: -3px -3px $dropdown-shadow;
        }


        .no-items {
            padding: 10px 5px;
        }
    }

    .dropdown-item {
        position: relative;
        min-width: 100px;
        cursor: pointer;
        padding: 5px 10px;
        display: flex;
        align-items: center;

        &:not(:first-child) {
            border-top: 1px solid $border-color;
        }

        &:hover, &.active {
            background-color: $dropdown-content-hover-color;

            .fa {
                color: $dropdown-content-color;
            }
        }

        .main {
            flex: 1 0 auto;

            .alias, .url {
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
            }
        }

        .extra {
            flex: 0 0 auto;
        }
    }
}
