/**
 * Convexa AI Chat Agent - Minimalistic Frontend Styles
 */

/* Modern minimalist chatbot widget */
.convexa-chatbot-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --primary-color: #000;
    --text-color: #333;
    --bg-light: #f8f9fa;
    --border-color: #e5e7eb;
}

/* Floating chat button - Minimalistic */
.convexa-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.convexa-chat-button {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convexa-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Chat window - Clean and minimal */
.convexa-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.convexa-chat-window.active {
    display: flex;
}

/* Header - Minimal */
.convexa-chat-header {
    background: #fff;
    color: var(--text-color);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.convexa-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.convexa-chat-header button {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.convexa-chat-header button:hover {
    background: var(--bg-light);
    color: var(--text-color);
}

/* Messages area */
.convexa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-light);
}

.convexa-message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.convexa-message.user {
    justify-content: flex-end;
}

.convexa-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.convexa-message.user .convexa-message-content {
    background: var(--primary-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.convexa-message.bot .convexa-message-content {
    background: #fff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* Input area - Minimal */
.convexa-chat-input {
    padding: 16px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

.convexa-chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: all 0.2s;
}

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

.convexa-chat-input button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.convexa-chat-input button:hover {
    opacity: 0.9;
}

.convexa-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator */
.convexa-typing-indicator {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
}

.convexa-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.convexa-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.convexa-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Error message */
.convexa-error-message {
    background: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 12px;
    margin: 8px 0;
    font-size: 13px;
    border: 1px solid #fcc;
}

/* Powered by */
.convexa-powered-by {
    text-align: center;
    font-size: 11px;
    color: #999;
    padding: 8px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .convexa-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .convexa-chat-button {
        bottom: 16px;
        right: 16px;
    }
}
