@use "../variables";
.alert {
    padding: 0.625rem 0.85rem;
    border-radius: variables.$default-radius;
    font-size: 0.8125rem;
    &.alert-dismissible {
        padding: 0.625rem 3rem 0.625rem 0.85rem;
    }
    .btn-close {
        background-image: none;
        padding: 0.95rem;
        display: flex;
        align-items: center;
        justify-content: center;
        i {
            font-size: 1.5rem;
            line-height: 1.5rem;
        }
    }
    &:last-child {
        margin-bottom: 0;
    }
    .alert-link {
        font-weight: 400;
    }
}
[dir="rtl"] {
    .alert.alert-dismissible {
        padding: 0.625rem 0.85rem 0.625rem 3rem;
    }
}

/* Basic Alerts */
@mixin custom-close($color) {
    background-color: $color;
    color: variables.$white;
    opacity: 1;
    border-radius: 50px;
    box-shadow: variables.$box-shadow;
    padding: 0.85rem;
}
.alert-warning {
    background-color: rgba(var(--warning-rgb),0.1);
    color: variables.$warning;
    border-color:  rgba(var(--warning-rgb),0.1);
    .alert-link {
        color: variables.$warning;
    }
    .btn-close {
        color: variables.$warning;
        &.custom-close {
            @include custom-close(variables.$warning);
        }
    }
}
.alert-primary {
    background-color: variables.$primary-01;
    color: variables.$primary;
    border-color:  variables.$primary-01;
    .alert-link {
        color: variables.$primary;
    }
    .btn-close {
        color: variables.$primary;
        &.custom-close {
            @include custom-close(variables.$primary);
        }
    }
}
.alert-secondary {
    background-color: rgba(var(--secondary-rgb),0.1);
    color: variables.$secondary;
    border-color:  rgba(var(--secondary-rgb),0.1);
    .alert-link {
        color: variables.$secondary;
    }
    .btn-close {
        color: variables.$secondary;
        &.custom-close {
            @include custom-close(variables.$secondary);
        }
    }
}
.alert-success {
    background-color: rgba(var(--success-rgb),0.1);
    color: variables.$success;
    border-color:  rgba(var(--success-rgb),0.1);
    .alert-link {
        color: variables.$success;
    }
    .btn-close {
        color: variables.$success;
        &.custom-close {
            @include custom-close(variables.$success);
        }
    }
}
.alert-info {
    background-color: rgba(var(--info-rgb),0.1);
    color: variables.$info;
    border-color:  rgba(var(--info-rgb),0.1);
    .alert-link {
        color: variables.$info;
    }
    .btn-close {
        color: variables.$info;
        &.custom-close {
            @include custom-close(variables.$info);
        }
    }
}
.alert-danger {
    background-color: rgba(var(--danger-rgb),0.1);
    color: variables.$danger;
    border-color:  rgba(var(--danger-rgb),0.1);
    .alert-link {
        color: variables.$danger;
    }
    .btn-close {
        color: variables.$danger;
        &.custom-close {
            @include custom-close(variables.$danger);
        }
    }
}
.alert-light {
    background-color: variables.$light;
    color: variables.$default-text-color;
    border-color:  variables.$light;
    .alert-link {
        color: variables.$default-text-color;
    }
    .btn-close {
        color: variables.$default-text-color;
        &.custom-close {
            @include custom-close(variables.$light);
        }
    }
}
.alert-dark {
    background-color: rgba(var(--dark-rgb),0.1);
    color: variables.$default-text-color;
    border-color:  rgba(var(--dark-rgb),0.1);
    .alert-link {
        color: variables.$default-text-color;
    }
    .btn-close {
        color: variables.$white;
        &.custom-close {
            @include custom-close(variables.$dark);
        }
    }
}
/* Basic Alerts */

