/* Notifications drawer (NotificationsPanel, NotificationsDrawer). Linked from the desktop
   and WASM index.html. The desktop slides its WebView in from WPF with the same timing as
   --sc-notify-open-ms / --sc-notify-close-ms (NotificationsDrawerMotion). */

.sc-notify-drawer {
    --sc-notify-width: 380px;
    --sc-notify-open-ms: 220ms;
    --sc-notify-close-ms: 180ms;
    position: absolute;
    inset: 0;
    z-index: 25;
    overflow: hidden;
}

.sc-notify-drawer.is-closed {
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s linear var(--sc-notify-close-ms);
}

.sc-notify-drawer.is-open {
    visibility: visible;
    transition: visibility 0s linear 0s;
}

.sc-notify-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity var(--sc-notify-close-ms) ease-in;
}

.sc-notify-drawer.is-open .sc-notify-scrim {
    opacity: 1;
    transition: opacity var(--sc-notify-open-ms) ease-out;
}

.sc-notify-sheet {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(var(--sc-notify-width), 100%);
    background: #fff;
    border-right: 1px solid #d0d3d8;
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.18);
    transform: translateX(-100%);
    transition: transform var(--sc-notify-close-ms) cubic-bezier(0.4, 0, 1, 1);
    will-change: transform;
}

.sc-notify-drawer.is-open .sc-notify-sheet {
    transform: translateX(0);
    transition: transform var(--sc-notify-open-ms) cubic-bezier(0, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .sc-notify-drawer,
    .sc-notify-drawer.is-open,
    .sc-notify-scrim,
    .sc-notify-drawer.is-open .sc-notify-scrim,
    .sc-notify-sheet,
    .sc-notify-drawer.is-open .sc-notify-sheet {
        transition: none;
    }
}

/* Panel */

.sc-notify-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
    color: #1f2328;
    outline: none;
    font-size: 0.875rem;
}

.sc-notify-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px 6px 16px;
}

.sc-notify-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

.sc-notify-count {
    color: #5b6068;
    font-size: 0.8rem;
    white-space: nowrap;
}

.sc-notify-head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.sc-notify-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 4px 8px;
    border-bottom: 1px solid #e3e5e8;
}

.sc-notify-progress {
    height: 4px;
}

.sc-notify-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 6px 12px;
    padding: 6px 10px;
    border-radius: 4px;
    background: #fdecea;
    color: #8a1c13;
}

.sc-notify-alert-dismiss {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.sc-notify-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.sc-notify-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 16px;
    color: #5b6068;
    text-align: center;
}

.sc-notify-state--error {
    color: #8a1c13;
}

.sc-notify-stale {
    margin: 6px 12px 0;
    color: #8a1c13;
    font-size: 0.8rem;
}

.sc-notify-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sc-notify-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 6px 10px 16px;
    border-bottom: 1px solid #eef0f2;
}

.sc-notify-item:hover {
    background: #f5f7fa;
}

.sc-notify-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: transparent;
}

.sc-notify-body {
    flex: 1 1 auto;
    min-width: 0;
}

.sc-notify-text {
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.sc-notify-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin-top: 2px;
    font-size: 0.75rem;
    color: #6b7078;
}

.sc-notify-item.is-unread .sc-notify-text {
    font-weight: 700;
    color: #1f2328;
}

.sc-notify-item.is-unread .sc-notify-dot {
    background: var(--mud-palette-primary, #1e6fd9);
}

.sc-notify-item.is-read .sc-notify-text {
    font-weight: 400;
    color: #6b7078;
}

.sc-notify-item.is-read .sc-notify-meta {
    color: #8a8f96;
}

.sc-notify-item.is-saving {
    opacity: 0.7;
}

.sc-notify-toggle {
    flex: 0 0 auto;
}

.sc-notify-open {
    display: inline-block;
    min-height: 1.75rem;
    margin-top: 0.25rem;
    padding: 0.125rem 0;
    border: 0;
    background: transparent;
    color: #155eb3;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.sc-notify-open:focus-visible {
    outline: 2px solid #155eb3;
    outline-offset: 2px;
}

.sc-notify-open:disabled {
    opacity: 0.6;
    cursor: wait;
}

.sc-notify-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Desktop: the drawer's WebView holds only the panel. */
.hybrid-notifications-host {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #fff;
}
