/* Advanced Notification System Styles */

/* قاعدة عامة لمنع تداخل الألوان من مصادر أخرى */
.notification * {
    box-sizing: border-box;
}

.notification i,
.notification .fa,
.notification .fas,
.notification .far,
.notification .fab {
    color: inherit !important;
}

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    margin-bottom: 12px;
    pointer-events: auto;
    transform: translateX(100%) scale(0.85);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(25px) saturate(180%);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: floatIn 0.8s ease-out;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 3s infinite ease-in-out;
}

.notification::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
}

@keyframes floatIn {
    0% {
        transform: translateX(100%) translateY(-20px) scale(0.8) rotate(5deg);
        opacity: 0;
    }
    50% {
        transform: translateX(-10px) translateY(5px) scale(1.02) rotate(-1deg);
        opacity: 0.8;
    }
    100% {
        transform: translateX(0) translateY(0) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-200%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(200%);
        opacity: 0;
    }
}

.notification-show {
    transform: translateX(0) scale(1) rotate(0deg);
    opacity: 1;
    animation: gentleBounce 0.6s ease-out;
}

.notification-hide {
    transform: translateX(100%) scale(0.9) rotate(2deg);
    opacity: 0;
    transition: all 0.4s ease-in;
}

@keyframes gentleBounce {
    0% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
    20% {
        transform: translateX(-5px) scale(1.02) rotate(-0.5deg);
    }
    40% {
        transform: translateX(2px) scale(0.98) rotate(0.2deg);
    }
    60% {
        transform: translateX(-1px) scale(1.01) rotate(-0.1deg);
    }
    100% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
}

