/**
 * أنماط نظام الإشعارات
 */

/* تأثير النبض للـ Badge */
@keyframes pulse {
    0% {
        transform: scale(1) translate(50%, -50%);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.1) translate(50%, -50%);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        transform: scale(1) translate(50%, -50%);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

#notification-badge.pulse {
    animation: pulse 1s ease-in-out;
}

/* تحسين مظهر Badge */
#notification-badge {
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* تحسين مظهر القائمة المنسدلة */
#notification-dropdown {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

/* تحسين مظهر عناصر الإشعارات */
.notification-item {
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fff;
    border: 1px solid #f1f1f4;
    margin-bottom: 10px;
}

.notification-item:hover {
    background: #f8f9fa;
    border-color: #e4e6ef;
    transform: translateX(-5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.notification-item:last-child {
    margin-bottom: 0;
}

/* رابط الإشعار */
.notification-link {
    text-decoration: none;
    color: inherit;
}

.notification-link:hover {
    text-decoration: none;
}

/* زر تحديد كمقروء */
.mark-read-btn {
    opacity: 0.6;
    transition: all 0.3s ease;
}

.mark-read-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Scrollbar للقائمة */
#notification-list::-webkit-scrollbar {
    width: 6px;
}

#notification-list::-webkit-scrollbar-track {
    background: #f1f1f4;
    border-radius: 10px;
}

#notification-list::-webkit-scrollbar-thumb {
    background: #b5b5c3;
    border-radius: 10px;
}

#notification-list::-webkit-scrollbar-thumb:hover {
    background: #7e8299;
}

/* تحسين رموز الأولوية */
.symbol-label {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* تأثير عند فتح القائمة */
#notification-dropdown.show {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    #notification-dropdown {
        width: 300px !important;
    }

    .notification-item {
        padding: 10px;
    }
}

/* حالة فارغة */
.notification-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #a1a5b7;
}

.notification-empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ========================================================
   Modern Compact Real-Time Floating Toasts (الاشعارات اللحظية)
   ======================================================== */
/* ========================================================
   Modern Compact Real-Time Floating Toasts (الاشعارات اللحظية)
   ======================================================== */
#toast-container {
    position: fixed !important;
    top: 18px !important;
    left: 18px !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    width: 300px !important;
    max-width: calc(100vw - 36px) !important;
    pointer-events: none !important; /* Container does not block clicks underneath */
}

/* Toast Card */
.modern-toast {
    position: relative !important;
    display: flex !important;
    align-items: flex-start !important;
    padding: 8px 10px 10px 10px !important;
    border-radius: 10px !important;
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), 0 3px 6px -2px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    direction: rtl !important;
    text-align: right !important;
    user-select: none !important;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.25s ease, 
                filter 0.2s ease,
                box-shadow 0.2s ease !important;
}

.modern-toast.toast-shown {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* Hover Dismiss Animation: Vanishes quickly with smooth animation */
.modern-toast.toast-hover-dismiss {
    opacity: 0 !important;
    transform: translateX(-35px) scale(0.88) !important;
    filter: blur(6px) !important;
    pointer-events: none !important;
    transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1), 
                opacity 0.2s ease-out, 
                filter 0.2s ease-out !important;
}

/* Priority Accent Indicator */
.modern-toast::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.modern-toast.priority-primary::before {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}
.modern-toast.priority-danger::before {
    background: linear-gradient(180deg, #ef4444, #f43f5e);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.modern-toast.priority-warning::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}
.modern-toast.priority-success::before {
    background: linear-gradient(180deg, #10b981, #059669);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Toast Icon Badge */
.modern-toast-icon {
    flex-shrink: 0 !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 7px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 8px !important;
    margin-top: 1px !important;
    font-size: 10.5px !important;
}

.priority-primary .modern-toast-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}
.priority-danger .modern-toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.priority-warning .modern-toast-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.priority-success .modern-toast-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Toast Body */
.modern-toast-content {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Header Row: Title + Close Button */
.modern-toast-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 2px !important;
    line-height: 1 !important;
}

.modern-toast-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: -0.1px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Close Button */
.modern-toast-close {
    flex-shrink: 0 !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.35) !important;
    padding: 0 4px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    transition: all 0.15s ease !important;
}

.modern-toast-close:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Message */
.modern-toast-msg {
    font-size: 9.5px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    line-height: 1.4 !important;
    direction: rtl !important;
    unicode-bidi: plaintext !important;
    word-break: break-word !important;
}

/* Footer: User + Time */
.modern-toast-footer {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin-top: 4px !important;
    font-size: 8.5px !important;
    color: rgba(255, 255, 255, 0.45) !important;
    line-height: 1.2 !important;
}

.modern-toast-user {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 8.5px !important;
    font-weight: 500 !important;
    max-width: 120px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.modern-toast-user i {
    font-size: 8px !important;
    opacity: 0.75 !important;
}

.modern-toast-sep {
    opacity: 0.35 !important;
    font-size: 7.5px !important;
}

.modern-toast-time {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    color: rgba(255, 255, 255, 0.45) !important;
    font-size: 8.5px !important;
    white-space: nowrap !important;
}

.modern-toast-time i {
    font-size: 7.5px !important;
    opacity: 0.65 !important;
}

/* Slim Progress Bar */
.modern-toast-progress {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 1.5px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    overflow: hidden !important;
}

.modern-toast-progress-bar {
    height: 100% !important;
    width: 100% !important;
    transform-origin: right !important;
    animation: modernToastProgress 5s linear forwards !important;
}

.priority-primary .modern-toast-progress-bar { background: #818cf8 !important; }
.priority-danger .modern-toast-progress-bar { background: #f87171 !important; }
.priority-warning .modern-toast-progress-bar { background: #fbbf24 !important; }
.priority-success .modern-toast-progress-bar { background: #34d399 !important; }

@keyframes modernToastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 576px) {
    #toast-container {
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
    }
}
