:host {
    display: flex;
    width: 100vw;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
    cursor: default;
    animation: 0.5s ease-out fadeIn;
    transition: 0.25s background;

    --tabs-height: calc(38px * var(--spaciness));
    --side-tab-width: calc(200px * var(--spaciness));
}

$tab-border-radius: 4px;

.wrap {
  display: flex;
  width: 100vw;
  height: 100vh;
  flex-direction: row;
}

.content {
    width: 100%;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column-reverse;

    &.tabs-on-top {
        flex-direction: column;
    }

    &.tabs-on-right {
        flex-direction: row-reverse;
    }

    &.tabs-on-left {
        flex-direction: row;
    }
}

.content.tabs-on-left > .tab-bar, .content.tabs-on-right > .tab-bar {
    height: 100%;
    width: var(--side-tab-width);
    overflow-y: auto;
    overflow-x: hidden;
    flex-direction: column;
    background: var(--theme-bg-more-2);

    .tabs {
        width: var(--side-tab-width);
        flex: none;
        flex-direction: column;

        tab-header {
            flex: 0 0 var(--tabs-height);
        }
    }

    .btn-space {
        flex: auto;
    }

    &>.inset {
        opacity: 0;
        width: 100%;
    }

    ::ng-deep tab-header {
        width: 100% !important;
    }
}

.content.tabs-on-left > .tab-bar.tab-bar-no-controls-overlay, .content.tabs-titlebar-enabled {
    .tabs {
        padding-top: 0 !important;
    }
}

.content.tabs-on-right > .tab-bar {
    .tabs {
        // Account for WCO on Windows.
        padding-top: 36px;
    }
}

.tab-bar {
    flex: none;
    height: var(--tabs-height);
    display: flex;
    width: 100%;

    .btn-tab-bar {
        line-height: calc(var(--tabs-height) + 2px);
        height: var(--tabs-height);
        cursor: pointer;

        display: flex;
        align-items: center;
        padding: 0 12px;
        flex: 0 0 auto;
        border-bottom: 2px solid transparent;
        transition: 0.125s all ease-out;
        font-size: 12px;

        text-transform: uppercase;
        font-weight: bold;
        color: #aaa;
        border: none;
        border-radius: 0;

        align-items: center;

        &.dropdown-toggle::after {
            display: none;
        }
    }

    &>.tabs {
        flex: 0 1 auto;
        display: flex;
        min-width: 0;
    }

    &>.btn-space {
        min-width: 1px;
        flex: 1 0 1%;

        .tabs-on-top & {
            margin-top: 2px; // for window resizing
        }

        &.drag {
            -webkit-app-region: drag;
        }

        &.persistent {
        //   min-width: 72px; // 2 x 36 px height, ie 2 squares
        // Given WCO on Windows, the min-width of the window buttons is about 138px.
            min-width: 138px;
        }
    }

    &>.window-controls-spacer {
        min-width: 138px;
        height: 100%;
    }

    & > .inset {
        width: calc(70px + 15px * var(--spaciness));
        height: var(--tabs-height);
        flex: none;
        -webkit-app-region: drag;
    }

    window-controls {
        padding-left: 10px;
    }

    .cdk-drag-animating {
        transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
    }

    .cdk-drop-list-dragging tab-header:not(.cdk-drag-placeholder) {
        transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
    }
}

.content {
    flex: 1 1 0;
    position: relative;
    min-height: 0;
    min-width: 0;

    > .content-tab {
        position: absolute;
        top: 0;
        width: 100%;
        height: 100%;

        left: -1000%;

        &.content-tab-active {
            left: 0;
        }
    }
}

hotkey-hint {
    position: absolute;
    bottom: 0;
    right: 0;
    max-width: 300px;
}

::ng-deep .btn-tab-bar svg,
::ng-deep .btn-tab-bar + .dropdown-menu svg {
    width: calc(22px * var(--spaciness));
    height: calc(16px * var(--spaciness));
    fill: white;
    fill-opacity: 0.75;
}

::ng-deep .btn-update svg {
    fill: cyan;
}

::ng-deep .broadcast-status-warning {
    background: red;
    position: absolute;
    top: 0;
    left: 50%;
    padding: 5px 10px;
    color: black;
    border-radius: 0 0 5px 5px;

    width: 300px;
    margin-left: -150px;
    text-align: center;
    font-weight: bold;
}
