/* ============================================================================
   Larkon Toast & Confirm — global notification system (16-May-2026)
   Replaces native alert() / confirm() everywhere.
   Usage from JS:
     Toast.success('Saved'); Toast.error('Failed'); Toast.info('FYI'); Toast.warning('Heads up');
     await Toast.confirm('Delete this?', { title: 'Confirm', variant: 'danger' });
   ============================================================================ */

#larkon-toast-container {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 10500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100vw - 32px);
}

.larkon-toast {
    pointer-events: auto;
    background: #18181b;
    color: #e6e6e6;
    border: 1px solid #2a2a30;
    border-left: 4px solid #4ade80;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    transform: translateX(420px);
    opacity: 0;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
    position: relative;
    overflow: hidden;
}

.larkon-toast.is-shown {
    transform: translateX(0);
    opacity: 1;
}

.larkon-toast.is-leaving {
    transform: translateX(420px);
    opacity: 0;
}

.larkon-toast-icon {
    flex-shrink: 0;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    margin-top: 1px;
}

.larkon-toast-body {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.larkon-toast-title {
    font-weight: 600;
    margin: 0 0 2px;
    font-size: 13px;
    color: inherit;
}

.larkon-toast-message {
    margin: 0;
    color: #cbd5e1;
    font-size: 12.5px;
}

.larkon-toast-close {
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    margin: -2px -4px -2px 0;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

.larkon-toast-close:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #e6e6e6;
}

.larkon-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: currentColor;
    opacity: .35;
    width: 100%;
    transform-origin: left;
    animation: larkon-toast-progress linear forwards;
}

@keyframes larkon-toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.larkon-toast.is-success { border-left-color: #22c55e; color: #86efac; }
.larkon-toast.is-error   { border-left-color: #ef4444; color: #fca5a5; }
.larkon-toast.is-warning { border-left-color: #f59e0b; color: #fcd34d; }
.larkon-toast.is-info    { border-left-color: #3b82f6; color: #93c5fd; }

/* Light theme */
html[data-bs-theme="light"] .larkon-toast {
    background: #ffffff;
    color: #18181b;
    border-color: #e4e4e7;
}
html[data-bs-theme="light"] .larkon-toast-message { color: #475569; }
html[data-bs-theme="light"] .larkon-toast-close { color: #64748b; }
html[data-bs-theme="light"] .larkon-toast-close:hover { background: rgba(0, 0, 0, 0.06); color: #18181b; }
html[data-bs-theme="light"] .larkon-toast.is-success { color: #15803d; }
html[data-bs-theme="light"] .larkon-toast.is-error   { color: #b91c1c; }
html[data-bs-theme="light"] .larkon-toast.is-warning { color: #b45309; }
html[data-bs-theme="light"] .larkon-toast.is-info    { color: #1d4ed8; }

/* Mobile */
@media (max-width: 640px) {
    #larkon-toast-container {
        top: 64px;
        right: 8px;
        left: 8px;
        max-width: none;
        width: auto;
    }
    .larkon-toast {
        transform: translateY(-200px);
    }
    .larkon-toast.is-shown { transform: translateY(0); }
    .larkon-toast.is-leaving { transform: translateY(-200px); }
}

/* ----------------------------------------------------------------------------
   Confirm dialog (Toast.confirm) — replaces window.confirm()
   ---------------------------------------------------------------------------- */
.larkon-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10600;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .18s ease;
    padding: 16px;
}
.larkon-confirm-backdrop.is-shown { opacity: 1; }

.larkon-confirm-card {
    background: #18181b;
    color: #e6e6e6;
    border: 1px solid #2a2a30;
    border-radius: 14px;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
    max-width: 440px;
    width: 100%;
    padding: 22px 22px 18px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transform: scale(.94);
    transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.larkon-confirm-backdrop.is-shown .larkon-confirm-card { transform: scale(1); }

html[data-bs-theme="light"] .larkon-confirm-card {
    background: #ffffff;
    color: #18181b;
    border-color: #e4e4e7;
}

.larkon-confirm-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.larkon-confirm-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.larkon-confirm-icon.is-danger  { background: rgba(239, 68, 68, .15); color: #ef4444; }
.larkon-confirm-icon.is-warning { background: rgba(245, 158, 11, .15); color: #f59e0b; }
.larkon-confirm-icon.is-info    { background: rgba(59, 130, 246, .15); color: #3b82f6; }
.larkon-confirm-icon.is-success { background: rgba(34, 197, 94, .15); color: #22c55e; }

.larkon-confirm-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.larkon-confirm-message {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.55;
    margin: 4px 0 16px 0;
    white-space: pre-wrap;
}
html[data-bs-theme="light"] .larkon-confirm-message { color: #475569; }

.larkon-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.larkon-confirm-btn {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    min-width: 96px;
}

.larkon-confirm-btn.is-cancel {
    background: transparent;
    color: #cbd5e1;
    border-color: #36363c;
}
.larkon-confirm-btn.is-cancel:hover {
    background: rgba(148, 163, 184, .08);
    color: #ffffff;
}
html[data-bs-theme="light"] .larkon-confirm-btn.is-cancel {
    color: #475569;
    border-color: #e4e4e7;
}
html[data-bs-theme="light"] .larkon-confirm-btn.is-cancel:hover {
    background: #f4f4f5;
    color: #18181b;
}

.larkon-confirm-btn.is-confirm { color: #ffffff; }
.larkon-confirm-btn.is-confirm.v-danger  { background: #dc2626; border-color: #dc2626; }
.larkon-confirm-btn.is-confirm.v-danger:hover  { background: #b91c1c; border-color: #b91c1c; }
.larkon-confirm-btn.is-confirm.v-warning { background: #d97706; border-color: #d97706; }
.larkon-confirm-btn.is-confirm.v-warning:hover { background: #b45309; border-color: #b45309; }
.larkon-confirm-btn.is-confirm.v-info    { background: #2563eb; border-color: #2563eb; }
.larkon-confirm-btn.is-confirm.v-info:hover    { background: #1d4ed8; border-color: #1d4ed8; }
.larkon-confirm-btn.is-confirm.v-success { background: #16a34a; border-color: #16a34a; }
.larkon-confirm-btn.is-confirm.v-success:hover { background: #15803d; border-color: #15803d; }
