@import "./themes";

.flex-grow-height-restricted,
%flex-grow-height-restricted {
    flex-grow: 1;
    min-height: 0;
}

.flex-1 {
    flex: 1;
}

.min-h-0 {
    min-height: 0;
}

.min-w-0 {
    min-width: 0;
}

.overflow-x-hidden {
    overflow-x: hidden;
}

.overflow-y-hidden {
    overflow-y: hidden;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

hr {
    color: var(--border-color);
}

div:focus-visible {
    outline: none;
}

kbd {
    background: var(--kbd-background-color);
}

.clickable,
%clickable {
    cursor: default;
}

%text-semibold,
.text-semibold {
    font-weight: 600;
}

.text-clickable {
    @extend %clickable;

    &:hover {
        color: var(--text-hover-color);
    }
}

.action-icon {
    @extend %clickable;
    color: var(--action-icon-color);

    &:hover {
        color: var(--action-icon-hover-color);
    }

    &.active {
        color: var(--active-color);
    }
}

.icon-button {
    @extend %clickable;
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
    line-height: 1rem;

    &:hover {
        background: var(--hover-color);
        border-radius: 5px;
    }

    &.active {
        color: var(--active-color) !important;
    }
}

.active-context-menu-target {
    background: var(--hover-color);
}

.text-truncate-1-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

// Multi line truncating uses line clamps
%text-truncate-multi-line {
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
}

.text-truncate-2-lines {
    @extend %text-truncate-multi-line;
    -webkit-line-clamp: 2;
}

.text-truncate-3-lines {
    @extend %text-truncate-multi-line;
    -webkit-line-clamp: 3;
}

%hide-scrollbar {
    -ms-overflow-style: none; /* Internet Explorer 10+ */
    scrollbar-width: none; /* Firefox */

    &::-webkit-scrollbar {
        display: none; /* Safari and Chrome */
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-color);
}

::-webkit-scrollbar-corner {
    background: var(--scrollbar-track-color);
}

.fade-in {
    opacity: 0;
    animation-name: fade-in;
    animation-duration: 0.6s;
    animation-fill-mode: forwards;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