/* Solid Colored Alerts */
@mixin alert-solid-color($color) {
    background-color: $color;
    color: variables.$white;
    border-color:  $color;
    .btn-close {
        color: variables.$white;
    }
}
.alert-solid-primary {
    @include alert-solid-color(variables.$primary);
}
.alert-solid-secondary {
    @include alert-solid-color(variables.$secondary);
}
.alert-solid-warning {
    @include alert-solid-color(variables.$warning);
}
.alert-solid-info {
    @include alert-solid-color(variables.$info);
}
.alert-solid-success {
    @include alert-solid-color(variables.$success);
}
.alert-solid-danger {
    @include alert-solid-color(variables.$danger);
}
.alert-solid-light {
    background-color: variables.$light;
    color: variables.$default-text-color;
    border-color:  variables.$default-border;
}
.alert-solid-dark {
    @include alert-solid-color(variables.$dark);
}
/* Solid Colored Alerts */

/* Outline Alerts */
@mixin outline-alert($color) {
    background-color: variables.$custom-white;
    color: $color;
    border-color: $color;
    .btn-close {
        color: $color;
    }
}
.alert-outline-primary {
    @include outline-alert(variables.$primary);
}
.alert-outline-secondary {
    @include outline-alert(variables.$secondary);
}
.alert-outline-info {
    @include outline-alert(variables.$info);
}
.alert-outline-warning {
    @include outline-alert(variables.$warning);
}
.alert-outline-success {
    @include outline-alert(variables.$success);
}
.alert-outline-danger {
    @include outline-alert(variables.$danger);
}
.alert-outline-light {
    background-color: variables.$custom-white;
    color: variables.$default-text-color;
    border-color: variables.$light;
}
.alert-outline-dark {
    @include outline-alert(variables.$dark);
}
/* Outline Alerts */

/* Customized Alerts */
@mixin custom-alert($color) {
    border-inline-start: 0.313rem solid $color !important;
    color: variables.$text-muted;
    background-color: variables.$custom-white;
    border: 1px solid variables.$default-border;
    font-size: 0.813rem;
    .btn-close {
        color: variables.$default-text-color;
    }
}
.alert-primary.custom-alert-icon {
    @include custom-alert(variables.$primary);
}
.alert-secondary.custom-alert-icon {
    @include custom-alert(variables.$secondary);
}
.alert-warning.custom-alert-icon {
    @include custom-alert(variables.$warning);
}
.alert-danger.custom-alert-icon {
    @include custom-alert(variables.$danger);
}
.alert-success.custom-alert-icon {
    @include custom-alert(variables.$success);
}
.alert-info.custom-alert-icon {
    @include custom-alert(variables.$info);
}
.alert-light.custom-alert-icon {
    @include custom-alert(variables.$light);
}
.alert-dark.custom-alert-icon {
    @include custom-alert(variables.$dark);
}
/* Customized Alerts */

/* Customized Alerts1 */
.custom-alert1 {
    margin-block-end: 0;
    background-color: variables.$custom-white;
    border: 0;
    padding: 1.25rem;
    color: variables.$default-text-color;
    p {
        margin-block-end: 2.5rem;
        color: variables.$text-muted;
        font-size: 0.8rem;
    }
    .custom-alert-icon {
        width: 3.125rem;
        height: 3.125rem;
        margin-bottom: 0.85rem;
    }
    .btn-close {
        padding: 0;
        margin-block-end: 1rem;
    }
    &.alert-primary {
        border-block-start: 0.313rem solid variables.$primary;
    }
    &.alert-secondary {
        border-block-start: 0.313rem solid variables.$secondary;
    }
    &.alert-warning {
        border-block-start: 0.313rem solid variables.$warning;
    }
    &.alert-danger {
        border-block-start: 0.313rem solid variables.$danger;
    }
}
/* Customized Alerts1 */

/* Image alerts */
.alert-img {
    display: flex;
    align-items: center;
    .avatar {
        border: 1px solid rgba(0,0,0,0.1);
    }
}
/* Image alerts */

@media screen and (max-width:400px) {
    .btn-close.custom-close {
        margin: 9px 9px 9px 0;
    }  
}