/* =====================================================================
   notifications.css — red "new" dots, header bell, notification panel.
   Load AFTER motion.css and mobile.css. Delete its <link> to switch off.
   Only transform/opacity are animated; no blur; honours reduced-motion.
   ===================================================================== */

:root {
    --ntf-red: #ef4444;
    --ntf-red-glow: rgba(239, 68, 68, .55);
}

/* ---------- Red dot on nav tabs ---------- */
/* .ripple-btn clips overflow, so the dot lives INSIDE the button's edge */
.nav-btn { position: relative; }
.ntf-dot {
    position: absolute; top: 50%; right: 12px; width: 9px; height: 9px; margin-top: -4.5px;
    border-radius: 50%; background: var(--ntf-red);
    box-shadow: 0 0 0 2px rgba(15, 18, 36, .9), 0 0 8px var(--ntf-red-glow);
    transform: scale(0); opacity: 0; pointer-events: none;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;
}
.ntf-dot.ntf-on { transform: scale(1); opacity: 1; }
.ntf-dot.ntf-on::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ntf-red);
    animation: ntfPing 1.9s ease-out infinite;
}
@keyframes ntfPing { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.6); opacity: 0; } }
.light-theme .ntf-dot { box-shadow: 0 0 0 2px #fff, 0 0 8px var(--ntf-red-glow); }

/* Phone pills: sit in the top-right corner of the pill so the label stays readable */
@media (max-width: 767px) {
    .ntf-dot { top: 5px; right: 6px; margin-top: 0; width: 8px; height: 8px; }
}
/* the little Co-Assistant pill never gets a dot, but guard anyway */
#nav-co-assistant > .ntf-dot { display: none; }

/* ---------- Dot inside chat room list buttons ---------- */
.ntf-dot-inline {
    flex: none; margin-left: auto; width: 8px; height: 8px; border-radius: 50%;
    background: var(--ntf-red); box-shadow: 0 0 6px var(--ntf-red-glow);
    transform: scale(0); opacity: 0; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;
}
.ntf-dot-inline.ntf-on { transform: scale(1); opacity: 1; }

/* ---------- Bell ---------- */
#ntf-bell { position: relative; overflow: visible !important; }
#ntf-bell.hidden { display: none; }
.ntf-badge {
    position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: var(--ntf-red); color: #fff;
    font: 800 10px/17px 'Plus Jakarta Sans', system-ui, sans-serif; text-align: center;
    box-shadow: 0 0 0 2px rgba(15, 18, 36, .95), 0 4px 10px -2px var(--ntf-red-glow);
    transform: scale(0); opacity: 0; pointer-events: none;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;
}
.light-theme .ntf-badge { box-shadow: 0 0 0 2px #fff, 0 4px 10px -2px var(--ntf-red-glow); }
.ntf-badge.ntf-on { transform: scale(1); opacity: 1; }
#ntf-bell.ntf-ring svg { animation: ntfWiggle 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ntfWiggle {
    0%, 78%, 100% { transform: rotate(0); }
    82% { transform: rotate(-14deg); } 86% { transform: rotate(12deg); }
    90% { transform: rotate(-8deg); }  94% { transform: rotate(5deg); }
}

/* ---------- Panel ---------- */
#ntf-panel {
    position: fixed; top: 64px; right: 16px; z-index: 100002;
    width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px);
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 18px; color: #e5e7eb;
    background: linear-gradient(180deg, rgba(24, 28, 54, .98), rgba(10, 13, 28, .98));
    border: 1px solid rgba(167, 139, 250, .25);
    box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .75);
    transform: translate3d(0, -8px, 0) scale(.98); transform-origin: 100% 0; opacity: 0;
    visibility: hidden; pointer-events: none;
    transition: transform .22s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, visibility 0s linear .22s;
}
#ntf-panel.ntf-open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition: transform .22s cubic-bezier(.22, 1, .36, 1), opacity .2s ease; }
.light-theme #ntf-panel {
    color: #1e1b4b; background: #fff; border-color: rgba(109, 94, 252, .2);
    box-shadow: 0 24px 60px -18px rgba(109, 94, 252, .4);
}
.ntf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 10px; font-size: 13px; }
.ntf-head button, .ntf-foot button {
    font-size: 11px; font-weight: 700; color: #a78bfa; background: transparent; border: 0; cursor: pointer; padding: 6px 8px; border-radius: 8px; min-height: 32px;
}
.ntf-head button:hover:not(:disabled), .ntf-foot button:hover { background: rgba(167, 139, 250, .14); }
.ntf-head button:disabled { opacity: .4; cursor: default; }
.light-theme .ntf-head button, .light-theme .ntf-foot button { color: #6d5efc; }

.ntf-list { list-style: none; margin: 0; padding: 0 8px 8px; overflow-y: auto; overscroll-behavior: contain; }
.ntf-item {
    width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left; cursor: pointer;
    padding: 10px; border-radius: 12px; border: 0; background: transparent; color: inherit; min-height: 48px;
}
.ntf-item:hover { background: rgba(255, 255, 255, .06); }
.light-theme .ntf-item:hover { background: rgba(109, 94, 252, .08); }
.ntf-item.ntf-unread { background: rgba(124, 108, 255, .12); }
.ntf-ico {
    flex: none; width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: #c4b5fd; background: rgba(124, 108, 255, .18);
}
.ntf-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ntf-line { font-size: 12px; font-weight: 600; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.ntf-time { font-size: 10px; opacity: .55; }
.ntf-mini { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--ntf-red); }
.ntf-empty { padding: 28px 20px 30px; text-align: center; font-size: 13px; font-weight: 700; }
.ntf-empty small { display: block; margin-top: 6px; font-weight: 500; opacity: .6; line-height: 1.5; }
.ntf-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding: 6px 8px; text-align: center; }
.light-theme .ntf-foot { border-color: rgba(109, 94, 252, .14); }

/* Phones: panel hangs under the header, full width */
@media (max-width: 767px) {
    #ntf-panel { top: 60px; right: 12px; left: 12px; width: auto; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .ntf-dot.ntf-on::after, #ntf-bell.ntf-ring svg { animation: none; }
    #ntf-panel, .ntf-dot, .ntf-badge, .ntf-dot-inline { transition: none !important; }
}
/* Phones skip the infinite ping (same battery rule as motion.css) */
@media (max-width: 1023px), (pointer: coarse) {
    .ntf-dot.ntf-on::after { animation: none; }
}