@use "theme_variables_common" as common;
@use "typography";
@forward "theme_variables_common";


// Placeholder text
@mixin placeholder($color: var(--input-color-placeholder)) {
    // Firefox
    &::-moz-placeholder {
        color: $color;
        font-family: var(--font-family-regular);
        opacity: 0.7;
        font-size: .75rem;
    }

    // Microsoft Edge
    ::-ms-input-placeholder {
        color: $color;
        font-family: var(--font-family-regular);
        opacity: 0.7;
        font-size: .75rem;
    }

    // Safari and Chrome
    &::-webkit-input-placeholder {
        color: $color;
        font-family: var(--font-family-regular);
        opacity: 0.7;
        font-size: .75rem;
    }
}

@mixin ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: initial;
}

@mixin badge-effects($default, $hover, $active) {
    background-color: $default;

    &:hover {
        background-color: $hover;
    }

    &:active {
        background-color: $active;
    }
}

@mixin selected-tag {
    padding-left: 12px;
    padding-right: 32px !important;
}

@mixin badge-selected($default, $hover, $active) {
    @include selected-tag;
    background-color: $default;

    &>span.close-button:hover {
        background-color: $hover;
    }

    &>span.close-button:active {
        background-color: $active;
    }
}

/* Rotation mixin */
@-webkit-keyframes rotating {

/* Safari and Chrome */

    from {
        -webkit-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    to {
        -webkit-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@keyframes rotating {
    from {
        -ms-transform: rotate(0deg);
        -moz-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    to {
        -ms-transform: rotate(360deg);
        -moz-transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@mixin rotate {
    -webkit-animation: rotating 2s linear infinite;
    -moz-animation: rotating 2s linear infinite;
    -ms-animation: rotating 2s linear infinite;
    -o-animation: rotating 2s linear infinite;
    animation: rotating 2s linear infinite;
}

@mixin keyframe($animation_name) {
    @-webkit-keyframes #{$animation-name} {
        @content;
    }

    @-moz-keyframes #{$animation-name} {
        @content;
    }

    @-o-keyframes #{$animation-name} {
        @content;
    }

    @keyframes #{$animation-name} {
        @content;
    }
}

@mixin details-buttons {
    flex: 0 0 auto;

    &:hover,
    &:hover>span {
        color: var(--btn-text-hover-color) !important;

        svg-icon {
            svg {
                g,
                path,
                circle {
                    stroke: var(--btn-text-hover-color) !important;
                    fill : none;
                }
            }
        }
    }

    @include typography.regular13nocolor;
    color: var(--btn-text-color);
    background-color: inherit;
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 0;

    svg-icon {
        svg {
            height: 20px;

            g,
            path,
            circle {
                stroke: var(--btn-text-color) !important;
                fill: none;
            }
        }
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}

@mixin legacy-btn {
    font-family: var(--font-family-medium);
    //color           : $font-color-medium;
    font-size: var(--h6-font-size)  !important;
    height: 2rem !important;
    border-radius: common.$border-radius-base  !important;
    font-weight: inherit !important;
    padding: 0 1rem !important;
    border: none;
    display: flex !important;
    align-items: center !important;
    transition: none !important;
    max-width: 298px;
    text-overflow: ellipsis;
    overflow: hidden;
    line-height: 1rem !important;
    justify-content: center;
    text-decoration: none;
    box-shadow: none;

    &:hover,
    &:active,
    &.active,
    &:focus,
    &.focus {
        box-shadow: none;
    }

    &:disabled {
        opacity: 0.3;

        & * {
            pointer-events: none;
        }
    }
}
