/* Animations */
@keyframes flashProgressLeftToRight {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-20px);
        opacity: 0;
    }
}

/* Container */
.flash-messages-container {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10000;
    max-width: 400px;
}

/* Message */
.flash-message {
    position: relative;
    margin-bottom: 10px;
    transform: translateX(100%);
    opacity: 0;
    overflow: hidden;
    animation: slideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;

    border-radius: var(--borderRadius);
    box-shadow: var(--boxShadow);
    transition: all 0.3s ease;
    background: var(--graphiteColor);
    color: var(--whiteColor);
}

.flash-message.removing {
    animation: slideOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.flash-message:hover .flash-close-btn {
    opacity: 1;
}

/* Progress Bar */
.flash-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 5px;
    width: 100%;
    transform-origin: left;
}

.flash-success .flash-progress-bar {
    background: var(--greenColor);
}

.flash-warning .flash-progress-bar {
    background: var(--yellowColor);
}

.flash-error .flash-progress-bar {
    background: var(--redColor);
}

.flash-info .flash-progress-bar {
    background: var(--blue);
}

/* Content */
.flash-content {
    padding: 16px;
    padding-right: 40px;
    border-radius: 8px;
    color: white;
    min-width: 300px;
    cursor: pointer;
    position: relative;
    transition:
        opacity 0.2s ease,
        background-color 0.2s ease;
}

/* Close Button */
.flash-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition:
        opacity 0.2s,
        background-color 0.2s;
    z-index: 1;
}

.flash-close-btn:hover {
    opacity: 1;
    background-color: var(--flashmessage_bg_close_button);
}

/* Countdown */
.flash-countdown {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.8;
    font-weight: bold;
}
/* ---------------------------------------------------------------------- */
/*  flash-loading com efeito skeleton shimmer (barra embaixo)             */
/* ---------------------------------------------------------------------- */
.flash-message.flash-loading {
    position: relative;
    overflow: hidden;
}

.flash-message.flash-loading .flash-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    overflow: hidden;
    background: transparent !important;
    z-index: 10;
}

.flash-message.flash-loading .flash-progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        var(--yellowColor) 25%,
        var(--yellowColor-2) 50%,
        var(--yellowColor) 75%
    ) !important;
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}
