/* 
   ==========================================================================
   Jal Setu — Notification System UI Styling
   ==========================================================================
*/

/* Bell icon styling */
.nav-notification-bell {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 8px;
    border-radius: 50%;
}

.nav-notification-bell:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-notification-bell .material-symbols-outlined {
    font-size: 24px;
    vertical-align: middle;
    color: #4B5563; /* Cool gray */
}

/* Badge with pulsing light effect */
.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: linear-gradient(135deg, #EF4444, #DC2626); /* Vibrant red gradient */
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #ffffff, 0 0 8px rgba(239, 68, 68, 0.6);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7), 0 0 0 2px #ffffff;
    }
    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0), 0 0 0 2px #ffffff;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 0 0 2px #ffffff;
    }
}

/* Bell ring animation for new alerts */
@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-10deg); }
    45% { transform: rotate(5deg); }
    60% { transform: rotate(-5deg); }
    75% { transform: rotate(2deg); }
    90% { transform: rotate(-2deg); }
}

.bell-ring-active {
    animation: bell-ring 0.8s ease-in-out;
}

/* Notification Drawer Overlay */
.notif-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.notif-drawer-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Notification Drawer Panel */
.notif-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-drawer.show {
    right: 0;
}

/* Header */
.notif-drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-drawer-header h5 {
    margin: 0;
    font-weight: 600;
    color: #111827;
}

.notif-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notif-drawer-close:hover {
    background-color: #F3F4F6;
    color: #374151;
}

/* Tabs & Filter Bar */
.notif-drawer-tabs {
    display: flex;
    padding: 8px 12px;
    background-color: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    gap: 4px;
}

.notif-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-align: center;
}

.notif-tab-btn:hover {
    background-color: #E5E7EB;
    color: #374151;
}

.notif-tab-btn.active {
    background-color: #FFFFFF;
    color: #4F46E5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Body / List container */
.notif-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

/* Custom Scrollbar for Drawer List */
.notif-drawer-list::-webkit-scrollbar {
    width: 6px;
}
.notif-drawer-list::-webkit-scrollbar-track {
    background: #F1F1F1;
}
.notif-drawer-list::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}
.notif-drawer-list::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Notification Item Card */
.notif-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    margin-bottom: 10px;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s, background-color 0.2s;
    overflow: hidden;
}

.notif-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
    background-color: #FAFAFA;
}

.notif-card.unread {
    background-color: #EEF2FF; /* Ultra light indigo for unread */
    border-color: #C7D2FE;
}

.notif-card.unread:hover {
    background-color: #E0E7FF;
}

/* Left Indicator Border based on Priority */
.notif-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.notif-card.prio-critical::before { background-color: #EF4444; } /* Red */
.notif-card.prio-high::before     { background-color: #F97316; } /* Orange */
.notif-card.prio-medium::before   { background-color: #3B82F6; } /* Blue */
.notif-card.prio-low::before      { background-color: #9CA3AF; } /* Gray */

/* Left Icon Container */
.notif-icon-wrap {
    font-size: 20px;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

/* Content Area */
.notif-content-wrap {
    flex: 1;
}

.notif-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 3px 0;
    line-height: 1.3;
}

.notif-desc {
    font-size: 12.5px;
    color: #4B5563;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

/* Footer of the card */
.notif-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-time {
    font-size: 11px;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notif-card-actions {
    display: flex;
    gap: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notif-card:hover .notif-card-actions {
    opacity: 1;
}

.notif-btn-read, .notif-btn-del {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #9CA3AF;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s;
}

.notif-btn-read:hover {
    color: #4F46E5;
    background-color: #EEF2FF;
}

.notif-btn-del:hover {
    color: #EF4444;
    background-color: #FEF2F2;
}

.notif-btn-read span, .notif-btn-del span {
    font-size: 16px;
}

/* Empty State */
.notif-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #9CA3AF;
}

.notif-empty-state span {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* Drawer Footer */
.notif-drawer-footer {
    padding: 16px;
    border-top: 1px solid #F3F4F6;
    display: flex;
    gap: 12px;
}

.notif-footer-btn {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.notif-btn-allread {
    background-color: #FFFFFF;
    color: #374151;
}

.notif-btn-allread:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
}

.notif-btn-viewall {
    background-color: #4F46E5;
    color: #FFFFFF;
    border-color: #4F46E5;
}

.notif-btn-viewall:hover {
    background-color: #4338CA;
    border-color: #4338CA;
}

/* Pulsing dot for Critical alerts inside the card */
.critical-dot {
    width: 6px;
    height: 6px;
    background-color: #EF4444;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: critical-pulse 1.2s infinite;
}

@keyframes critical-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Toast styling overrides / customization */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1090;
}

.notif-toast {
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #E5E7EB;
    overflow: hidden;
    min-width: 300px;
    max-width: 350px;
    margin-top: 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notif-toast-header {
    padding: 10px 14px;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-toast-body {
    padding: 12px 14px;
    display: flex;
    gap: 10px;
}
