/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    position: relative;
    min-width: 300px;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 6px;
    color: rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 0 0 16px 16px;
    animation: progress linear;
    transform-origin: left;
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success .toast-progress {
    background: linear-gradient(90deg, #28a745, #1e7e34);
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error .toast-progress {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-warning .toast-progress {
    background: linear-gradient(90deg, #ffc107, #e0a800);
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info .toast-progress {
    background: linear-gradient(90deg, #17a2b8, #138496);
}

.toast-loading {
    border-left: 4px solid #6c757d;
}

.toast-loading .toast-progress {
    background: linear-gradient(90deg, #6c757d, #5a6268);
    animation: progress-pulse 2s ease-in-out infinite;
}

/* Animations */
@keyframes progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@keyframes progress-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* RTL Support */
[dir="rtl"] .toast-container {
    right: auto;
    left: 20px;
}

[dir="rtl"] .toast {
    transform: translateX(-100%);
}

[dir="rtl"] .toast.show {
    transform: translateX(0);
}

[dir="rtl"] .toast.hide {
    transform: translateX(-100%);
}

[dir="rtl"] .toast-progress {
    transform-origin: right;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    .toast-content {
        padding: 14px 16px;
    }
    
    .toast-message {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .toast-content {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .toast-icon {
        font-size: 18px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .toast-message {
        color: #fff;
    }
    
    .toast-close {
        color: rgba(255, 255, 255, 0.5);
    }
    
    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
    }
}
