/* ============================================================
   MEDICAL NOTIFICATION & ALERT SYSTEM — v33
   ============================================================ */

/* ── Bell Button ── */
.notif-bell-wrap {
    position: relative;
}
.notif-bell-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: var(--bg-glass); border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer; font-size: 17px;
    transition: all 0.2s ease;
    position: relative; overflow: visible;
}
.notif-bell-btn:hover {
    background: rgba(108,99,255,0.12);
    border-color: rgba(108,99,255,0.3);
    transform: scale(1.08);
}
.notif-bell-btn.has-unread { animation: bellShake 2s ease-in-out infinite; }
@keyframes bellShake {
    0%,85%,100% { transform: rotate(0deg); }
    88%          { transform: rotate(-14deg); }
    92%          { transform: rotate(12deg); }
    96%          { transform: rotate(-8deg); }
}

.notif-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 18px; height: 18px; padding: 0 4px;
    background: #FF6B6B; color: #fff;
    font-size: 9px; font-weight: 900;
    border-radius: 9px; border: 2px solid var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    animation: badgePop 0.3s cubic-bezier(0.34,1.56,0.64,1);
    line-height: 1;
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* ── Notification Center Drawer ── */
.notif-center {
    position: fixed; top: 0; right: -400px; width: 380px; max-width: 95vw;
    height: 100vh; z-index: 9500;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 40px rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
    transition: right 0.38s cubic-bezier(0.16,1,0.3,1);
}
.notif-center.open { right: 0; }

.notif-backdrop {
    position: fixed; inset: 0; z-index: 9499;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.notif-backdrop.show { opacity: 1; pointer-events: auto; }

/* Center header */
.notif-center-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.notif-center-title {
    font-size: 15px; font-weight: 800; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.notif-center-count {
    font-size: 10px; font-weight: 700; padding: 2px 7px;
    border-radius: 9px; background: rgba(255,107,107,0.15);
    color: #FF6B6B;
}
.notif-center-actions { display: flex; gap: 6px; }
.notif-action-btn {
    padding: 4px 10px; font-size: 10px; font-weight: 700;
    border-radius: var(--radius-full); border: 1px solid var(--border-color);
    background: none; color: var(--text-muted); cursor: pointer;
    transition: all 0.15s;
}
.notif-action-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* Filter pills */
.notif-filter-row {
    display: flex; gap: 5px; padding: 10px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; flex-wrap: wrap;
}
.notif-filter-pill {
    padding: 3px 9px; border-radius: var(--radius-full);
    font-size: 10px; font-weight: 700;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.notif-filter-pill:hover { border-color: rgba(108,99,255,0.3); color: var(--accent-primary); }
.notif-filter-pill.active { background: rgba(108,99,255,0.14); border-color: rgba(108,99,255,0.35); color: var(--accent-primary); }

/* Notification list */
.notif-list {
    flex: 1; overflow-y: auto; padding: 8px 0;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Group label */
.notif-group-label {
    padding: 6px 18px 4px; font-size: 9px; font-weight: 800;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px;
}

/* Notification Item */
.notif-item {
    display: flex; gap: 11px; padding: 11px 18px;
    cursor: pointer; transition: background 0.15s ease;
    border-left: 3px solid transparent;
    position: relative;
    animation: notifSlideIn 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes notifSlideIn {
    from { opacity:0; transform:translateX(24px); }
    to   { opacity:1; transform:translateX(0); }
}
.notif-item:hover { background: var(--bg-glass); }
.notif-item.unread { background: rgba(108,99,255,0.04); }
.notif-item.unread::after {
    content: ''; position: absolute; top: 50%; right: 14px;
    transform: translateY(-50%);
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent-primary);
}

/* Severity border colors */
.notif-item.sev-emergency  { border-left-color: #FF4D4D; }
.notif-item.sev-high-risk  { border-left-color: #FFB100; }
.notif-item.sev-ai         { border-left-color: #6C63FF; }
.notif-item.sev-imaging    { border-left-color: #00D2FF; }
.notif-item.sev-system     { border-left-color: #4ADE80; }

/* Icon */
.notif-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.sev-emergency  .notif-icon { background: rgba(255,77,77,0.15);  }
.sev-high-risk  .notif-icon { background: rgba(255,177,0,0.15);  }
.sev-ai         .notif-icon { background: rgba(108,99,255,0.15); }
.sev-imaging    .notif-icon { background: rgba(0,210,255,0.12);  }
.sev-system     .notif-icon { background: rgba(74,222,128,0.12); }

/* Content */
.notif-content { flex: 1; min-width: 0; }
.notif-title-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.notif-title { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.notif-priority-badge {
    font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
    padding: 1px 5px; border-radius: 3px;
}
.priority-critical { background: rgba(255,77,77,0.2);  color: #FF4D4D; }
.priority-high     { background: rgba(255,177,0,0.15); color: #FFB100; }
.priority-medium   { background: rgba(108,99,255,0.15); color: #9C8AFF; }
.priority-low      { background: rgba(255,255,255,0.07); color: var(--text-muted); }
.notif-msg  { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
.notif-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* Empty state */
.notif-empty {
    display: flex; flex-direction: column; align-items: center;
    padding: 48px 24px; text-align: center;
}
.notif-empty-icon  { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.notif-empty-title { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.notif-empty-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Footer */
.notif-center-footer {
    padding: 10px 18px; border-top: 1px solid var(--border-color);
    font-size: 11px; color: var(--text-muted); text-align: center; flex-shrink: 0;
}
.notif-center-footer span { color: var(--accent-primary); font-weight: 600; cursor: pointer; }
.notif-center-footer span:hover { text-decoration: underline; }

/* ── Medical Alert Toast (priority) ── */
.med-alert-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    z-index: 10001; min-width: 320px; max-width: 420px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: alertToastIn 0.45s cubic-bezier(0.16,1,0.3,1);
}
@keyframes alertToastIn {
    from { opacity:0; transform:translateX(-50%) translateY(20px) scale(0.95); }
    to   { opacity:1; transform:translateX(-50%) translateY(0)     scale(1); }
}
.med-alert-toast.removing {
    animation: alertToastOut 0.3s ease forwards;
}
@keyframes alertToastOut {
    to { opacity:0; transform:translateX(-50%) translateY(16px) scale(0.96); }
}
.mat-bar   { height: 3px; width: 100%; }
.mat-body  { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.mat-icon  { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.mat-content { flex: 1; }
.mat-label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 2px; }
.mat-title { font-size: 13px; font-weight: 800; color: var(--text-primary); margin-bottom: 2px; }
.mat-msg   { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.mat-close { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 0; }
.mat-close:hover { color: var(--text-primary); }
.mat-emergency  .mat-bar { background: linear-gradient(90deg, #FF4D4D, #FF8C00); }
.mat-emergency  .mat-label { color: #FF4D4D; }
.mat-high-risk  .mat-bar { background: linear-gradient(90deg, #FFB100, #FF6B6B); }
.mat-high-risk  .mat-label { color: #FFB100; }
.mat-ai         .mat-bar { background: var(--gradient-primary); }
.mat-ai         .mat-label { color: #A78BFA; }
.mat-imaging    .mat-bar { background: linear-gradient(90deg, #00D2FF, #4ADE80); }
.mat-imaging    .mat-label { color: #00D2FF; }
.mat-system     .mat-bar { background: linear-gradient(90deg, #4ADE80, #00D2FF); }
.mat-system     .mat-label { color: #4ADE80; }
