/* Multivoice Chatbot — Brand Theme */

:root {
    --bg-primary: #0b0f17;
    --bg-secondary: #121a2a;
    --bg-surface: #0b1220;
    --bg-card: #162035;
    --accent: #a9c7ff;
    --accent-dim: #4a6a9f;
    --text-primary: #e7eefc;
    --text-secondary: #8a9bc0;
    --text-muted: #5a6a8a;
    --success: #87f7b6;
    --error: #ff9aa2;
    --border: rgba(169, 199, 255, 0.08);
    --border-strong: rgba(169, 199, 255, 0.15);
    --bubble-user: #1b3a6b;
    --bubble-bot: #1a2238;
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.chat-header .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #6b8fd4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.chat-header .header-text h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.chat-header .header-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

/* Message bubbles */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: msg-in 0.3s ease-out;
}

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

.message.bot {
    align-self: flex-start;
}

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

.message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.message.bot .avatar {
    background: linear-gradient(135deg, var(--accent), #6b8fd4);
    color: var(--bg-primary);
    font-weight: 700;
}

.message.user .avatar {
    background: var(--accent-dim);
    color: var(--text-primary);
}

.message .bubble {
    padding: 12px 16px;
    line-height: 1.55;
    font-size: 14px;
    border: 1px solid var(--border);
}

.message.bot .bubble {
    background: var(--bubble-bot);
    border-radius: 4px var(--radius) var(--radius) var(--radius);
    color: var(--text-primary);
}

.message.user .bubble {
    background: var(--bubble-user);
    border-radius: var(--radius) 4px var(--radius) var(--radius);
    color: var(--text-primary);
    border-color: rgba(169, 199, 255, 0.12);
}

.message .bubble p {
    margin-bottom: 8px;
}
.message .bubble p:last-child {
    margin-bottom: 0;
}

.message .bubble ul, .message .bubble ol {
    margin: 4px 0 8px 20px;
}
.message .bubble li {
    margin-bottom: 2px;
}

.message .bubble strong {
    color: var(--accent);
    font-weight: 600;
}

.message .bubble code {
    background: rgba(169, 199, 255, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 13px;
}

/* Typing indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    gap: 10px;
    max-width: 85%;
}

.typing-indicator.visible {
    display: flex;
}

.typing-indicator .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6b8fd4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.typing-indicator .dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
    background: var(--bubble-bot);
    border-radius: 4px var(--radius) var(--radius) var(--radius);
    border: 1px solid var(--border);
}

.typing-indicator .dot {
    width: 7px;
    height: 7px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

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

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

/* Input area */
.chat-input-area {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.chat-input-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-wrap textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-wrap textarea::placeholder {
    color: var(--text-muted);
}

.chat-input-wrap textarea:focus {
    border-color: var(--accent-dim);
}

.chat-input-wrap button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #6b8fd4);
    color: var(--bg-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.1s;
}

.chat-input-wrap button:hover {
    opacity: 0.9;
}
.chat-input-wrap button:active {
    transform: scale(0.95);
}
.chat-input-wrap button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.chat-footer {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Mobile */
@media (max-width: 600px) {
    .chat-header {
        padding: 12px 16px;
    }
    .chat-messages {
        padding: 16px;
        gap: 12px;
    }
    .message {
        max-width: 92%;
    }
    .chat-input-area {
        padding: 12px 16px 16px;
    }
    .chat-header .header-text h1 {
        font-size: 15px;
    }
}
