/**
 * Push Notification Banner - إشعار تفعيل الإشعارات
 * تصميم احترافي مع أنيميشن سحرية
 */

/* ================================
   الحاوية الرئيسية
================================ */
.push-notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.push-notification-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ================================
   البانر الرئيسي
================================ */
.push-notification-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    width: 95%;
    max-width: 500px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.98) 100%);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    z-index: 100000;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.push-notification-banner.active {
    transform: translateX(-50%) translateY(0);
}

/* Dark Mode */
[data-theme="dark"] .push-notification-banner,
.dark-mode .push-notification-banner {
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.98) 0%, 
        rgba(15, 23, 42, 0.98) 100%);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ================================
   شريط الجرادينت العلوي
================================ */
.push-notification-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        #6366f1 0%, 
        #8b5cf6 25%, 
        #ec4899 50%, 
        #f59e0b 75%, 
        #6366f1 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ================================
   المحتوى الداخلي
================================ */
.push-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    direction: rtl;
}

/* ================================
   الأيقونة / اللوجو
================================ */
.push-notification-icon {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 25px -5px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.push-notification-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 23px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    z-index: -1;
    opacity: 0.3;
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.1; }
}

.push-notification-icon img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
}

.push-notification-icon i {
    font-size: 2rem;
    color: white;
}

/* جرس متحرك */
.push-notification-icon .bell-icon {
    animation: bellRing 1s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(15deg); }
    20%, 40% { transform: rotate(-15deg); }
    50% { transform: rotate(0); }
}

/* ================================
   النصوص
================================ */
.push-notification-text {
    flex: 1;
}

.push-notification-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="dark"] .push-notification-title,
.dark-mode .push-notification-title {
    color: #f1f5f9;
}

.push-notification-title .highlight {
    color: #6366f1;
}

.push-notification-description {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0;
}

[data-theme="dark"] .push-notification-description,
.dark-mode .push-notification-description {
    color: #94a3b8;
}

/* ================================
   الأزرار
================================ */
.push-notification-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    justify-content: flex-start;
}

.push-notification-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-family: inherit;
}

/* زر التفعيل */
.push-notification-btn.allow {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 15px -3px rgba(99, 102, 241, 0.5);
    position: relative;
    overflow: hidden;
}

.push-notification-btn.allow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: 0.5s;
}

.push-notification-btn.allow:hover::before {
    left: 100%;
}

.push-notification-btn.allow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.6);
}

.push-notification-btn.allow:active {
    transform: translateY(0);
}

/* زر الإلغاء */
.push-notification-btn.cancel {
    background: transparent;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

[data-theme="dark"] .push-notification-btn.cancel,
.dark-mode .push-notification-btn.cancel {
    color: #94a3b8;
    border-color: #334155;
}

.push-notification-btn.cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

[data-theme="dark"] .push-notification-btn.cancel:hover,
.dark-mode .push-notification-btn.cancel:hover {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

/* ================================
   زر الإغلاق
================================ */
.push-notification-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #94a3b8;
}

.push-notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #64748b;
    transform: rotate(90deg);
}

[data-theme="dark"] .push-notification-close,
.dark-mode .push-notification-close {
    background: rgba(255, 255, 255, 0.05);
    color: #64748b;
}

[data-theme="dark"] .push-notification-close:hover,
.dark-mode .push-notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

/* ================================
   التأثيرات الزخرفية
================================ */
.push-notification-decoration {
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.1), 
        rgba(236, 72, 153, 0.1));
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.push-notification-decoration-2 {
    position: absolute;
    top: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.1), 
        rgba(99, 102, 241, 0.1));
    border-radius: 50%;
    filter: blur(30px);
    pointer-events: none;
}

/* ================================
   النقاط المتحركة
================================ */
.push-notification-dots {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    gap: 4px;
}

.push-notification-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e2e8f0;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.push-notification-dots span:nth-child(1) { animation-delay: -0.32s; }
.push-notification-dots span:nth-child(2) { animation-delay: -0.16s; }
.push-notification-dots span:nth-child(3) { animation-delay: 0; }

@keyframes dotBounce {
    0%, 80%, 100% { 
        transform: scale(0.8);
        background: #e2e8f0;
    }
    40% { 
        transform: scale(1.2);
        background: #6366f1;
    }
}

/* ================================
   التجاوب
================================ */
@media (max-width: 576px) {
    .push-notification-banner {
        top: 10px;
        width: 95%;
        border-radius: 20px;
    }
    
    .push-notification-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem;
    }
    
    .push-notification-icon {
        width: 60px;
        height: 60px;
    }
    
    .push-notification-icon i {
        font-size: 1.75rem;
    }
    
    .push-notification-title {
        font-size: 1rem;
        justify-content: center;
    }
    
    .push-notification-description {
        font-size: 0.85rem;
    }
    
    .push-notification-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .push-notification-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        padding: 0.65rem 1rem;
    }
}

/* ================================
   أنيميشن الدخول
================================ */
.push-notification-banner.animate-in .push-notification-icon {
    animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.push-notification-banner.animate-in .push-notification-title {
    animation: slideInRight 0.5s ease-out 0.3s both;
}

.push-notification-banner.animate-in .push-notification-description {
    animation: slideInRight 0.5s ease-out 0.4s both;
}

.push-notification-banner.animate-in .push-notification-actions {
    animation: slideInUp 0.5s ease-out 0.5s both;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
    from { 
        transform: translateX(30px); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes slideInUp {
    from { 
        transform: translateY(20px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

/* ================================
   حالة النجاح
================================ */
.push-notification-banner.success .push-notification-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.push-notification-banner.success .push-notification-icon::after {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.push-notification-banner.success .push-notification-btn.allow {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px -3px rgba(16, 185, 129, 0.5);
}

/* ================================
   إخفاء عند عدم دعم الإشعارات
================================ */
.push-notification-not-supported {
    display: none;
}
