/* =============================================
   NSRP - Notifications System Styles
   ============================================= */

/* Notification Container (Toast) */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

/* Toast Notification */
.notification-toast {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast severity borders */
.notification-toast.critical {
    border-left: 4px solid #ef4444;
    animation: criticalPulse 1.5s infinite;
}

.notification-toast.high {
    border-left: 4px solid #f97316;
}

.notification-toast.medium {
    border-left: 4px solid #eab308;
}

.notification-toast.low {
    border-left: 4px solid #22c55e;
}

@keyframes criticalPulse {
    0%, 100% { box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 10px 50px rgba(239, 68, 68, 0.5); }
}

/* Toast Icon */
.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.toast-severity {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.toast-severity.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.toast-severity.high {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.toast-severity.medium {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.toast-severity.low {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.toast-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Toast Close Button */
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(239, 68, 68, 0.3);
    overflow: hidden;
}

.toast-progress::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: #ef4444;
    animation: progressShrink 5s linear forwards;
}

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

/* =============================================
   Header Notification Bell & Panel
   ============================================= */

.notification-wrapper {
    position: relative;
}

.notification-bell {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    position: relative;
}

.notification-bell:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-light);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: badgePulse 2s infinite;
}

.notification-badge.hidden {
    display: none;
}

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

/* Notification Panel */
.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transform-origin: top right;
    transition: all 0.2s ease;
}

.notification-panel:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.notification-panel.hidden {
    pointer-events: none;
}

/* Panel Header */
.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.notif-panel-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notif-panel-header h4 i {
    color: var(--primary-light);
}

.notif-actions {
    display: flex;
    gap: 0.5rem;
}

.notif-actions button {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notif-actions button:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-light);
}

/* Panel Body */
.notif-panel-body {
    max-height: 350px;
    overflow-y: auto;
}

.notif-panel-body::-webkit-scrollbar {
    width: 6px;
}

.notif-panel-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.notif-panel-body::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.5);
    border-radius: 3px;
}

/* Empty State */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.notif-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notif-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Notification Item */
.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.notif-item.unread {
    background: rgba(59, 130, 246, 0.08);
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.notif-item {
    position: relative;
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notif-severity {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.notif-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Panel Footer */
.notif-panel-footer {
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.notif-panel-footer button {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(71, 85, 105, 0.4);
    background: transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.notif-panel-footer button:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-light);
    color: var(--primary-light);
}

/* =============================================
   Full Notifications Modal
   ============================================= */

.notifications-full-list {
    max-height: 60vh;
    overflow-y: auto;
}

.notif-item-full {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
    position: relative;
    transition: all 0.2s ease;
}

.notif-item-full:hover {
    background: rgba(59, 130, 246, 0.05);
}

.notif-item-full.unread {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary);
}

.notif-item-full .notif-icon {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.notif-item-full .notif-content {
    flex: 1;
}

.notif-item-full .notif-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.notif-item-full .notif-title {
    font-size: 0.95rem;
    margin: 0;
}

.notif-item-full .notif-message {
    display: block;
    -webkit-line-clamp: unset;
}

.notif-delete {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
}

.notif-item-full:hover .notif-delete {
    opacity: 1;
}

.notif-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* =============================================
   Mobile Responsive
   ============================================= */

@media (max-width: 768px) {
    .notification-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notification-toast {
        margin: 0;
    }

    .notification-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .notification-panel:not(.hidden) {
        transform: translateY(0);
    }
}

/* =============================================
   Dark Mode Enhancements
   ============================================= */

@media (prefers-color-scheme: dark) {
    .notification-toast,
    .notification-panel {
        background: rgba(15, 23, 42, 0.98);
    }
}

/* =============================================
   Animation Utilities
   ============================================= */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.notification-bell.shake {
    animation: shake 0.5s ease;
}
