/* PBNotify styling, paired with shared/js/notify.js. Self-contained: it
 * doesn't rely on the dashboard's or admin's own tokens. Colors follow the
 * page's color-scheme via light-dark(), so the dashboard gets dark cards
 * in dark mode while the light-only admin stays light. Browsers without
 * light-dark() get the light palette. */

.pb-notify-region {
    position: fixed;
    /* Clears the 57–64px sticky headers on the dashboard, editor and admin. */
    top: 76px;
    right: 16px;
    z-index: 100000; /* above editor modals (max 9999) */
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.pb-notify {
    --pb-notify-surface: #ffffff;
    --pb-notify-text: #1d1a22;
    --pb-notify-muted: #6b6475;
    --pb-notify-border: rgba(29, 26, 34, 0.10);

    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 10px 12px 14px;
    border: 1px solid var(--pb-notify-border);
    border-left: 3px solid var(--pb-notify-accent);
    border-radius: 12px;
    background: var(--pb-notify-surface);
    color: var(--pb-notify-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.12);
    font: 500 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    text-align: left;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pb-notify.is-visible {
    opacity: 1;
    transform: none;
}

.pb-notify--success { --pb-notify-accent: #1f8a5b; }
.pb-notify--error   { --pb-notify-accent: #d0344f; }
.pb-notify--warning { --pb-notify-accent: #b86e00; }
.pb-notify--info    { --pb-notify-accent: #3b6fd8; }

@supports (color: light-dark(#000, #fff)) {
    .pb-notify {
        --pb-notify-surface: light-dark(#ffffff, #24222a);
        --pb-notify-text: light-dark(#1d1a22, #f1eef5);
        --pb-notify-muted: light-dark(#6b6475, #a39cad);
        --pb-notify-border: light-dark(rgba(29, 26, 34, 0.10), rgba(255, 255, 255, 0.10));
    }
    .pb-notify--success { --pb-notify-accent: light-dark(#1f8a5b, #3fbf86); }
    .pb-notify--error   { --pb-notify-accent: light-dark(#d0344f, #ff6b84); }
    .pb-notify--warning { --pb-notify-accent: light-dark(#b86e00, #f0a53a); }
    .pb-notify--info    { --pb-notify-accent: light-dark(#3b6fd8, #7aa2f7); }
}

.pb-notify__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 0.5px;
    border-radius: 50%;
    background: var(--pb-notify-accent);
    color: var(--pb-notify-surface);
}

.pb-notify__icon svg { stroke-width: 2.2; }

.pb-notify__icon svg,
.pb-notify__close svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pb-notify__message {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding-top: 1px;
    overflow-wrap: anywhere;
}

.pb-notify__close {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: -1px 0 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--pb-notify-muted);
    cursor: pointer;
}

.pb-notify__close:hover { color: var(--pb-notify-text); background: var(--pb-notify-border); }
.pb-notify__close:focus-visible { outline: 2px solid var(--pb-notify-accent); outline-offset: 1px; }

/* Phones: full width along the top, sliding down instead of in from the side. */
@media (max-width: 600px) {
    .pb-notify-region {
        top: 68px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .pb-notify { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
    .pb-notify { transform: none; transition: opacity 0.15s linear; }
}
