/* ========================================
   GLOBAL TOAST NOTIFICATION STACK
   Lives in MainLayout — renders on every page.
   ======================================== */

.toast-stack {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.6rem;
    pointer-events: none;
    max-width: 360px;
    width: 100%;
}

/* ── Toast Item ── */

.toast-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #64748b;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    pointer-events: all;
    min-width: 280px;
}

/* Variants */
.toast-item.toast-success { border-left-color: #04844b; }
.toast-item.toast-error   { border-left-color: #dc3545; }
.toast-item.toast-warning { border-left-color: #f59e0b; }
.toast-item.toast-info    { border-left-color: #0176d3; }

/* ── Enter / Exit animations ── */

.toast-item.entering {
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-item.exiting {
    animation: toastSlideOut 0.25s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(110%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

/* ── Icon ── */

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.toast-success .toast-icon { color: #04844b; }
.toast-error   .toast-icon { color: #dc3545; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info    .toast-icon { color: #0176d3; }

/* ── Body ── */

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.toast-message {
    font-size: 0.775rem;
    color: #475569;
    line-height: 1.4;
}

.toast-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════
   JOB QUEUED TOAST  — fixed top-right inline
   Used by Compare and Release Validation pages
   ═══════════════════════════════════════════ */

.job-toast {
    position: fixed;
    top: 72px;
    right: 1.5rem;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    background: #fff;
    border: 1px solid color-mix(in srgb, #0066CC 30%, transparent);
    border-left: 3px solid #0066CC;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #1e293b;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    white-space: nowrap;
    max-width: 480px;
    animation: jobToastIn .25s ease, jobToastOut 1s ease 3s forwards;
}

.job-toast-icon {
    color: #0066CC;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.job-toast span { flex: 1; }

.job-toast-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0066CC;
    background: color-mix(in srgb, #0066CC 10%, #fff);
    border: 1px solid color-mix(in srgb, #0066CC 30%, transparent);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
    white-space: nowrap;
}
.job-toast-action:hover { background: color-mix(in srgb, #0066CC 18%, #fff); }

.job-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.job-toast-close:hover { color: #475569; }

@keyframes jobToastIn  { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes jobToastOut { from { opacity: 1; } to { opacity: 0; pointer-events: none; } }

/* "View Results →" link button */
.toast-action-link {
    display: inline-flex;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.775rem;
    font-weight: 600;
    color: #0176d3;
    background: #eef6ff;
    border: 1px solid #aed6f8;
    border-radius: 5px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.toast-action-link:hover {
    background: #0176d3;
    color: #fff;
    border-color: #0176d3;
}

/* ── Right side: timer bar + close ── */

.toast-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Auto-dismiss countdown bar */
.toast-timer-bar {
    width: 3px;
    height: 44px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    align-self: flex-end;
}

.toast-timer-fill {
    width: 100%;
    background: #94a3b8;
    border-radius: 2px;
    animation: timerDrain linear forwards;
    transform-origin: top;
}

.toast-success .toast-timer-fill { background: #04844b; }
.toast-error   .toast-timer-fill { background: #dc3545; }
.toast-warning .toast-timer-fill { background: #f59e0b; }
.toast-info    .toast-timer-fill { background: #0176d3; }

@keyframes timerDrain {
    from { height: 100%; }
    to   { height: 0%;   }
}

/* Close button */
.toast-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.toast-close:hover {
    color: #475569;
}
