/* Flash Messages Styles */
.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
}

.flash-message {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    border-left: 4px solid #ddd;
    font-family: 'Arial', sans-serif;
}

.flash-message.show {
    transform: translateX(0);
    opacity: 1;
}

.flash-message.hide {
    transform: translateX(100%);
    opacity: 0;
}

.flash-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.flash-content i {
    font-size: 18px;
    flex-shrink: 0;
}

.flash-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.flash-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.flash-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
    transform: translateX(-100%);
}

/* Success - Green */
.flash-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    color: #065f46;
}

.flash-success .flash-content i {
    color: #10b981;
}

.flash-success .flash-progress {
    background: #10b981;
}

.flash-success .flash-close {
    color: #065f46;
}

/* Error - Red */
.flash-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fef2f2 100%);
    color: #991b1b;
}

.flash-error .flash-content i {
    color: #ef4444;
}

.flash-error .flash-progress {
    background: #ef4444;
}

.flash-error .flash-close {
    color: #991b1b;
}

/* Warning - Orange */
.flash-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fefce8 100%);
    color: #92400e;
}

.flash-warning .flash-content i {
    color: #f59e0b;
}

.flash-warning .flash-progress {
    background: #f59e0b;
}

.flash-warning .flash-close {
    color: #92400e;
}

/* Info - Blue */
.flash-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    color: #1e40af;
}

.flash-info .flash-content i {
    color: #3b82f6;
}

.flash-info .flash-progress {
    background: #3b82f6;
}

.flash-info .flash-close {
    color: #1e40af;
}

/* Animation cho thanh progress */
@keyframes progress {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .flash-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .flash-message {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .flash-content i {
        font-size: 16px;
    }
}

/* Smooth hover effects */
.flash-message:hover .flash-progress {
    animation-play-state: paused;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .flash-success {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
        color: #a7f3d0;
    }
    
    .flash-error {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
        color: #fecaca;
    }
    
    .flash-warning {
        background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
        color: #fed7aa;
    }
    
    .flash-info {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        color: #bfdbfe;
    }
}