/* Notification Types - Glass Effect with Soft Colors */
.notification-error {
    background: linear-gradient(
        135deg,
        rgba(239, 68, 68, 0.15) 0%,
        rgba(220, 38, 38, 0.12) 50%,
        rgba(185, 28, 28, 0.08) 100%
    );
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-left: 3px solid rgba(239, 68, 68, 0.6);
    box-shadow:
        0 8px 32px rgba(239, 68, 68, 0.15),
        0 2px 8px rgba(220, 38, 38, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.notification-warning {
    background: linear-gradient(
        135deg,
        rgba(245, 158, 11, 0.15) 0%,
        rgba(217, 119, 6, 0.12) 50%,
        rgba(180, 83, 9, 0.08) 100%
    );
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 3px solid rgba(245, 158, 11, 0.6);
    box-shadow:
        0 8px 32px rgba(245, 158, 11, 0.15),
        0 2px 8px rgba(217, 119, 6, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.notification-notice {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.15) 0%,
        rgba(37, 99, 235, 0.12) 50%,
        rgba(29, 78, 216, 0.08) 100%
    );
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-left: 3px solid rgba(59, 130, 246, 0.6);
    box-shadow:
        0 8px 32px rgba(59, 130, 246, 0.15),
        0 2px 8px rgba(37, 99, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.notification-alert {
    background: linear-gradient(
        135deg,
        rgba(249, 115, 22, 0.15) 0%,
        rgba(234, 88, 12, 0.12) 50%,
        rgba(194, 65, 12, 0.08) 100%
    );
    border: 1px solid rgba(249, 115, 22, 0.25);
    border-left: 3px solid rgba(249, 115, 22, 0.6);
    box-shadow:
        0 8px 32px rgba(249, 115, 22, 0.15),
        0 2px 8px rgba(234, 88, 12, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.notification-success {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.15) 0%,
        rgba(22, 163, 74, 0.12) 50%,
        rgba(21, 128, 61, 0.08) 100%
    );
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-left: 3px solid rgba(34, 197, 94, 0.6);
    box-shadow:
        0 8px 32px rgba(34, 197, 94, 0.15),
        0 2px 8px rgba(22, 163, 74, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 18px;
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 1;
}

.notification-icon {
    margin-right: 14px;
    margin-top: 2px;
    font-size: 22px;
    opacity: 0.9;
    animation: iconFloat 0.8s ease-out;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* إصلاح ألوان الأيقونات لكل نوع */
.notification-error .notification-icon {
    color: #ef4444 !important; /* أحمر للخطأ */
}

.notification-warning .notification-icon {
    color: #f59e0b !important; /* أصفر برتقالي للتحذير */
}

.notification-notice .notification-icon {
    color: #3b82f6 !important; /* أزرق للإشعار */
}

.notification-alert .notification-icon {
    color: #f97316 !important; /* برتقالي للتنبيه */
}

.notification-success .notification-icon {
    color: #22c55e !important; /* أخضر للنجاح */
}

@keyframes iconFloat {
    0% {
        transform: scale(0.6) translateY(10px) rotate(-10deg);
        opacity: 0;
    }
    30% {
        transform: scale(1.1) translateY(-3px) rotate(5deg);
        opacity: 0.7;
    }
    60% {
        transform: scale(0.95) translateY(1px) rotate(-2deg);
        opacity: 0.9;
    }
    100% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 0.9;
    }
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    animation: titleSlide 0.6s ease-out 0.2s both;
}

/* ألوان العناوين المحددة لكل نوع */
.notification-error .notification-title {
    color: #fecaca !important; /* أحمر فاتح للخطأ */
}

.notification-warning .notification-title {
    color: #fde68a !important; /* أصفر فاتح للتحذير */
}

.notification-notice .notification-title {
    color: #bfdbfe !important; /* أزرق فاتح للإشعار */
}

.notification-alert .notification-title {
    color: #fed7aa !important; /* برتقالي فاتح للتنبيه */
}

.notification-success .notification-title {
    color: #bbf7d0 !important; /* أخضر فاتح للنجاح */
}

.notification-message {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    animation: messageSlide 0.6s ease-out 0.4s both;
}

@keyframes titleSlide {
    0% {
        transform: translateX(20px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes messageSlide {
    0% {
        transform: translateX(30px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 6px;
    margin-left: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0.7;
    backdrop-filter: blur(10px);
    animation: closeButtonSlide 0.6s ease-out 0.6s both;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes closeButtonSlide {
    0% {
        transform: translateX(20px) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 0.7;
    }
}

.notification-progress {
    height: 4px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.1)
    );
    overflow: hidden;
    position: relative;
}

.notification-progress-bar {
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.6) 100%
    );
    animation: progress linear;
    transform-origin: left;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    position: relative;
}

/* ألوان شريط التقدم لكل نوع */
.notification-success .notification-progress-bar {
    background: linear-gradient(
        90deg,
        rgba(34, 197, 94, 0.6) 0%,
        rgba(34, 197, 94, 0.9) 50%,
        rgba(34, 197, 94, 0.6) 100%
    ) !important;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4) !important;
}

.notification-error .notification-progress-bar {
    background: linear-gradient(
        90deg,
        rgba(239, 68, 68, 0.6) 0%,
        rgba(239, 68, 68, 0.9) 50%,
        rgba(239, 68, 68, 0.6) 100%
    ) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
}

.notification-warning .notification-progress-bar {
    background: linear-gradient(
        90deg,
        rgba(245, 158, 11, 0.6) 0%,
        rgba(245, 158, 11, 0.9) 50%,
        rgba(245, 158, 11, 0.6) 100%
    ) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4) !important;
}

.notification-notice .notification-progress-bar {
    background: linear-gradient(
        90deg,
        rgba(59, 130, 246, 0.6) 0%,
        rgba(59, 130, 246, 0.9) 50%,
        rgba(59, 130, 246, 0.6) 100%
    ) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4) !important;
}

.notification-alert .notification-progress-bar {
    background: linear-gradient(
        90deg,
        rgba(249, 115, 22, 0.6) 0%,
        rgba(249, 115, 22, 0.9) 50%,
        rgba(249, 115, 22, 0.6) 100%
    ) !important;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4) !important;
}

.notification-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

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

/* RTL Support */
[dir="rtl"] .notification-container {
    right: auto;
    left: 20px;
}

[dir="rtl"] .notification {
    transform: translateX(-100%) scale(0.85);
}

[dir="rtl"] .notification-show {
    transform: translateX(0) scale(1) rotate(0deg);
    animation: gentleBounceRTL 0.6s ease-out;
}

[dir="rtl"] .notification-hide {
    transform: translateX(-100%) scale(0.9) rotate(-2deg);
}

[dir="rtl"] .notification-icon {
    margin-right: 0;
    margin-left: 14px;
}

[dir="rtl"] .notification-close {
    margin-left: 0;
    margin-right: 10px;
}

@keyframes gentleBounceRTL {
    0% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
    20% {
        transform: translateX(5px) scale(1.02) rotate(0.5deg);
    }
    40% {
        transform: translateX(-2px) scale(0.98) rotate(-0.2deg);
    }
    60% {
        transform: translateX(1px) scale(1.01) rotate(0.1deg);
    }
    100% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .notification-container {
        top: 15px;
        right: 15px;
        left: 15px;
        max-width: none;
    }

    .notification {
        margin-bottom: 10px;
        border-radius: 14px;
    }

    .notification-content {
        padding: 16px;
    }

    .notification-icon {
        font-size: 20px;
        margin-right: 12px;
    }

    [dir="rtl"] .notification-icon {
        margin-left: 12px;
        margin-right: 0;
    }

    .notification-title {
        font-size: 13px;
        letter-spacing: 0.6px;
    }

    .notification-message {
        font-size: 12px;
        line-height: 1.4;
    }

    .notification-close {
        padding: 5px;
        margin-left: 8px;
    }

    [dir="rtl"] .notification-close {
        margin-right: 8px;
        margin-left: 0;
    }
}

/* Extra subtle glow effect on hover */
.notification:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Breathing animation for active notifications */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.005);
        opacity: 0.98;
    }
}

