/* ============================================================
   EAZYDEV — premium notifications (toasts + confirm modal)
   Self-contained: works on the light business/public shells AND
   the dark platform-admin shell (toasts + modal float above any
   theme). No dependency on eazydev.css variables.
   ============================================================ */

/* ---------- Toast stack ---------- */
.ez-toast-container {
    position: fixed; top: 18px; right: 18px; z-index: 120000;
    display: flex; flex-direction: column; gap: 12px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.ez-toast {
    pointer-events: auto; position: relative; overflow: hidden;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 14px 16px 18px; border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
    color: #0f172a;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    transform: translateX(120%); opacity: 0;
    transition: transform .34s cubic-bezier(.2, .8, .2, 1), opacity .34s ease;
}
.ez-toast.show { transform: translateX(0); opacity: 1; }
.ez-toast.hide { transform: translateX(120%); opacity: 0; }
.ez-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.ez-toast-success::before { background: linear-gradient(180deg, #10b981, #34d399); }
.ez-toast-error::before   { background: linear-gradient(180deg, #ef4444, #f87171); }
.ez-toast-warning::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
.ez-toast-info::before    { background: linear-gradient(180deg, #6366f1, #8b5cf6); }

.ez-toast-icon {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
}
/* SVG glyphs injected by EZ.ICON — sized to fit the toast badge. */
.ez-toast-icon > svg, .ez-toast-icon .ez-ico {
    width: 20px; height: 20px;
}
.ez-toast-success .ez-toast-icon { background: rgba(16, 185, 129, .14); color: #047857; }
.ez-toast-error   .ez-toast-icon { background: rgba(239, 68, 68, .14);  color: #b91c1c; }
.ez-toast-warning .ez-toast-icon { background: rgba(245, 158, 11, .16); color: #b45309; }
.ez-toast-info    .ez-toast-icon { background: rgba(99, 102, 241, .14); color: #4f46e5; }

.ez-toast-body { flex: 1; min-width: 0; }
.ez-toast-title { font-weight: 800; font-size: 13.5px; margin-bottom: 2px; }
.ez-toast-msg { font-size: 13px; line-height: 1.5; color: #334155; overflow-wrap: anywhere; }
.ez-toast-close {
    flex-shrink: 0; background: transparent; border: 0; color: #94a3b8;
    font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.ez-toast-close:hover { color: #0f172a; }

.ez-toast-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(15, 23, 42, 0.06); }
.ez-toast-progress > span { display: block; height: 100%; width: 100%; transform-origin: left; animation: ezToastBar linear forwards; }
.ez-toast-success .ez-toast-progress > span { background: #10b981; }
.ez-toast-error   .ez-toast-progress > span { background: #ef4444; }
.ez-toast-warning .ez-toast-progress > span { background: #f59e0b; }
.ez-toast-info    .ez-toast-progress > span { background: #6366f1; }
.ez-toast.paused .ez-toast-progress > span { animation-play-state: paused; }
@keyframes ezToastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Confirmation modal ---------- */
body.ez-modal-open { overflow: hidden; }
.ez-confirm-overlay {
    position: fixed; inset: 0; z-index: 130000;
    display: flex; align-items: center; justify-content: center; padding: 18px;
    background: rgba(8, 12, 24, 0.55);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    opacity: 0; transition: opacity .2s ease;
}
.ez-confirm-overlay.show { opacity: 1; }
.ez-confirm-card {
    width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 24px;
    box-shadow: 0 30px 80px rgba(8, 12, 24, 0.45); border: 1px solid rgba(255, 255, 255, 0.6);
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    transform: translateY(14px) scale(.97);
    transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.ez-confirm-overlay.show .ez-confirm-card { transform: translateY(0) scale(1); }
.ez-confirm-head { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.ez-confirm-icon {
    flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 22px;
    background: rgba(99, 102, 241, .12); color: #4f46e5;
}
.ez-confirm-icon > svg, .ez-confirm-icon .ez-ico {
    width: 26px; height: 26px;
}
.ez-confirm-card.is-danger .ez-confirm-icon { background: rgba(239, 68, 68, .12); color: #dc2626; }
.ez-confirm-title { font-size: 18px; font-weight: 800; color: #0f172a; margin: 0; }
.ez-confirm-msg { font-size: 14px; line-height: 1.6; color: #475569; margin-bottom: 16px; }
.ez-confirm-field { margin-bottom: 16px; }
.ez-confirm-label { display: block; font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 6px; }
.ez-confirm-input {
    width: 100%; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px;
    font-size: 14px; font-family: inherit; resize: vertical; color: #0f172a;
}
.ez-confirm-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }
.ez-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.ez-btn {
    border: 1px solid transparent; border-radius: 12px; padding: 10px 18px;
    font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.ez-btn:hover { transform: translateY(-1px); }
.ez-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.ez-btn-ghost { background: #f1f5f9; color: #334155; }
.ez-btn-ghost:hover { background: #e2e8f0; }
.ez-btn-brand { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 10px 24px rgba(99, 102, 241, .32); }
.ez-btn-danger { background: linear-gradient(135deg, #ef4444, #f87171); color: #fff; box-shadow: 0 10px 24px rgba(239, 68, 68, .3); }
.ez-btn-spin {
    width: 15px; height: 15px; border: 2.5px solid rgba(255, 255, 255, .5);
    border-top-color: #fff; border-radius: 50%; animation: ezSpin .7s linear infinite;
}
@keyframes ezSpin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
    /* Keep toasts at the TOP on phones (not the bottom) so they never collide
       with the bottom-right floating action menu, and stack neatly from the
       top edge with a safe-area inset. (v3.29) */
    .ez-toast-container {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: 10px; left: 10px; bottom: auto; width: auto;
    }
    .ez-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .ez-toast, .ez-confirm-overlay, .ez-confirm-card { transition: none; }
    .ez-toast-progress > span { animation: none; }
}
