/**
 * Toast-style notifications (bootstrap-notify with custom template).
 * Targets .app-toast on [data-notify="container"].
 */

[data-notify="container"].app-toast {
    display: flex;
    flex-direction: column;
    min-width: min(100%, 360px);
    max-width: min(420px, calc(100vw - 28px));
    margin: 0 auto;
    /* bootstrap-notify defaults to padding-left for legacy icon gap */
    padding: 0 !important;
    padding-left: 0 !important;
    border: none !important;
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.08),
        0 12px 32px -4px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    font-family: inherit;
    background: #fff !important;
    color: #0f172a;
    border-inline-start: 4px solid transparent;
}

[data-notify="container"].app-toast.app-toast--success {
    background: linear-gradient(180deg, #f8fdf9 0%, #f0fdf4 100%) !important;
    border-inline-start-color: #16a34a;
}

[data-notify="container"].app-toast.app-toast--danger {
    background: linear-gradient(180deg, #fffbfb 0%, #fef2f2 100%) !important;
    border-inline-start-color: #dc2626;
}

.app-toast__layout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 42px 14px 16px;
}

[data-notify="container"].app-toast [data-notify="icon"] {
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0 !important;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1;
}

.app-toast--success [data-notify="icon"] {
    background: #dcfce7;
    color: #166534;
}

.app-toast--danger [data-notify="icon"] {
    background: #fee2e2;
    color: #991b1b;
}

.app-toast__body {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.app-toast__title,
[data-notify="title"].app-toast__title {
    display: block;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: #0f172a !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.app-toast__msg,
[data-notify="message"].app-toast__msg {
    display: block;
    margin-top: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.45;
    color: #475569 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.app-toast__msg:empty {
    display: none;
}

.app-toast__dismiss {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 1.35rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.app-toast__dismiss:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.app-toast__dismiss:focus {
    outline: 2px solid color-mix(in srgb, var(--theme-primary, #ff6a00) 45%, transparent);
    outline-offset: 1px;
}

/* Hide default bootstrap progress bar strip unless used */
[data-notify="container"].app-toast .progress[data-notify="progressbar"] {
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
}

[data-notify="container"].app-toast.app-toast--countdown .progress[data-notify="progressbar"] {
    height: 3px;
    margin: 0;
    border: 0;
    background: rgba(148, 163, 184, 0.25);
}

[data-notify="container"].app-toast.app-toast--countdown .progress[data-notify="progressbar"] .progress-bar {
    width: 100%;
    background: linear-gradient(90deg, #f59aaa 0%, #f06f8f 100%);
}

@media (max-width: 575.98px) {
    [data-notify="container"].app-toast {
        max-width: calc(100vw - 20px);
        border-radius: 10px;
    }

    .app-toast__layout {
        padding: 12px 40px 12px 14px;
    }

    .app-toast__title {
        font-size: 0.875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-notify="container"].app-toast {
        animation: none !important;
    }
}
