/* ═══════════════════════════════════════════════════════════
   LUNA TICKETS — AJAX / TOAST / TYPING / AI STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── Toast Notifications ── */
.luna-tk-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 400px;
}

.luna-tk-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.97), rgba(20, 20, 35, 0.97));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.luna-tk-toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.luna-tk-toast--exit {
    transform: translateX(120%);
    opacity: 0;
}

.luna-tk-toast-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.luna-tk-toast--success .luna-tk-toast-icon {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}
.luna-tk-toast--success { border-left: 3px solid #34d399; }

.luna-tk-toast--error .luna-tk-toast-icon {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}
.luna-tk-toast--error { border-left: 3px solid #f87171; }

.luna-tk-toast--warning .luna-tk-toast-icon {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}
.luna-tk-toast--warning { border-left: 3px solid #fbbf24; }

.luna-tk-toast--info .luna-tk-toast-icon {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}
.luna-tk-toast--info { border-left: 3px solid #60a5fa; }

.luna-tk-toast-message {
    flex: 1;
    line-height: 1.4;
}

.luna-tk-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
    line-height: 1;
}
.luna-tk-toast-close:hover { color: #ffffff; }


/* ── Typing Indicator ── */
.luna-tk-typing-indicator .luna-tk-typing-dots {
    display: flex;
    gap: 5px;
    padding: 8px 0;
}

.luna-tk-typing-dots span {
    width: 8px;
    height: 8px;
    background: rgba(96, 165, 250, 0.4);
    border-radius: 50%;
    animation: luna-tk-typing 1.4s infinite ease-in-out;
}

.luna-tk-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.luna-tk-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes luna-tk-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.luna-tk-ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(167, 139, 250, 0.15));
    border: 2px solid rgba(96, 165, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}


/* ── Spinner ── */
.luna-tk-quick-replies { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.luna-tk-quick-reply { border: 1px solid rgba(148, 163, 184, .35); border-radius: 999px; background: rgba(148, 163, 184, .08); color: inherit; cursor: pointer; font: inherit; font-size: 13px; padding: 7px 12px; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.luna-tk-quick-reply:hover, .luna-tk-quick-reply:focus-visible { border-color: #818cf8; background: rgba(99, 102, 241, .14); outline: none; transform: translateY(-1px); }

.luna-tk-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: luna-tk-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes luna-tk-spin {
    to { transform: rotate(360deg); }
}


/* ── AI Staff Response Badges ── */
.luna-tk-agent-badge--ai,
.luna-tk-msg--agent .luna-tk-agent-badge:contains('AI') {
    background: rgba(167, 139, 250, 0.1) !important;
    border-color: rgba(167, 139, 250, 0.2) !important;
    color: #a78bfa !important;
}

.luna-tk-ai-action-badge {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2px 7px;
    border-radius: 100px;
    margin-left: 4px;
}

.luna-tk-ai-action--set_status_completed,
.luna-tk-ai-action--verify_blockchain_then_set {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.luna-tk-ai-action--set_status_on_hold {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.luna-tk-ai-action--escalate {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Blockchain result indicator in conversation */
.luna-tk-blockchain-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.luna-tk-blockchain-status--confirmed {
    background: rgba(52, 211, 153, 0.08);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.15);
}

.luna-tk-blockchain-status--pending {
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.luna-tk-blockchain-status--failed {
    background: rgba(248, 113, 113, 0.08);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.15);
}

/* Live updates, input safety and guarded AI suggestions */
.luna-tk-live-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #34d399;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.luna-tk-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.08);
}

.luna-tk-live-status--error { color: #f87171; }
.luna-tk-character-count { display: block; margin-top: 6px; color: rgba(255,255,255,0.48); font-size: 11px; text-align: right; }
.luna-tk-character-count--near-limit { color: #fbbf24; }
.luna-tk-character-count--at-limit { color: #f87171; font-weight: 700; }
.luna-tk-ai-suggestion--guarded { border-color: rgba(248, 113, 113, 0.35) !important; background: rgba(248, 113, 113, 0.06) !important; }

@media (max-width: 640px) {
    .luna-tk-live-status { white-space: normal; }
}
