/* ==========================================================================
   Devsly Site-Wide Notification Inbox (assets/css/notifications.css)
   Calm, non-intrusive "What's new" launcher pill anchored at bottom-right
   above the Quick Tools button; unfolds smoothly into a clean, theme-aware
   announcements drawer on demand instead of jumping over page content on
   first visit.
   Locked brand hue: 210deg (#0066cc / #4d9fe6).
   Role radii: 8px control, 12px item, 16px panel, 999px pill.
   ========================================================================== */

.notification-container {
    --dnt-surface: #ffffff;
    --dnt-surface-2: #f4f7fb;
    --dnt-ink: #131c2b;
    --dnt-ink-2: #445269;
    --dnt-ink-3: #5b6980;
    --dnt-line: rgba(19, 28, 43, 0.12);
    --dnt-line-2: rgba(19, 28, 43, 0.20);
    --dnt-accent: #0066cc;
    --dnt-accent-hover: #0052a3;
    --dnt-accent-soft: #e6f0fb;
    --dnt-ok: #047857;
    --dnt-ok-soft: rgba(4, 120, 87, 0.10);
    --dnt-warn: #b45309;
    --dnt-warn-soft: rgba(180, 83, 9, 0.10);

    position: fixed;
    right: 20px;
    bottom: 88px;
    z-index: 999990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
    font-family: inherit;
}

.notification-container[hidden] {
    display: none;
}

[data-theme="dark"] .notification-container {
    --dnt-surface: #111b2e;
    --dnt-surface-2: #17243d;
    --dnt-ink: #eef3fb;
    --dnt-ink-2: #c2d0e4;
    --dnt-ink-3: #95a7c2;
    --dnt-line: rgba(232, 238, 252, 0.12);
    --dnt-line-2: rgba(232, 238, 252, 0.22);
    --dnt-accent: #6cb0f5;
    --dnt-accent-hover: #93c5fd;
    --dnt-accent-soft: rgba(108, 176, 245, 0.14);
    --dnt-ok: #34d399;
    --dnt-ok-soft: rgba(52, 211, 153, 0.14);
    --dnt-warn: #fbbf24;
    --dnt-warn-soft: rgba(251, 191, 36, 0.14);
}

/* ---------- 1. Quiet Compact Launcher Pill (default resting state) ---------- */

.dnt-trigger {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px 0 8px;
    border-radius: 999px;
    border: 1px solid var(--dnt-line-2);
    background: var(--dnt-surface);
    color: var(--dnt-ink);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(19, 28, 43, 0.14);
    transition: border-color 140ms cubic-bezier(0.2, 0, 0, 1),
                background-color 140ms cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="dark"] .dnt-trigger {
    box-shadow: 0 10px 28px rgba(2, 8, 20, 0.48);
}

.dnt-trigger:hover {
    border-color: var(--dnt-accent);
    background: var(--dnt-surface-2);
}

.dnt-trigger:focus-visible {
    outline: 2px solid var(--dnt-accent);
    outline-offset: 2px;
}

.dnt-trigger[hidden] {
    display: none;
}

.dnt-trigger-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--dnt-accent-soft);
    color: var(--dnt-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex: none;
}

.dnt-trigger-label {
    white-space: nowrap;
}

.dnt-trigger-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #0066cc;
    color: #ffffff;
    font-size: 11px;
    line-height: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- 2. Clean Announcements Inbox Popover ---------- */

.dnt-panel {
    pointer-events: auto;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: min(460px, calc(100vh - 150px));
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid var(--dnt-line-2);
    background: var(--dnt-surface);
    color: var(--dnt-ink);
    box-shadow: 0 16px 40px rgba(19, 28, 43, 0.18);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 160ms cubic-bezier(0.2, 0, 0, 1),
                transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="dark"] .dnt-panel {
    box-shadow: 0 18px 44px rgba(2, 8, 20, 0.56);
}

.dnt-panel[hidden] {
    display: none;
}

.dnt-panel.is-open {
    opacity: 1;
    transform: translateY(0);
}

.dnt-panel:focus-visible {
    outline: 2px solid var(--dnt-accent);
    outline-offset: -2px;
}

.dnt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid var(--dnt-line);
    background: var(--dnt-surface-2);
    flex-shrink: 0;
}

.dnt-head-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dnt-head-left i {
    color: var(--dnt-accent);
    font-size: 14px;
}

.dnt-title {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: var(--dnt-ink);
}

.dnt-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dnt-clear-btn {
    min-height: 30px;
    padding: 0 9px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--dnt-ink-2);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1),
                color 120ms cubic-bezier(0.2, 0, 0, 1);
}

.dnt-clear-btn:hover {
    background: var(--dnt-surface);
    color: var(--dnt-accent);
}

.dnt-clear-btn:focus-visible {
    outline: 2px solid var(--dnt-accent);
    outline-offset: 1px;
}

.dnt-close-panel {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--dnt-ink-3);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1),
                color 120ms cubic-bezier(0.2, 0, 0, 1);
}

.dnt-close-panel:hover {
    background: var(--dnt-surface);
    color: var(--dnt-ink);
}

.dnt-close-panel:focus-visible {
    outline: 2px solid var(--dnt-accent);
    outline-offset: 1px;
}

/* ---------- 3. Notification Items List ---------- */

.notification-wrapper {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    border-bottom: 1px solid var(--dnt-line);
    background: var(--dnt-surface);
    transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1),
                opacity 160ms cubic-bezier(0.2, 0, 0, 1);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--dnt-surface-2);
}

.notification-item.hiding {
    opacity: 0;
}

.notification-item[hidden] {
    display: none;
}

.notification-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--dnt-accent-soft);
    color: var(--dnt-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex: none;
    margin-top: 1px;
}

.notification-success .notification-icon-box {
    background: var(--dnt-ok-soft);
    color: var(--dnt-ok);
}

.notification-warning .notification-icon-box {
    background: var(--dnt-warn-soft);
    color: var(--dnt-warn);
}

.notification-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-title {
    font-size: 13.5px;
    line-height: 19px;
    font-weight: 600;
    color: var(--dnt-ink);
    overflow-wrap: anywhere;
}

.notification-message {
    font-size: 12.5px;
    line-height: 18px;
    color: var(--dnt-ink-2);
    overflow-wrap: anywhere;
}

.notification-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 18px;
    font-weight: 600;
    color: var(--dnt-accent);
    text-decoration: none;
    align-self: flex-start;
}

.notification-link:hover {
    color: var(--dnt-accent-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.notification-link:focus-visible {
    outline: 2px solid var(--dnt-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.notification-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--dnt-ink-3);
    font-size: 13px;
    cursor: pointer;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: -2px;
    transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1),
                color 120ms cubic-bezier(0.2, 0, 0, 1);
}

.notification-close:hover {
    background: var(--dnt-line);
    color: var(--dnt-ink);
}

.notification-close:focus-visible {
    outline: 2px solid var(--dnt-accent);
    outline-offset: 1px;
}

/* ---------- 4. Mobile Responsive ---------- */

@media (max-width: 639px) {
    .notification-container {
        right: 14px;
        bottom: 84px;
        max-width: calc(100vw - 28px);
    }

    .dnt-trigger {
        padding: 0 10px 0 8px;
    }

    .dnt-trigger-label {
        display: none;
    }

    .dnt-panel {
        width: min(340px, calc(100vw - 28px));
        max-height: min(62vh, calc(100vh - 140px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .dnt-trigger,
    .dnt-panel,
    .dnt-clear-btn,
    .dnt-close-panel,
    .notification-item,
    .notification-close {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
