.flash-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(100%);
    animation: slideInFlash 0.4s ease-out forwards, slideOutFlash 0.4s ease-out 14.6s forwards;
    overflow: hidden;
}

.flash-message.flash-success {
    background: linear-gradient(135deg, rgba(166, 227, 161, 0.9) 0%, rgba(148, 226, 213, 0.9) 100%);
    border-left: 4px solid #a6e3a1;
}

.flash-message.flash-error {
    background: linear-gradient(135deg, rgba(243, 139, 168, 0.9) 0%, rgba(235, 160, 172, 0.9) 100%);
    border-left: 4px solid #f38ba8;
}

.flash-message.flash-info,
.flash-message:not(.flash-success):not(.flash-error) {
    background: linear-gradient(135deg, rgba(137, 180, 250, 0.9) 0%, rgba(203, 166, 247, 0.9) 100%);
    border-left: 4px solid #89b4fa;
}

.flash-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    position: relative;
}

.flash-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.flash-text {
    flex: 1;
    color: #1e1e2e;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

.flash-close {
    background: none;
    border: none;
    color: #1e1e2e;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flash-close:hover {
    background-color: rgba(30, 30, 46, 0.2);
}

.flash-message::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(30, 30, 46, 0.3);
    animation: flashProgress 15s linear;
}

.flash-message.flash-success::before {
    background: #a6e3a1;
}

.flash-message.flash-error::before {
    background: #f38ba8;
}

.flash-message.flash-info::before,
.flash-message:not(.flash-success):not(.flash-error)::before {
    background: #89b4fa;
}

/* Animations */
@keyframes slideInFlash {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes flashProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Multiple flash messages stacking */
.flash-message:nth-child(1) { top: 20px; }
.flash-message:nth-child(2) { top: 100px; }
.flash-message:nth-child(3) { top: 180px; }
.flash-message:nth-child(4) { top: 260px; }
.flash-message:nth-child(5) { top: 340px; }

@media (max-width: 768px) {
    .flash-message {
        right: 15px;
        left: 15px;
        min-width: auto;
        max-width: none;
    }

    .flash-content {
        padding: 14px 16px;
    }

    .flash-text {
        font-size: 13px;
    }
}
