/**
 * Workflow AI Chat Styles
 * Extracted from workflows.html - Chat panel, messages, typing indicators
 */

/* ============== WORLD-CLASS AI ASSISTANT ============== */

.wf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}

.wf-chat-msg {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: msgSlideIn 0.3s ease-out;
}

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

.wf-chat-msg.user {
    flex-direction: row-reverse;
}

.wf-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.wf-chat-msg.assistant .wf-chat-avatar {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
}

.wf-chat-msg.user .wf-chat-avatar {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: white;
}

.wf-chat-bubble {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.wf-chat-msg.assistant .wf-chat-bubble {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-top-left-radius: 4px;
    color: #e2e8f0;
}

.wf-chat-msg.user .wf-chat-bubble {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: white;
    border-top-right-radius: 4px;
}

/* Thinking Indicator */
.wf-thinking {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    border-top-left-radius: 4px;
}

.wf-thinking-icon {
    width: 24px;
    height: 24px;
    border: 2px solid #8b5cf6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.wf-thinking-text {
    font-size: 13px;
    color: #a78bfa;
}

/* Typing Dots */
.wf-typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.wf-typing-dots span {
    width: 8px;
    height: 8px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Typing Cursor */
.wf-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: #8b5cf6;
    margin-left: 2px;
    animation: cursorBlink 0.8s infinite;
    vertical-align: middle;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Chat Input */
.wf-chat-input-wrap {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.2);
}

.wf-chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    transition: all 0.2s;
}

.wf-chat-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.wf-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.wf-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.wf-chat-send-btn.stop {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Quick Actions - Premium */
.wf-quick-actions {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, transparent 100%);
}

.wf-quick-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    color: #c4b5fd;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.wf-quick-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.wf-quick-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(59, 130, 246, 0.18) 100%);
    border-color: rgba(139, 92, 246, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
    color: #e9d5ff;
}

.wf-quick-btn:hover i {
    transform: scale(1.15);
}

/* Different colors for quick action buttons */
.wf-quick-btn:nth-child(1) { /* ML Model - purple */
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(124, 58, 237, 0.08) 100%);
    border-color: rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
}
.wf-quick-btn:nth-child(1):hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(124, 58, 237, 0.18) 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

.wf-quick-btn:nth-child(2) { /* Nudge - amber */
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-color: rgba(251, 191, 36, 0.25);
    color: #fcd34d;
}
.wf-quick-btn:nth-child(2):hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(245, 158, 11, 0.18) 100%);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.25);
    color: #fde68a;
}

.wf-quick-btn:nth-child(3) { /* A/B Test - green */
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-color: rgba(52, 211, 153, 0.25);
    color: #6ee7b7;
}
.wf-quick-btn:nth-child(3):hover {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.25) 0%, rgba(16, 185, 129, 0.18) 100%);
    box-shadow: 0 4px 15px rgba(52, 211, 153, 0.25);
    color: #a7f3d0;
}

.wf-quick-btn:nth-child(4) { /* BPMN - pink */
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.12) 0%, rgba(236, 72, 153, 0.08) 100%);
    border-color: rgba(244, 114, 182, 0.25);
    color: #f9a8d4;
}
.wf-quick-btn:nth-child(4):hover {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.25) 0%, rgba(236, 72, 153, 0.18) 100%);
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.25);
    color: #fbcfe8;
}

.wf-quick-btn:nth-child(5) { /* Explain - blue */
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-color: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}
.wf-quick-btn:nth-child(5):hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.18) 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}

/* AI Header */
.wf-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #8b5cf6 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.wf-ai-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wf-ai-logo {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.wf-ai-pulse {
    position: absolute;
    inset: -4px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0; }
}

.wf-ai-info {
    display: flex;
    flex-direction: column;
}

.wf-ai-name {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.wf-ai-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.wf-ai-status i {
    color: #fbbf24;
}

.wf-ai-clear {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wf-ai-clear:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Welcome Screen */
.wf-ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    position: relative;
}

.wf-welcome-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    top: -20px;
    animation: welcomeGlow 3s ease-in-out infinite;
}

@keyframes welcomeGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.wf-welcome-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.wf-ai-welcome h3 {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px;
}

.wf-ai-welcome > p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    max-width: 280px;
    margin: 0 0 20px;
    line-height: 1.5;
}

.wf-welcome-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.wf-welcome-card {
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.wf-welcome-card:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.wf-welcome-card i {
    font-size: 18px;
    color: #8b5cf6;
    display: block;
    margin-bottom: 6px;
}

.wf-welcome-card span {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    display: block;
    margin-bottom: 2px;
}

.wf-welcome-card small {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* Input Tools */
.wf-input-tools {
    display: flex;
    gap: 4px;
    margin-right: 8px;
}

.wf-input-tool {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wf-input-tool:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.wf-input-tool.active {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    animation: voicePulse 1.5s infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Input Hint */
.wf-input-hint {
    display: flex;
    justify-content: space-between;
    padding: 6px 16px 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

/* Message Actions */
.wf-msg-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.wf-chat-msg:hover .wf-msg-actions {
    opacity: 1;
}

.wf-msg-action {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.wf-msg-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Thinking State */
.wf-chat-msg.thinking .wf-chat-avatar {
    position: relative;
}

.wf-chat-msg.thinking .wf-chat-avatar::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid #8b5cf6;
    border-top-color: transparent;
    border-radius: 12px;
    animation: spin 1s linear infinite;
}

/* Stop Button */
.wf-chat-send-btn.stop {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: stopPulse 1.5s infinite;
}

@keyframes stopPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Code in messages */
.wf-chat-bubble code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #a78bfa;
}

.wf-chat-bubble pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    position: relative;
}

.wf-chat-bubble pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
}

/* Lists */
.wf-chat-bubble ul, .wf-chat-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.wf-chat-bubble li {
    margin: 4px 0;
}

.wf-chat-bubble strong {
    color: #a78bfa;
}
