/* =============================================================================
   TOAST COMPONENT
   public/front/components/toast/toast.css

   Covers:
     - rightToast()  → slide-in notification (success / error / warning / info)
     - rnConfirm()   → non-blocking confirm card (Cancel / Confirm buttons)

   Loaded via: resources/views/front/components/toast.blade.php
   Do NOT import these styles anywhere else.
============================================================================= */


/* ── Container ────────────────────────────────────────────────────────────── */

.rt-toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

@media (max-width: 576px) {
    .rt-toast-container {
        left: 12px;
        right: 12px;
    }
}


/* ── Base toast card ──────────────────────────────────────────────────────── */

.rt-toast {
    pointer-events: auto;
    position: relative;
    min-width: 300px;
    max-width: 380px;
    width: auto;
    background: var(--bs-body-bg, #ffffff);
    color: var(--bs-body-color, #111827);
    border: 1px solid rgba(17, 24, 39, 0.10);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 12px;
    display: grid;
    grid-template-columns: 10px auto 1fr auto;
    gap: 12px;
    align-items: center;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 260ms ease, opacity 260ms ease;
}

@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
    .rt-toast {
        background: color-mix(in srgb, var(--bs-body-bg, #ffffff) 86%, transparent);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

@media (max-width: 576px) {
    .rt-toast {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }
}

.rt-toast.rt-toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.rt-toast.rt-toast--hide {
    transform: translateX(120%);
    opacity: 0;
}


/* ── Colour bar (left accent) ─────────────────────────────────────────────── */

.rt-toast__bar {
    width: 10px;
    height: 100%;
    border-radius: 999px;
    background: var(--bs-primary, #60a5fa);
}

.rt-toast--success .rt-toast__bar  { background: var(--bs-success, #22c55e); }
.rt-toast--error   .rt-toast__bar  { background: var(--bs-danger,  #ef4444); }
.rt-toast--warning .rt-toast__bar  { background: var(--bs-warning, #f59e0b); }


/* ── Icon ─────────────────────────────────────────────────────────────────── */

.rt-toast__icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.04);
    color: var(--bs-primary, #2563eb);
    font-size: 16px;
}

.rt-toast--success .rt-toast__icon { color: var(--bs-success, #16a34a); }
.rt-toast--error   .rt-toast__icon { color: var(--bs-danger,  #dc2626); }
.rt-toast--warning .rt-toast__icon { color: var(--bs-warning, #d97706); }


/* ── Message text ─────────────────────────────────────────────────────────── */

.rt-toast__text {
    font-size: 14px;
    line-height: 1.25rem;
    font-weight: 600;
}


/* ── Close button ─────────────────────────────────────────────────────────── */

.rt-toast__close {
    border: 0;
    background: transparent;
    color: rgba(107, 114, 128, 0.9);
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.rt-toast__close:hover {
    background: rgba(17, 24, 39, 0.06);
    color: var(--bs-body-color, #111827);
}


/* ── Progress bar ─────────────────────────────────────────────────────────── */

.rt-toast__progress {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 8px;
    height: 2px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.08);
}

.rt-toast__progress > span {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left;
    transform: scaleX(1);
    background: var(--bs-primary, #60a5fa);
    animation-name: rtToastProgress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.rt-toast--success .rt-toast__progress > span { background: var(--bs-success, #22c55e); }
.rt-toast--error   .rt-toast__progress > span { background: var(--bs-danger,  #ef4444); }
.rt-toast--warning .rt-toast__progress > span { background: var(--bs-warning, #f59e0b); }

@keyframes rtToastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}


/* ── Confirm card variant ─────────────────────────────────────────────────── */
/*    Extends .rt-toast — overrides grid so body gets the full third column   */

.rt-confirm {
    grid-template-columns: 10px auto 1fr;
    align-items: start;
    padding-bottom: 14px;
}

.rt-confirm__body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rt-confirm__actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.rt-confirm__btn {
    flex: 1;
    padding: 6px 0;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.rt-confirm__btn:hover { opacity: 0.85; }

.rt-confirm__btn--cancel {
    background: rgba(17, 24, 39, 0.07);
    color: var(--bs-body-color, #374151);
}

.rt-confirm__btn--confirm {
    background: var(--bs-danger, #ef4444);
    color: #fff;
}