/* --- Flash Messages UI --- */

.flash-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 9999;
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background-color: white;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden; /* Keeps the progress bar contained */
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.alert.fade-out {
    opacity: 0;
    transform: translateX(30px);
}

.alert-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 2px;
}

.alert-text {
    flex-grow: 1;
    font-weight: 500;
    font-size: 14px;
    margin-left: 12px;
    color: #374151;
    line-height: 1.5;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #1f2937;
}

/* Variant Colors */
.alert-success .alert-icon { color: #10b981; }
.alert-error .alert-icon { color: #ef4444; }
.alert-info .alert-icon { color: #3b82f6; }

/* The Progress Bar */
.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: currentColor;
    opacity: 0.2;
    width: 100%;
    animation: progress-shrink 5s linear forwards;
}

.alert-success .alert-progress { color: #10b981; }
.alert-error .alert-progress { color: #ef4444; }
.alert-info .alert-progress { color: #3b82f6; }

/* Pause the animation if the user hovers over the alert */
.alert:hover .alert-progress {
    animation-play-state: paused;
}

@keyframes progress-shrink {
    100% { width: 0; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}