/* Modern Notification System - Genius UI/UX Design */

/* Base notification popup styling */
.modern-notification-popup {
    border-radius: 16px !important;
    border: none !important;
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%) !important;
    box-shadow: 
        0 16px 32px rgba(0, 0, 0, 0.25),
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    overflow: hidden !important;
    position: relative;
    max-height: 70vh !important;
    width: 320px !important;
    max-width: 95vw !important;
}

/* Theme variations with stronger colors */
.modern-notification-popup.theme-success {
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border: 3px solid rgba(34, 197, 94, 0.5) !important;
}

.modern-notification-popup.theme-error {
    background: linear-gradient(145deg, #fef2f2 0%, #fecaca 100%) !important;
    border: 3px solid rgba(220, 38, 38, 0.6) !important;
}

.modern-notification-popup.theme-warning {
    background: linear-gradient(145deg, #fffbeb 0%, #fed7aa 100%) !important;
    border: 3px solid rgba(217, 119, 6, 0.6) !important;
}

.modern-notification-popup.theme-info {
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%) !important;
    border: 3px solid rgba(37, 99, 235, 0.5) !important;
}

/* Modern title container */
.modern-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid rgba(0, 0, 0, 0.12);
    margin: 0 !important;
}

.modern-notification-title {
    font-size: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Icon wrapper with modern styling */
.modern-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    overflow: hidden;
}

.modern-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.1));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
}

.icon-success {
    background: linear-gradient(145deg, #059669, #047857);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.5);
}

.icon-error {
    background: linear-gradient(145deg, #dc2626, #991b1b);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
}

.icon-warning {
    background: linear-gradient(145deg, #d97706, #b45309);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.5);
}

.icon-info {
    background: linear-gradient(145deg, #2563eb, #1e40af);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

/* Title text */
.modern-title-text {
    font-size: 16px;
    font-weight: 700;
    color: #000000 !important;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Modern notification content */
.modern-notification-content {
    padding: 0 !important;
    margin: 0 !important;
}

.modern-notification-body {
    padding: 12px 18px;
    direction: rtl;
    text-align: right;
}

/* Message styling */
.notification-message-modern {
    font-size: 14px;
    line-height: 1.4;
    color: #000000 !important;
    margin-bottom: 12px;
    white-space: pre-line;
    font-weight: 600;
}

.message-break {
    height: 8px;
}

/* Data section with modern cards - REMOVED to make notifications shorter */
.notification-data-section {
    display: none; /* Hide data section to make notifications more compact */
}

/* Footer section */
.notification-footer-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.timestamp-container {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #000000 !important;
    font-size: 12px;
    font-weight: 500;
}

.timestamp-icon {
    opacity: 0.8;
}

/* Modern badges with stronger colors */
.notification-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* SweetAlert2 Icon Overrides */
.swal2-icon {
    border: none !important;
    margin: 0 !important;
}

.swal2-icon.swal2-success {
    background: linear-gradient(145deg, #059669, #047857) !important;
    border: 3px solid #10b981 !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    position: relative !important;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4) !important;
}

.swal2-icon.swal2-error {
    background: linear-gradient(145deg, #dc2626, #b91c1c) !important;
    border: 3px solid #ef4444 !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    position: relative !important;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4) !important;
}

.swal2-icon.swal2-warning {
    background: linear-gradient(145deg, #d97706, #b45309) !important;
    border: 3px solid #f59e0b !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    position: relative !important;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4) !important;
}

.swal2-icon.swal2-info {
    background: linear-gradient(145deg, #2563eb, #1e40af) !important;
    border: 3px solid #3b82f6 !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    position: relative !important;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4) !important;
}

.notification-badge {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: linear-gradient(145deg, #16a34a, #15803d);
    color: white;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
}

.badge-error {
    background: linear-gradient(145deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.badge-warning {
    background: linear-gradient(145deg, #d97706, #c2410c);
    color: white;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.badge-info {
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Modern action buttons */
.modern-notification-actions {
    padding: 10px 18px 14px !important;
    gap: 8px !important;
    background: rgba(255, 255, 255, 0.6);
    border-top: 2px solid rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
}

.modern-btn {
    padding: 12px 24px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    letter-spacing: 0.025em !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

.modern-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modern-btn:hover::before {
    opacity: 1;
}

.modern-btn-primary {
    background: linear-gradient(145deg, #2563eb, #1d4ed8) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
}

.modern-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5) !important;
}

.modern-btn-secondary {
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0) !important;
    color: #000000 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.modern-btn-secondary:hover {
    background: linear-gradient(145deg, #e2e8f0, #cbd5e1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Particle effect for success notifications */
.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1000;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #22c55e, #16a34a);
    border-radius: 50%;
    animation: particle-float 3s ease-out forwards;
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0);
    }
    20% {
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

.particle:nth-child(odd) {
    animation-delay: 0.1s;
    left: 20%;
}

.particle:nth-child(even) {
    animation-delay: 0.3s;
    right: 20%;
}

/* Pulse effect for errors */
.notification-pulse {
    animation: notification-pulse 0.5s ease-in-out 3;
}

@keyframes notification-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    text-align: center;
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    color: #000000 !important;
    font-weight: 600;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Timer progress bar styling */
.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #06b6d4) !important;
    height: 3px !important;
}

/* RTL support */
.modern-notification-popup[dir="rtl"] .modern-title-container {
    direction: rtl;
}

.modern-notification-popup[dir="rtl"] .data-item {
    direction: rtl;
}

/* Responsive design */
@media (max-width: 640px) {
    .modern-notification-popup {
        width: 95% !important;
        margin: 0 auto !important;
    }
    
    .modern-title-container {
        padding: 12px 18px 8px;
    }
    
    .modern-notification-body {
        padding: 12px 18px;
    }
    
    .modern-notification-actions {
        padding: 10px 18px 14px !important;
        flex-direction: column;
    }
    
    .modern-btn {
        width: 100% !important;
    }
    
    .data-grid {
        gap: 6px;
    }
    
    .data-item {
        padding: 8px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modern-notification-popup {
        background: linear-gradient(145deg, #1f2937 0%, #111827 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .modern-title-container {
        background: rgba(0, 0, 0, 0.3);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .modern-title-text {
        color: #f9fafb;
    }
    
    .notification-message-modern {
        color: #d1d5db;
    }
    
    .notification-data-section {
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .data-item {
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .data-label {
        color: #9ca3af;
    }
    
    .data-value {
        color: #f3f4f6;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modern-notification-popup {
        border: 2px solid #000 !important;
    }
    
    .modern-btn {
        border: 1px solid #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .modern-notification-popup,
    .modern-btn,
    .data-item,
    .particle,
    .notification-pulse {
        animation: none !important;
        transition: none !important;
    }
}
