$tabHeight: 40px;
$tabWidth: 190px;
$firstTabPadding: 16px;

.container {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--component-bg-flexible, rgba(174, 184, 184, 0.15)) transparent;
    min-height: $tabHeight;
    gap: 2px;
}

$defaultBorder: 2px solid var(--surface-bg-below-2, #090f11);

.tab {
    width: $tabWidth;
    height: $tabHeight;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 4px;
    color: var(--text-subtle, #c9d2d2);

    border: none;
    border-top: $defaultBorder;
    background: var(--surface-bg-below-1, #171e21);

    &:first-child {
        position: relative;
        border-radius: 8px 0 0 0;
        border-left: $defaultBorder;
        padding-left: $firstTabPadding;
    }

    &:hover {
        background: var(--component-bg-flexible, rgba(174, 184, 184, 0.05));
        cursor: pointer;
    }

    &-icon {
        display: flex;
        width: 18px;
        height: 18px;
        border-radius: 4px;

        svg {
            width: 100%;
            height: 100%;
            padding: 4px;
        }

        justify-content: center;
        align-items: center;
    }
}

$activeBorder: 2px solid var(--text-subtle, #c9d2d2);

.active {
    background: var(--component-bg-flexible, rgba(174, 184, 184, 0.15));
    color: var(--text-primary, #ffffff);

    &:not(:first-child) {
        border-top: $activeBorder;
    }

    &:first-child {
        &::before {
            content: "";
            position: absolute;
            left: $firstTabPadding; // offset from the rounded left corner
            height: 2px;
            top: -2px;
            width: calc($tabWidth - $firstTabPadding - 2px); //2px for the border
            background: var(--text-subtle, #c9d2d2);
        }
    }
}
