@mixin button($type: '') {
    display: inline-block;
    font-weight: 600;
    font-size: .9em;
    line-height: 1em;
    border-radius: .5rem;
    text-align: center;
    text-decoration: none;
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -ms-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    padding: 1rem;
    min-width: 10rem;
    color: var(--color-white);

    @if $type == 'success' {
        background-color: var(--color-success);
        border-top: 2px solid var(--color-success-light);
    } @else if $type == 'warning' {
        background-color: var(--color-warning);
        border-top: 2px solid var(--color-warning-light);
    } @else if $type == 'danger' {
        background-color: var(--color-danger);
        border-top: 2px solid var(--color-danger-light);
    } @else {
        font-weight: 700;
        color: var(--color-primary-dark);
        background-color: var(--color-white);
        box-shadow: var(--color-button-shadow);
    }

    &:hover {
        @if $type == 'success' {
            color: var(--color-success-dark) !important;
        } @else if $type == 'warning' {
            color: var(--color-warning-dark) !important;
        } @else if $type == 'danger' {
            color: var(--color-danger-dark) !important;
        } @else {
            color: var(--color-primary) !important;
        }
    }
}

@mixin link-style($type: '') {
    a {
        text-decoration: none;
        transition: .4s all;

        @if $type == 'light' {
            color: var(--color-white);
        } @else {
            color: var(--color-primary);
        }

        &:hover {
            @if $type == 'light' {
                color: var(--color-primary);
            } @else {
                color: var(--color-primary-dark);
            }
        }
    }
}

@mixin title {
    .title {
        width: 100%;
        display: flex;
        text-align: center;
        align-items: center;

        h1, h2, h3, span {
            margin: 0;
            font-weight: var(--font-weight);
            font-size: var(--font-size);
            line-height: var(--line-height);
    
            @media (max-width: $breakpoint-lg) {
                & {
                    font-size: var(--font-size-lg);
                    line-height: var(--line-height-lg);
                }
            }
    
            @media (max-width: $breakpoint-md) {
                & {
                    font-size: var(--font-size-md);
                    line-height: var(--line-height-md);
                }
            }
    
            @media (max-width: $breakpoint-sm) {
                & {
                    font-size: var(--font-size-sm);
                    line-height: var(--line-height-sm);
                }
            }
        }
    }
}

@mixin color-buttons {
    &.info {
        background-color: var(--color-primary-dark-light);
        border-top: 2px solid var(--color-primary);

        &:hover {
            background-color: var(--color-primary-dark);
        }
    }

    &.success {
        background-color: var(--color-success);
        border-top: 2px solid var(--color-success-light);

        &:hover {
            background-color: var(--color-success-dark);
        }
    }

    &.warning {
        background-color: var(--color-warning);
        border-top: 2px solid var(--color-warning-light);

        &:hover {
            background-color: var(--color-warning-dark);
        }
    }

    &.danger {
        background-color: var(--color-danger);
        border-top: 2px solid var(--color-danger-light);

        &:hover {
            background-color: var(--color-danger-dark);
        }
    }
}

@mixin heading {
    .heading {
        width: 100%;
        display: flex;
        text-align: center;
        align-items: center;

        h1, h2, h3, span {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            align-items: center;
            margin: 0;
            font-weight: var(--font-weight);
            font-size: var(--font-size);
            line-height: var(--line-height);
    
            @media (max-width: $breakpoint-lg) {
                & {
                    font-size: var(--font-size-lg);
                    line-height: var(--line-height-lg);
                }
            }
    
            @media (max-width: $breakpoint-md) {
                & {
                    font-size: var(--font-size-md);
                    line-height: var(--line-height-md);
                }
            }
    
            @media (max-width: $breakpoint-sm) {
                & {
                    font-size: var(--font-size-sm);
                    line-height: var(--line-height-sm);
                }
            }
        }
    }
}

@mixin message {
    .message {
        font-size: 1.2rem;
        text-align: center;
        padding: 1rem;
        color: var(--color-white);

        &.danger {
            background-color: var(--color-message-bg);
            border: 1px solid var(--color-message-border);
        }

        &.info {
            background-color: var(--color-primary);
            border: 1px solid var(--color-primary-dark);
        }
    }
}

@mixin buttons-links {
    a {
        padding: .8rem 1.5rem;
        color: var(--color-white);
        border-radius: .4rem;
        min-width: 10rem;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: .2s background-color ease-in-out, .2s color ease-in-out, .2s border-color ease-in-out, .2s opacity ease-in-out, .2s box-shadow ease-in-out;
        
        &.link-info {
            background-color: var(--color-primary);
            border-top: 3px solid var(--color-primary-dark-light);

            &:hover {
                color: var(--color-primary-dark);
                border-top-color: var(--color-primary-dark);
            }
        }

        &.link-success {
            border-top: 3px solid var(--color-success-light);
            background-color: var(--color-success);

            &:hover {
                color: var(--color-success-dark);
                border-top-color: var(--color-success-dark);
            }
        }
    
        &.link-warning {
            border-top: 3px solid var(--color-warning-light);
            background-color: var(--color-warning);

            &:hover {
                color: var(--color-warning-dark);
                border-top-color: var(--color-warning-dark);
            }
        }
    
        &.link-danger {
            border-top: 3px solid var(--color-danger-light);
            background-color: var(--color-danger);

            &:hover {
                color: var(--color-danger-dark);
                border-top-color: var(--color-danger-dark);
            }
        }
    
        &.link-default {
            color: var(--color-primary);
            border: 2px solid var(--color-primary);
            background-color: var(--color-gray);

            &:hover {
                color: var(--color-primary-dark-light);
                border-color: var(--color-primary-dark-light);
            }
        }
    
        &:last-of-type {
            @media (max-width: 350px) {
                & {
                    margin-top: 0;
                }
            }
        }
    }
}