.notification-show {
    animation: floatIn 0.8s ease-out, breathe 4s infinite ease-in-out 2s;
}

/* Color distinctions for notification types */

/* Desktop Icons */
.notification-btn-desktop.notifications svg {
    color: #ff4757; /* Red for notifications */
}

.notification-btn-desktop.admin-messages svg {
    color: #007bff; /* Blue for admin messages */
}

.notification-btn-desktop.charges svg {
    color: #2ed573; /* Green for charges */
}

/* Desktop Dropdown Headers */
.notification-dropdown-desktop.notifications .notification-header-desktop {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1), rgba(255, 71, 87, 0.05));
    border-bottom: 1px solid rgba(255, 71, 87, 0.2);
}

.notification-dropdown-desktop.admin-messages .notification-header-desktop {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
    border-bottom: 1px solid rgba(0, 123, 255, 0.2);
}

.notification-dropdown-desktop.charges .notification-header-desktop {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.1), rgba(46, 213, 115, 0.05));
    border-bottom: 1px solid rgba(46, 213, 115, 0.2);
}

/* Desktop Dropdown Lists (Inside Boxes) */
.notification-dropdown-desktop.notifications .notification-list-desktop {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.05), rgba(255, 71, 87, 0.02));
}

.notification-dropdown-desktop.admin-messages .notification-list-desktop {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05), rgba(0, 123, 255, 0.02));
}

.notification-dropdown-desktop.charges .notification-list-desktop {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.05), rgba(46, 213, 115, 0.02));
}

/* Tablet Icons */
.notification-btn-tablet.notifications svg {
    color: #ff4757; /* Red for notifications */
}

.notification-btn-tablet.admin-messages svg {
    color: #007bff; /* Blue for admin messages */
}

.notification-btn-tablet.charges svg {
    color: #2ed573; /* Green for charges */
}

/* Tablet Dropdown Headers */
.notification-dropdown-tablet.notifications .notification-header-tablet {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1), rgba(255, 71, 87, 0.05));
    border-bottom: 1px solid rgba(255, 71, 87, 0.2);
}

.notification-dropdown-tablet.admin-messages .notification-header-tablet {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
    border-bottom: 1px solid rgba(0, 123, 255, 0.2);
}

.notification-dropdown-tablet.charges .notification-header-tablet {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.1), rgba(46, 213, 115, 0.05));
    border-bottom: 1px solid rgba(46, 213, 115, 0.2);
}

/* Tablet Dropdown Lists (Inside Boxes) */
.notification-dropdown-tablet.notifications .notification-list-tablet {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.05), rgba(255, 71, 87, 0.02));
}

.notification-dropdown-tablet.admin-messages .notification-list-tablet {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05), rgba(0, 123, 255, 0.02));
}

.notification-dropdown-tablet.charges .notification-list-tablet {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.05), rgba(46, 213, 115, 0.02));
}

/* Mobile Icons */
.mobile-header-notification-btn.notifications svg {
    color: #ff4757; /* Red for notifications */
}

.mobile-header-notification-btn.admin-messages svg {
    color: #007bff; /* Blue for admin messages */
}

.mobile-header-notification-btn.charges svg {
    color: #2ed573; /* Green for charges */
}

/* Mobile Dropdown Headers */
.mobile-header-notification-dropdown.notifications .mobile-header-notification-header {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1), rgba(255, 71, 87, 0.05));
    border-bottom: 1px solid rgba(255, 71, 87, 0.2);
}

.mobile-header-notification-dropdown.admin-messages .mobile-header-notification-header {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
    border-bottom: 1px solid rgba(0, 123, 255, 0.2);
}

.mobile-header-notification-dropdown.charges .mobile-header-notification-header {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.1), rgba(46, 213, 115, 0.05));
    border-bottom: 1px solid rgba(46, 213, 115, 0.2);
}

/* Mobile Dropdown Lists (Inside Boxes) */
.mobile-header-notification-dropdown.notifications .mobile-header-notification-list {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.05), rgba(255, 71, 87, 0.02));
}

.mobile-header-notification-dropdown.admin-messages .mobile-header-notification-list {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05), rgba(0, 123, 255, 0.02));
}

.mobile-header-notification-dropdown.charges .mobile-header-notification-list {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.05), rgba(46, 213, 115, 0.02));
}

/* Styles for unread notification items in dropdowns */
.notification-item-desktop.unread,
.notification-item-tablet.unread,
.mobile-header-notification-item.unread {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    border-left: 3px solid #ffa500;
    animation: pulse 2s infinite;
    position: relative;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 165, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 165, 0, 0);
    }
}

.notification-unread-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}
