/**
 * تنسيقات نظام الإشعارات الموحد (Toast Notifications)
 */

.toast-container {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-right: 4px solid;
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

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

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

/* أنواع الإشعارات */

/* نجاح */
.toast-success {
    border-right-color: #28a745;
}

.toast-success .toast-icon {
    color: #28a745;
}

/* خطأ */
.toast-error {
    border-right-color: #dc3545;
}

.toast-error .toast-icon {
    color: #dc3545;
}

/* تحذير */
.toast-warning {
    border-right-color: #ffc107;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

/* معلومات */
.toast-info {
    border-right-color: #17a2b8;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

/* تجاوب للشاشات الصغيرة */
@media (max-width: 768px) {
    .toast-container {
        top: 70px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .toast {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 1rem;
    }
    
    .toast-message {
        font-size: 0.85rem;
    }
}

/* أنيميشن إضافي */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Progress Bar للإشعارات ذات المدة المحددة */
.toast.with-progress::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: progress linear;
}

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

/* Dark Mode Support - يتم التطبيق فقط عند إضافة class="dark-mode" للـ body */
body.dark-mode .toast {
    background: #2d2d2d !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .toast-message {
    color: #e0e0e0 !important;
}

body.dark-mode .toast-close {
    color: #999 !important;
}

body.dark-mode .toast-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ccc !important;
}

