/*!* Notifications *!*/
/*.notifications-popup {*/
/*    position: absolute;*/
/*    top: 5rem;*/
/*    right: 1rem;*/
/*    width: 22rem;*/
/*    background: white;*/
/*    border-radius: 0.75rem;*/
/*    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);*/
/*    padding: 0.5rem;*/
/*    !*display: none;*!*/
/*    z-index: 1001;*/
/*}*/

/*.notifications-popup h4 {*/
/*    font-size: 1.2rem;*/
/*    font-weight: 600;*/
/*    margin: 0;*/
/*}*/

/*.notifications-popup .notification-header {*/
/*    padding: .5rem .8rem;*/
/*}*/

/*.notifications-popup .notification-item {*/
/*    cursor: pointer;*/
/*    padding: .5rem .8rem;*/
/*    border-radius: 0.5rem;*/
/*}*/

/*.notifications-popup .notification-item:hover {*/
/*    background-color: #f8f9fa;*/
/*}*/

/*.notifications-popup .notification-item .notification-item-title {*/
/*    font-size: .9rem;*/
/*    font-weight: 600;*/
/*    margin-bottom: 0.2rem;*/
/*}*/

/*.notifications-popup .notification-item .notification-item-caption{*/
/*    font-size: .8rem;*/
/*    color: #6e6e73;*/
/*}*/

/*.notification-critical {*/
/*    background: #ffeaea;*/
/*}*/

/* High Performance Notifications CSS */

/* Use will-change for elements that will animate */
.notifications-popup,
.notification-badge,
.notification-btn {
    will-change: transform, opacity;
}

/* GPU acceleration for better performance */
.notifications-popup {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* Notification Container */
.notification-container {
    position: relative;
}

/* Notification Button - Optimized */
.notification-btn {
    position: relative;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.5rem;

    /* Optimize transitions */
    transition: background-color 0.15s ease-out;
}

.notification-btn:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.08);
}

.notification-btn.active {
    background-color: rgba(0, 0, 0, 0.12);
}

.notification-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Notification Icon */
.notification-icon {
    font-size: 1.2rem;
    transition: transform 0.15s ease-out;
}

.notification-btn:hover .notification-icon:not(.loading) {
    transform: scale(1.1);
}

/* Badge - Optimized animations */
.notification-badge {
    position: absolute;
    top: 0.1rem;
    right: 0.1rem;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 1.2rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;

    /* Optimized animation */
    animation: badgePulse 2s ease-in-out infinite;
    transform: translate3d(0, 0, 0);
}

@keyframes badgePulse {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, 0, 0) scale(1.1);
    }
}

/* Loading Spinner - GPU Accelerated */
.notification-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}



@keyframes spin {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    100% { transform: translate3d(0, 0, 0) rotate(360deg); }
}

/* Popup - High Performance */
.notifications-popup {
    position: absolute;
    top: 4rem;
    right: 0;
    width: 22rem;
    max-width: min(90vw, 22rem);
    background: white;
    border-radius: 0.75rem;
    box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.1),
            0 2px 4px -1px rgba(0, 0, 0, 0.06),
            0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 0;
    z-index: 1001;

    /* Performance optimizations */
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, -0.5rem, 0) scale(0.95);
    transition:
            opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.15s;

    /* Prevent text selection during animation */
    user-select: none;
}

.notifications-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0) scale(1);
    user-select: auto;
}

/* Header */
.notification-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0.75rem 0.75rem 0 0;
}

.notification-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    color: #6b7280;
    border-radius: 0.25rem;
    transition: color 0.15s ease-out, background-color 0.15s ease-out;
    line-height: 1;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: #374151;
    background-color: #e5e7eb;
}

/* Notification List - Optimized Scrolling */
.notification-list {
    max-height: 20rem;
    overflow-y: auto;

    /* Smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;

    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Notification Items - Optimized */
.notification-item {
    position: relative;
    padding: 1rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease-out;

    /* Prevent layout shift */
    contain: layout;
}

.notification-item:last-child {
    border-bottom: none;
    border-radius: 0 0 0.75rem 0.75rem;
}

.notification-item:hover {
    background-color: #f9fafb;
}

.notification-item:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    background-color: #f9fafb;
}

/* Unread indicator */
.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #3b82f6;
    border-radius: 0 2px 2px 0;
}

.unread-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
}

/* Content */
.notification-content {
    padding-right: 1rem;
}

.notification-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #111827;
    line-height: 1.25;
}

.notification-item-caption {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.notification-time {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

/* Type-specific styles with better performance */
.notification-critical {
    /*background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, transparent 8%);*/
}

.notification-warning {
    /*background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 8%);*/
}

.notification-info {
    /*background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 8%);*/
}

.notification-success {
    /*background: linear-gradient(90deg, rgba(34, 197, 94, 0.1) 0%, transparent 8%);*/
}

/* Loading State */
.notification-loading-state {
    padding: 2rem 1.25rem;
    text-align: center;
    color: #6b7280;
}

/* Empty State */
.empty-notifications {
    padding: 3rem 1.25rem;
    text-align: center;
}

.empty-notifications .empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* Footer */
.notification-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
    text-align: center;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* Overlay */
.notifications-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.notifications-overlay {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .notifications-popup {
        position: fixed;
        top: 4rem;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
    }

    .notification-item {
        padding: 0.875rem 1rem;
    }

    .notification-header {
        padding: 0.875rem 1rem;
    }

    .notification-list {
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .notifications-popup {
        top: 3.5rem;
        right: 0.25rem;
        left: 0.25rem;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .notification-badge,
    .spinner,
    .notifications-popup,
    .notification-btn,
    .notification-item {
        animation: none;
        transition: none;
    }

    .notifications-popup {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .notifications-popup {
        border: 2px solid #000;
    }

    .notification-item {
        border-bottom-color: #000;
    }

    .notification-header {
        border-bottom-color: #000;
    }
}

/* Print styles */
@media print {
    .notifications-popup,
    .notifications-overlay,
    .notification-btn {
        display: none !important;
    }
}