/* TOKAI AGENT WIDGET - Tailwind Mirror Styles */

:root {
    --t-slate-950: #020617;
    --t-slate-900: #0f172a;
    --t-slate-800: #1e293b;
    --t-slate-400: #94a3b8;
    --t-slate-200: #e2e8f0;
    --t-indigo-600: #4f46e5;
    --t-indigo-500: #6366f1;
    --t-indigo-400: #818cf8;
    --t-green-400: #4ade80;
    
    /* Variables dinámicas */
    --tw-bg-main: var(--t-slate-950);
    --tw-bg-header: var(--t-slate-900);
    --tw-bg-footer: var(--t-slate-900);
    --tw-border: var(--t-slate-800);
    --tw-text: var(--t-slate-200);
    --tw-msg-user-bg: var(--t-indigo-600);
    --tw-msg-bot-bg: var(--t-slate-800);
    --tw-powered: var(--t-slate-400);
}

.tokai-light {
    --tw-bg-main: #ffffff;
    --tw-bg-header: #f8fafc;
    --tw-bg-footer: #f8fafc;
    --tw-border: #e2e8f0;
    --tw-text: #0f172a;
    --tw-msg-user-bg: #4f46e5;
    --tw-msg-bot-bg: #f1f5f9;
    --tw-powered: #94a3b8;
}

.tokai-widget-wrapper { position: fixed; bottom: 24px; right: 24px; z-index: 9999; font-family: inherit; }
.tokai-launcher { width: 56px; height: 56px; border-radius: 9999px; background-color: var(--t-indigo-600); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); transition: transform 0.2s; }
.tokai-launcher:hover { transform: scale(1.05); }
.tokai-launcher svg { width: 24px; height: 24px; }

.tokai-panel { position: fixed; bottom: 90px; right: 24px; width: 384px; height: 576px; max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); background-color: var(--tw-bg-main); color: var(--tw-text); border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.25); display: flex; flex-direction: column; opacity: 0; pointer-events: none; transform: translateY(10px) scale(0.95); transform-origin: bottom right; transition: all 0.2s cubic-bezier(0.4,0,0.2,1); border: 1px solid var(--tw-border); }
.tokai-open .tokai-panel { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.tokai-open .tokai-launcher { display: none; }

.tokai-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background-color: var(--tw-bg-header); border-bottom: 1px solid var(--tw-border); }
.tokai-header-content { display: flex; align-items: center; gap: 8px; }
.tokai-avatar-img { width: 32px; height: 32px; border-radius: 9999px; object-fit: cover; }
.tokai-avatar-placeholder { width: 32px; height: 32px; border-radius: 9999px; background-color: var(--t-indigo-600); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; }
.tokai-agent-name { font-size: 14px; font-weight: 500; margin: 0; color: var(--tw-text); line-height: 1.25; }
.tokai-agent-status { font-size: 10px; color: var(--t-green-400); display: flex; align-items: center; gap: 4px; }
.tokai-status-dot { width: 6px; height: 6px; border-radius: 9999px; background-color: var(--t-green-400); display: inline-block; }
.tokai-close-btn { background: transparent; border: none; color: #94a3b8; cursor: pointer; font-size: 24px; line-height: 1; }

.tokai-messages-container { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.tokai-msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.tokai-msg-user { align-self: flex-end; background-color: var(--tw-msg-user-bg); color: #fff; }
.tokai-msg-bot { align-self: flex-start; background-color: var(--tw-msg-bot-bg); color: var(--tw-text); }

/* Footer Area with Powered By */
.tokai-footer-wrapper { background-color: var(--tw-bg-footer); border-top: 1px solid var(--tw-border); padding: 12px 16px; }
.tokai-input-wrapper { position: relative; background-color: var(--tw-bg-main); border: 1px solid var(--tw-border); border-radius: 8px; padding: 8px; display: flex; align-items: flex-end; }
.tokai-input-wrapper:focus-within { border-color: var(--t-indigo-500); }
.tokai-textarea { width: 100%; background: transparent; border: none; color: var(--tw-text); font-size: 14px; padding: 4px; padding-right: 32px; resize: none; outline: none; max-height: 120px; font-family: inherit; }
.tokai-send-btn { position: absolute; right: 8px; bottom: 8px; background: transparent; border: none; padding: 4px; color: var(--t-indigo-400); cursor: pointer; transition: color 0.2s; }
.tokai-send-btn:hover { color: var(--t-indigo-500); }
.tokai-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tokai-send-btn svg { width: 20px; height: 20px; }

/* Powered By */
.tokai-powered { margin-top: 8px; font-size: 10px; color: var(--tw-powered); text-align: center; }
.tokai-powered a { color: inherit; text-decoration: none; font-weight: 600; }
.tokai-powered a:hover { text-decoration: underline; }

/* TYPING INDICATOR */
.tokai-typing { display: flex; align-items: center; gap: 4px; padding: 12px 16px; min-height: 38px; }
.tokai-typing-dot { width: 6px; height: 6px; background-color: #94a3b8; border-radius: 50%; animation: tokaiBounce 1.4s infinite ease-in-out both; }
.tokai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.tokai-typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes tokaiBounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }