/* Viljoen Legacy Luxurious Notifications */

/* Loud card: errors and warnings only (plus success/info carrying an action
   button). Bottom-left so it never sits over a page's top-right toolbar
   buttons (e.g. "Update Header"). */
#v-notification-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
    width: 380px;
    max-width: calc(100vw - 40px);
}

.v-notification {
    position: relative;
    background: var(--color-grey-50);
    color: var(--color-text-dark);
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-luxury);
    pointer-events: all;
    overflow: hidden;
    animation: v-notification-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border-left: 5px solid var(--color-charcoal);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v-notification.v-out {
    animation: v-notification-out 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

@keyframes v-notification-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes v-notification-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.v-notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.v-notification-title {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0;
}

.v-notification-close {
    background: transparent;
    border: none;
    color: var(--color-text-grey);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.v-notification-close:hover {
    color: var(--color-crimson);
}

.v-notification-body {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-grey-700);
}

.v-notification-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.v-notification-action-btn {
    background: var(--color-gold-faint);
    color: var(--color-charcoal);
    border: 1px solid var(--color-gold);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.v-notification-action-btn:hover {
    background: var(--color-gold);
    color: white;
}

/* Variants */
.v-notification-success {
    border-left-color: var(--color-gold);
}

.v-notification-error {
    border-left-color: var(--color-crimson);
}

.v-notification-warning {
    border-left-color: var(--color-warning);
}

.v-notification-info {
    border-left-color: var(--color-charcoal);
}

.v-notification-success .v-notification-title {
    color: var(--color-gold);
}

.v-notification-error .v-notification-title {
    color: var(--color-crimson);
}

/* Progress Bar (Butler Indicator) */
.v-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--color-gold);
    width: 100%;
    transform-origin: left;
}

.v-notification-error .v-notification-progress,
.v-notification-warning .v-notification-progress {
    display: none;
    /* Persistent */
}

@media (max-width: 767.98px) {
    #v-notification-container {
        /* Clears the fixed mobile action/zoom footer bars (z-index up to
           9999 — see mobile_ux_standards.md P16) so the card never lands
           underneath or visually collides with them. */
        bottom: 84px;
        left: 12px;
        width: calc(100vw - 24px);
    }
}

/* ------------------------------------------------------------------------
   Pattern A: Button-Confirms-Itself
   The clicked button morphs in place to a checkmark + "Saved". Never used
   for errors — a failed save always reverts the button and surfaces the
   loud card instead (see morphButton's caller in viljoen-notify.js).
   ------------------------------------------------------------------------ */
.v-btn-saved {
    background-color: var(--color-gold) !important;
    color: white !important;
    border-color: var(--color-gold) !important;
    opacity: 1 !important;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* ------------------------------------------------------------------------
   Pattern B: Ambient Pill (The Butler's Whisper)
   A small, low-contrast, bottom-center pill for saves with no discrete
   click to attach to (autosave, blur-save, bulk actions, background saves).
   No title. Dissolves quickly — it should read as a whisper, not an event.
   ------------------------------------------------------------------------ */
#v-ambient-pill-container {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.v-ambient-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-charcoal);
    color: var(--color-grey-50);
    padding: 6px 14px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.v-ambient-pill i {
    color: var(--color-gold);
    font-size: 0.85rem;
}

.v-ambient-pill.v-in {
    opacity: 0.94;
    transform: translateY(0);
}

.v-ambient-pill.v-out {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

@media (max-width: 767.98px) {
    #v-ambient-pill-container {
        /* Same footer-clearance reasoning as the card above. */
        bottom: 84px;
    }
}

/* ------------------------------------------------------------------------
   Local Inline Notice — a static, non-dismissing notice embedded directly
   in page content (e.g. a banner inside a card), distinct from the fixed
   ambient pill above.
   ------------------------------------------------------------------------ */
.v-local-notice {
    background: var(--color-grey-100);
    border-left: 3px solid var(--color-gold);
    padding: 12px 16px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-charcoal);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.v-local-notice strong {
    color: var(--color-gold);
}
