/* ============================================================
   KSHATRIYA EXIM - Premium Toast System
   Version: 1.0.0
   ============================================================ */

/* ───────── Toast Container ───────── */
.ks-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

/* ───────── Toast Item ───────── */
.ks-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    padding-right: 40px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.ks-toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.ks-toast.is-removing {
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.25s ease;
}

/* ───────── Toast Icon ───────── */
.ks-toast__icon {
    flex: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.ks-toast--success .ks-toast__icon {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.ks-toast--error .ks-toast__icon {
    background: rgba(239, 68, 68, 0.10);
    color: #dc2626;
}

.ks-toast--warning .ks-toast__icon {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.ks-toast--info .ks-toast__icon {
    background: rgba(59, 130, 246, 0.10);
    color: #2563eb;
}

/* ───────── Toast Body ───────── */
.ks-toast__body {
    flex: 1;
    min-width: 0;
}

.ks-toast__title {
    font-weight: 700;
    font-size: 13.5px;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.4;
}

.ks-toast__message {
    font-weight: 400;
    font-size: 12.5px;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}

/* ───────── Toast Close Button ───────── */
.ks-toast__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    padding: 0;
}

.ks-toast__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #475569;
}

.ks-toast__close:focus-visible {
    outline: 2px solid #e8590c;
    outline-offset: 2px;
}

/* ───────── Progress Bar ───────── */
.ks-toast__progress {
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.ks-toast__progress-bar {
    height: 100%;
    border-radius: 0 0 12px 12px;
    transition: width linear;
}

.ks-toast--success .ks-toast__progress-bar { background: #22c55e; }
.ks-toast--error .ks-toast__progress-bar { background: #ef4444; }
.ks-toast--warning .ks-toast__progress-bar { background: #f59e0b; }
.ks-toast--info .ks-toast__progress-bar { background: #3b82f6; }

/* ───────── Orange Accent Variant ───────── */
.ks-toast--accent .ks-toast__icon {
    background: rgba(232, 93, 4, 0.10);
    color: #e8590c;
}

.ks-toast--accent .ks-toast__progress-bar { background: #e8590c; }

/* ───────── Responsive ───────── */
@media (max-width: 480px) {
    .ks-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        gap: 8px;
    }

    .ks-toast {
        font-size: 13px;
        padding: 12px 14px;
        padding-right: 36px;
    }

    .ks-toast__icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
        border-radius: 7px;
    }
}

/* ───────── Accessibility ───────── */
@media (prefers-reduced-motion: reduce) {
    .ks-toast {
        transition: opacity 0.15s ease;
        transform: none !important;
    }
    .ks-toast.is-visible { opacity: 1; }
    .ks-toast.is-removing { opacity: 0; }
}
