/* ═══════════════════════════════════════════════════════
   GUARD-RAIL TOAST — Global Reusable Component
   Single source of truth for all toast notifications.
   Canonical design from trash-guardrails mockup.
   ═══════════════════════════════════════════════════════ */

.guard-rail-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 99999;
    max-width: 420px;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid #f59e0b;
    pointer-events: none;
}
.guard-rail-toast.show {
    transform: translateX(0);
    pointer-events: auto;
}

/* ── Icon ── */
.guard-rail-toast .toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(148,163,184,0.22);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Body ── */
.guard-rail-toast .toast-body {
    flex: 1;
    min-width: 0;
}
.guard-rail-toast .toast-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 4px;
}
.guard-rail-toast .toast-msg {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.45;
    word-wrap: break-word;
}

/* ── Close ── */
.guard-rail-toast .toast-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.guard-rail-toast .toast-close:hover {
    color: white;
}

/* ═══════════════════════════════════════════════════════
   VARIANT: warn (amber)
   ═══════════════════════════════════════════════════════ */
.guard-rail-toast.warn {
    border-left-color: #f59e0b;
}
.guard-rail-toast.warn .toast-icon {
    background: rgba(245,158,11,0.2);
    color: #f59e0b;
}

/* ═══════════════════════════════════════════════════════
   VARIANT: info (sky blue)
   ═══════════════════════════════════════════════════════ */
.guard-rail-toast.info {
    border-left-color: #0ea5e9;
}
.guard-rail-toast.info .toast-icon {
    background: rgba(14,165,233,0.22);
    color: #7dd3fc;
}

/* ═══════════════════════════════════════════════════════
   VARIANT: success (emerald)
   ═══════════════════════════════════════════════════════ */
.guard-rail-toast.success {
    border-left-color: #16a34a;
}
.guard-rail-toast.success .toast-icon {
    background: rgba(22,163,74,0.22);
    color: #86efac;
}

/* ═══════════════════════════════════════════════════════
   PROGRESS BAR (auto-hide countdown)
   ═══════════════════════════════════════════════════════ */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 0;
    height: 3px;
    border-radius: 0 0 12px 0;
    overflow: hidden;
}
.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: toastProgress 4.8s linear forwards;
}
.guard-rail-toast.warn .toast-progress-bar    { background: #f59e0b; }
.guard-rail-toast.info .toast-progress-bar    { background: #0ea5e9; }
.guard-rail-toast.success .toast-progress-bar { background: #16a34a; }

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .guard-rail-toast {
        max-width: calc(100vw - 40px);
        right: 10px;
        top: 10px;
    }
}
