@use "../../wwwroot/scss/variables" as *;

.ribbon-tab {
    --bb-ribbon-menu-height: #{$bb-ribbon-menu-height};
    --bb-ribbon-menu-margin-top: #{$bb-ribbon-menu-margin-top};
    --bb-ribbon-menu-body-height: #{$bb-ribbon-menu-body-height};
    --bb-ribbon-menu-body-padding: #{$bb-ribbon-menu-body-padding};
    --bb-ribbon-menu-radius: #{$bb-ribbon-menu-radius};
    --bb-ribbon-menu-padding: #{$bb-ribbon-menu-padding};
    --bb-ribbon-menu-border-color: #{$bb-ribbon-menu-border-color};
    --bb-ribbon-menu-hover-color: #{$bb-ribbon-menu-hover-color};
    --bb-ribbon-menu-bg: #{$bb-ribbon-menu-bg};
    --bb-ribbon-menu-color: #{$bb-ribbon-menu-color};
    --bb-ribbon-button-hover-bg: #{$bb-ribbon-button-hover-bg};
    --bb-ribbon-button-hover-border-color: #{$bb-ribbon-button-hover-border-color};
    --bb-ribbon-button-active-bg: #{$bb-ribbon-button-active-bg};
    --bb-ribbon-button-active-border-color: #{$bb-ribbon-button-active-border-color};
    --bb-ribbon-button-border-width: #{$bb-ribbon-button-border-width};
    --bb-ribbon-button-border-color: #{$bb-ribbon-button-border-color};
    --bb-ribbon-button-radius: #{$bb-ribbon-button-radius};
    --bb-ribbon-button-padding: #{$bb-ribbon-button-padding};
    --bb-ribbon-button-fontsize: #{$bb-ribbon-button-fontsize};
    --bb-ribbon-button-min-width: #{$bb-ribbon-button-min-width};
    --bb-ribbon-group-fontsize: #{$bb-ribbon-group-fontsize};
    --bb-ribbon-group-color: #{$bb-ribbon-group-color};
    --bb-ribbon-group-margin-top: #{$bb-ribbon-group-margin-top};
    --bb-ribbon-body-padding: #{$bb-ribbon-body-padding};
    --bb-ribbon-menu-header-height: calc(var(--bb-ribbon-menu-height) + var(--bb-ribbon-menu-margin-top) + var(--bb-ribbon-menu-body-height));
    position: relative;

    .ribbon-header {
        position: relative;

        &.is-float:not(.is-expand) {
            --bb-ribbon-menu-body-height: 0px;

            .tabs-body-content {
                height: 0;
            }
        }

        .tabs-header {
            background-color: var(--bb-ribbon-menu-bg);
            border-bottom: 1px solid var(--bs-border-color);

            .tabs-nav-scroll {
                padding: 0 var(--bb-ribbon-menu-padding);
            }
        }

        .tabs-body {
            padding: 0;

            .link-button {
                font-size: var(--bb-ribbon-button-fontsize);
                padding: var(--bb-ribbon-button-padding);
                border-radius: var(--bb-ribbon-button-radius);
                border: var(--bb-ribbon-button-border-width) solid var(--bb-ribbon-button-border-color);
                min-width: var(--bb-ribbon-button-min-width);
                transition: background-color .3s ease-in-out, border-color .3s ease-in-out, box-shadow .3s ease-in-out;

                &.active {
                    background-color: var(--bb-ribbon-button-active-bg);
                    border-color: var(--bb-ribbon-button-active-border-color);
                }

                &:not(:last-child) {
                    margin-inline-end: 1px;
                }

                &:not([disabled]):hover {
                    background-color: var(--bb-ribbon-button-hover-bg);
                    border-color: var(--bb-ribbon-button-hover-border-color);
                }

                > i {
                    font-size: 1rem;
                    margin-block-end: .25rem;
                }

                > span {
                    white-space: nowrap;
                }
            }

            .tabs-body-content {
                overflow: hidden;
                height: var(--bb-ribbon-menu-body-height);
                transition: height .3s ease-in-out;

                .tab-commands {
                    display: flex;
                    flex-wrap: nowrap;
                    font-size: var(--bb-ribbon-button-fontsize);
                    overflow: hidden;
                    padding: var(--bb-ribbon-menu-body-padding);
                    height: 100%;

                    .link-group {
                        display: flex;
                        flex-direction: column;
                        align-items: center;

                        .link-group-name {
                            margin-block-start: var(--bb-ribbon-group-margin-top);
                            color: var(--bb-ribbon-group-color);
                            font-size: var(--bb-ribbon-group-fontsize)
                        }
                    }

                    .divider-vertical {
                        margin: 0 4px;
                    }
                }
            }
        }

        .ribbon-buttons {
            position: absolute;
            right: 1rem;
            top: var(--bb-ribbon-menu-margin-top);
            height: var(--bb-ribbon-menu-height);
            display: flex;
            align-items: center;

            > * {
                cursor: pointer;
            }

            .ribbon-customer-buttons {
                display: flex;
                align-items: center;
                margin-inline-end: 1rem;
            }

            .ribbon-button {
                padding: 1px 8px;
                cursor: pointer;
                border-radius: var(--bs-border-radius);
                transition: background-color .3s ease-in-out;

                &:hover {
                    background-color: var(--bb-tab-item-hover-color);
                }
            }
        }

        .ribbon-arrow {
            width: 18px;
            height: 28px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }

    .ribbon-body {
        border-top: var(--bs-border-width) solid var(--bs-border-color);
        padding: var(--bb-ribbon-body-padding);
        position: relative;
    }
}
