/* =============================================================================
 * JK Toast — styles for the dependency-free toast system (js/jk-toast.js).
 * Squared, brand-aligned cards that read well on light and dark backgrounds.
 * ========================================================================== */

.jk-toast-container {
    position: fixed;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
    pointer-events: none;
    max-width: min(92vw, 380px);
}

.jk-toast-container--top-right { top: 0; right: 0; align-items: flex-end; }
.jk-toast-container--top-left { top: 0; left: 0; align-items: flex-start; }
.jk-toast-container--bottom-right { bottom: 0; right: 0; align-items: flex-end; }
.jk-toast-container--bottom-left { bottom: 0; left: 0; align-items: flex-start; }
.jk-toast-container--top-center { top: 0; left: 50%; transform: translateX(-50%); align-items: center; }
.jk-toast-container--bottom-center { bottom: 0; left: 50%; transform: translateX(-50%); align-items: center; }

.jk-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    width: 100%;
    padding: 0.85rem 2.1rem 0.85rem 0.9rem;
    background: #ffffff;
    color: #1c2230;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 4px solid var(--jk-toast-accent, #6366f1);
    border-radius: 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    font-size: 0.88rem;
    line-height: 1.35;
    /* Enter/leave animation */
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.jk-toast.is-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.jk-toast.is-out {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
}

/* Bottom containers slide up instead of down */
.jk-toast-container--bottom-right .jk-toast,
.jk-toast-container--bottom-left .jk-toast,
.jk-toast-container--bottom-center .jk-toast {
    transform: translateY(8px) scale(0.98);
}
.jk-toast-container--bottom-right .jk-toast.is-in,
.jk-toast-container--bottom-left .jk-toast.is-in,
.jk-toast-container--bottom-center .jk-toast.is-in {
    transform: translateY(0) scale(1);
}

.jk-toast__icon {
    flex: 0 0 auto;
    font-size: 1.25rem;
    line-height: 1.2;
    color: var(--jk-toast-accent, #6366f1);
}

.jk-toast__body { flex: 1 1 auto; min-width: 0; }

.jk-toast__heading {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.jk-toast__text {
    color: rgba(28, 34, 48, 0.78);
    word-wrap: break-word;
}

/* When there's no heading, the text carries the weight */
.jk-toast__body > .jk-toast__text:only-child {
    font-weight: 600;
    color: #1c2230;
}

.jk-toast__close {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 1.4rem;
    height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(28, 34, 48, 0.4);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease;
}
.jk-toast__close:hover { color: rgba(28, 34, 48, 0.85); }

/* ── Type accents ─────────────────────────────────────────────────────── */
.jk-toast--success { --jk-toast-accent: #1aa663; }
.jk-toast--error { --jk-toast-accent: #e0454a; }
.jk-toast--warning { --jk-toast-accent: #e08a1a; }
.jk-toast--info { --jk-toast-accent: var(--jk-primary, #6366f1); }

@media (max-width: 480px) {
    .jk-toast-container { max-width: 100vw; padding: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    .jk-toast { transition: opacity 0.2s ease; transform: none; }
    .jk-toast.is-in, .jk-toast.is-out { transform: none; }
}
