/* assets/agilsoft_ai_widget.css - WIDGET WEB OMNICANAL AGILSOFT AI */
:root {
    --ai-primary: #2563eb;
    --ai-primary-hover: #1d4ed8;
    --ai-secondary: #0f172a;
    --ai-accent: #10b981;
    --ai-bg-light: #f8fafc;
    --ai-text-dark: #1e293b;
    --ai-text-muted: #64748b;
    --ai-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    --ai-radius: 16px;
    --ai-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.ai-widget-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: var(--ai-shadow);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-widget-button:hover {
    transform: scale(1.06);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.35);
}

.ai-widget-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--ai-accent);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 10px;
    border: 2px solid #ffffff;
}

.ai-widget-container {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: var(--ai-radius);
    box-shadow: var(--ai-shadow);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--ai-font);
    border: 1px solid rgba(226, 232, 240, 0.8);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ai-widget-container.ai-active,
.ai-widget-container.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* HEADER */
.ai-widget-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-widget-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ai-widget-header-text h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.ai-widget-header-text span {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ai-accent);
    box-shadow: 0 0 8px var(--ai-accent);
}

.ai-widget-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: color 0.2s ease;
}

.ai-widget-close:hover {
    color: #ffffff;
}

/* AGENT BAR */
.ai-agent-bar {
    background: #f1f5f9;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
}

.ai-agent-tag {
    background: #e2e8f0;
    color: #0f172a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
}

/* CHAT BODY */
.ai-widget-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: var(--ai-bg-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg {
    max-width: 84%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg.ia {
    align-self: flex-start;
    background: #ffffff;
    color: var(--ai-text-dark);
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ai-msg.usuario {
    align-self: flex-end;
    background: var(--ai-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.ai-pill {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-pill:hover {
    background: var(--ai-primary);
    color: #ffffff;
    border-color: var(--ai-primary);
    transform: translateY(-1px);
}

/* TYPING INDICATOR */
.ai-typing {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
}

.ai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: bounce 1.2s infinite ease-in-out;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* FOOTER INPUT */
.ai-widget-footer {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-widget-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.ai-widget-input:focus {
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ai-widget-send {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: var(--ai-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ai-widget-send:hover {
    background: var(--ai-primary-hover);
}
