/**
 * Toast Notifications - إشعارات منبثقة أنيقة
 * منصة يونيميديا للإنتاج الإعلامي
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 90%;
}

[dir="rtl"] .toast-container {
    left: 50%;
    right: auto;
}

/* Toast Base */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    animation: toastSlideIn 0.4s ease-out;
    min-width: 300px;
    max-width: 500px;
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* Toast Types */
.toast-success {
    border-right: 4px solid #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.toast-success .toast-icon {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.toast-error {
    border-right: 4px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.toast-error .toast-icon {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.toast-warning {
    border-right: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.toast-warning .toast-icon {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.toast-info {
    border-right: 4px solid #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.toast-info .toast-icon {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* RTL Support */
[dir="rtl"] .toast {
    border-right: none;
}

[dir="rtl"] .toast-success {
    border-left: 4px solid #10b981;
}

[dir="rtl"] .toast-error {
    border-left: 4px solid #ef4444;
}

[dir="rtl"] .toast-warning {
    border-left: 4px solid #f59e0b;
}

[dir="rtl"] .toast-info {
    border-left: 4px solid #3b82f6;
}

/* Toast Icon */
.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Toast Content */
.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    animation: toastProgress var(--toast-duration, 5s) linear forwards;
}

/* Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .toast-container {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}