.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.flash {
    background: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateX(400px);
    animation:
        slideIn 0.4s ease-out forwards,
        stayStill 3s ease forwards 0.4s,
        fadeOut 0.4s ease-in forwards 3.4s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash.success { 
    background: linear-gradient(135deg, #10b981, #059669);
}

.flash.error,
.flash.danger { 
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.flash.warning { 
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.flash.info { 
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.flash::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.flash.success::before {
    content: '✓';
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.flash.error::before,
.flash.danger::before {
    content: '✕';
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.flash.warning::before {
    content: '⚠';
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.flash.info::before {
    content: 'ℹ';
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes stayStill {
    from {
        opacity: 1;
        box-shadow: 0px 4px 12px rgba(0,0,0,0.4);
        transform: translateX(0);
    }
    to {
        opacity: 1;
        box-shadow: 0px 4px 12px rgba(0,0,0,0.4);
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { 
        opacity: 0; 
        transform: translateX(400px);
    }
}

/* Hide flash messages on AJAX pages */
body.ajax-page .flash-container {
    display: none !important;
}

@media (max-width: 768px) {
    .flash-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .flash {
        padding: 12px 16px;
        font-size: 13px;
    }
}