/**
 * Flow Chat Component Styles
 * Apple-inspired glassmorphism chat interface
 */

.flow-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--glass-background);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

/* Header */
.flow-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    background: var(--glass-background-dark);
}

.flow-chat-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.flow-chat-header-actions {
    display: flex;
    gap: 8px;
}

/* Messages container */
.flow-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Empty state / examples */
.flow-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 32px;
    text-align: center;
    color: var(--text-secondary);
}

.flow-chat-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.flow-chat-empty-subtitle {
    font-size: 13px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.flow-chat-examples {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 300px;
}

.flow-chat-example {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--glass-background-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: start;
}

.flow-chat-example:hover {
    background: var(--glass-background);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.flow-chat-example-icon {
    flex-shrink: 0;
    opacity: 0.6;
}

.flow-chat-example-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Message bubble */
.flow-chat-message {
    display: flex;
    gap: 10px;
    max-width: 95%;
    animation: messageSlideIn 0.2s ease;
}

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

.flow-chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.flow-chat-message.assistant {
    align-self: flex-start;
}

.flow-chat-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.flow-chat-message.user .flow-chat-message-avatar {
    background: var(--accent-primary);
    color: white;
}

.flow-chat-message.assistant .flow-chat-message-avatar {
    background: var(--glass-background-dark);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.flow-chat-message-content {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
}

.flow-chat-message.user .flow-chat-message-content {
    background: var(--accent-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.flow-chat-message.assistant .flow-chat-message-content {
    background: var(--glass-background-dark);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.flow-chat-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.flow-chat-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.flow-chat-typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.flow-chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.flow-chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error message */
.flow-chat-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #ef4444;
    font-size: 12px;
}

.flow-chat-error-icon {
    flex-shrink: 0;
}

/* Input area */
.flow-chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-background-dark);
}

.flow-chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 14px;
    background: var(--glass-background-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.15s ease;
}

.flow-chat-input::placeholder {
    color: var(--text-tertiary);
}

.flow-chat-input:focus {
    border-color: var(--accent-primary);
}

.flow-chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.flow-chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.flow-chat-send-btn:hover {
    background: var(--accent-primary-hover);
    transform: scale(1.02);
}

.flow-chat-send-btn:active {
    transform: scale(0.98);
}

.flow-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Flow summary in message */
.flow-chat-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
}

.flow-chat-summary-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flow-chat-summary-nodes {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flow-chat-summary-node {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.flow-chat-summary-node-number {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
}

.flow-chat-summary-node-name {
    color: var(--text-primary);
}

/* Loading state */
.flow-chat-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.flow-chat-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--glass-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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