/* ══════════════════════════════════════════════════════════════
   Shared notifications: animated colored toasts + confirm modal.
   Used by both the admin CRM and the public site. Each layout sets
   --app-surface / --app-text so toasts match its theme (light/dark).
   ══════════════════════════════════════════════════════════════ */

.app-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--app-surface, #ffffff);
    color: var(--app-text, #1f2937);
    border-radius: 12px;
    padding: 0.85rem 2.2rem 0.85rem 0.95rem;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.20);
    border-left: 4px solid var(--app-toast-accent, #6b7280);
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.42s cubic-bezier(.2,.8,.2,1), opacity 0.42s ease;
}
.app-toast.show { transform: translateX(0); opacity: 1; }
.app-toast.hide { transform: translateX(120%); opacity: 0; }

.app-toast-icon { font-size: 1.25rem; line-height: 1.35; flex-shrink: 0; color: var(--app-toast-accent, #6b7280); }
.app-toast-body { flex: 1; min-width: 0; }
.app-toast-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.1rem; }
.app-toast-msg { font-size: 0.86rem; opacity: 0.9; word-break: break-word; }
.app-toast-close {
    position: absolute; top: 0.45rem; right: 0.5rem;
    border: none; background: transparent; cursor: pointer;
    color: inherit; opacity: 0.45; font-size: 1rem; line-height: 1; padding: 0.2rem;
    transition: opacity 0.15s ease;
}
.app-toast-close:hover { opacity: 0.9; }

/* animated progress bar that ticks down to auto-dismiss */
.app-toast-progress {
    position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
    background: var(--app-toast-accent, #6b7280); opacity: 0.55;
    transform-origin: left; animation: app-toast-tick linear forwards;
}
@keyframes app-toast-tick { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* type accents */
.app-toast-success { --app-toast-accent: #16a34a; }
.app-toast-error   { --app-toast-accent: #dc2626; }
.app-toast-warning { --app-toast-accent: #ea580c; }
.app-toast-info    { --app-toast-accent: #2563eb; }

/* subtle entrance pop on the icon */
.app-toast.show .app-toast-icon { animation: app-toast-pop 0.5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes app-toast-pop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ── Confirm modal (Bootstrap modal, themed) ── */
#appConfirmModal .modal-content {
    background: var(--app-surface, #ffffff);
    color: var(--app-text, #1f2937);
    border: none;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
#appConfirmModal .app-confirm-head {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 1.35rem 1.4rem 0.5rem;
}
#appConfirmModal .app-confirm-badge {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #dc2626; background: rgba(220, 38, 38, 0.12);
    animation: app-badge-pulse 1.6s ease-in-out infinite;
}
@keyframes app-badge-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.28); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
#appConfirmModal .app-confirm-title { font-weight: 700; font-size: 1.1rem; margin: 0; }
#appConfirmModal .app-confirm-msg { padding: 0.25rem 1.4rem 0.3rem; opacity: 0.9; font-size: 0.95rem; }
#appConfirmModal .app-confirm-foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1rem 1.4rem 1.4rem; }
#appConfirmModal .app-btn { border: none; border-radius: 9px; padding: 0.55rem 1.25rem; font-weight: 600; font-size: 0.92rem; cursor: pointer; transition: transform 0.15s ease, filter 0.15s ease; }
#appConfirmModal .app-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
#appConfirmModal .app-btn-cancel { background: rgba(120,120,120,0.16); color: inherit; }
#appConfirmModal .app-btn-danger { background: #dc2626; color: #fff; }

/* modal scale-in on top of Bootstrap fade */
#appConfirmModal .modal-dialog { transition: transform 0.28s cubic-bezier(.2,1.2,.3,1), opacity 0.28s ease; transform: scale(0.9); }
#appConfirmModal.show .modal-dialog { transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
    .app-toast, .app-toast-progress, #appConfirmModal .modal-dialog,
    #appConfirmModal .app-confirm-badge, .app-toast .app-toast-icon {
        animation: none !important; transition: none !important;
    }
    .app-toast { transform: none; opacity: 1; }
}
