/* ========================================
   q-platform — Toast Notification (ported from SHVQ V2)
   API: window.SHV.toast.{info,success,warn,error,danger,dismiss}
        window.showToast(msg, type)
   ======================================== */

.toast-container {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
    width: 320px;
}

/* ── Light (default) — gradient glass ── */
.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
    max-height: 120px;
    width: 320px;

    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: linear-gradient(180deg,
        rgba(255,255,255,0.86) 0%,
        rgba(255,255,255,0.66) 100%);
    border: 1px solid rgba(0,0,0,0.055);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.65);
    color: #0e2a2f;

    transform: translateX(calc(100% + 24px));
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1),
        max-height 0.25s ease,
        padding 0.25s ease;
}

/* light — top glow */
.toast::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;
    background: linear-gradient(120deg, rgba(59,130,246,0.10), transparent 38%);
    opacity: 0.5;
    pointer-events: none;
}

/* ── Dark — glass layer ── */
[data-theme="dark"] .toast {
    background: linear-gradient(180deg,
        rgba(24,38,68,0.68) 0%,
        rgba(16,26,50,0.58) 100%);
    border-color: rgba(255,255,255,0.10);
    box-shadow:
        0 20px 50px rgba(0,0,0,0.50),
        inset 0 1px 0 rgba(255,255,255,0.08);
    color: #e3eef3;
}
[data-theme="dark"] .toast::after {
    background: linear-gradient(120deg, rgba(59,130,246,0.25), transparent 38%);
    opacity: 0.4;
}

/* ── Stack depth (2nd / 3rd) ── */
.toast-container .toast-visible ~ .toast-visible {
    transform: translateX(0) scale(0.980);
    opacity: 0.92;
}
.toast-container .toast-visible ~ .toast-visible ~ .toast-visible {
    transform: translateX(0) scale(0.960);
    opacity: 0.85;
}

/* ── Visible ── */
.toast.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

/* ── Hiding ── */
.toast.toast-hiding {
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ── Type accent (left border) ── */
.toast-info    { border-left: 2px solid rgba(42,175,212,0.65); }
.toast-success { border-left: 2px solid rgba(0,200,120,0.65); }
.toast-warn    { border-left: 2px solid rgba(245,166,35,0.65); }
.toast-danger  { border-left: 2px solid rgba(255,68,102,0.65); }

/* ── Icon ── */
.toast-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.82;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.toast-icon svg { width: 16px; height: 16px; display: block; }
.toast-info    .toast-icon { color: #2aafd4; }
.toast-success .toast-icon { color: #00c878; }
.toast-warn    .toast-icon { color: #f5a623; }
.toast-danger  .toast-icon { color: #ff4466; }

.toast-body {
    flex: 1;
    word-break: break-word;
    line-height: 1.5;
}

/* ── Close button ── */
.toast-close {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 6px;
    font-size: 16px;
    line-height: 1;
    color: inherit;
    opacity: 0.38;
    transition: opacity 0.18s ease;
    font-family: inherit;
}
.toast-close:hover { opacity: 0.85; }

/* ── Mobile ── */
@media (max-width: 720px) {
    .toast-container { right: 12px; left: 12px; width: auto; }
    .toast { width: 100%; }
}
