/* Chatbot CSS - Professional Finance Design */
:root {
    --chat-primary: #0056b3;
    --chat-secondary: #f4f6f9;
    --chat-text: #333;
    --chat-bg: #ffffff;
    --chat-border: #e0e0e0;
    --chat-user-msg: #0056b3;
    --chat-bot-msg: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --chat-primary: #4da3ff;
        --chat-secondary: #2c2c2c;
        --chat-text: #e0e0e0;
        --chat-bg: #1e1e1e;
        --chat-border: #444;
        --chat-user-msg: #0056b3;
        --chat-bot-msg: #333;
    }
}

.dhani-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--chat-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.dhani-chat-toggle:hover {
    transform: scale(1.05);
}

.dhani-chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background-color: var(--chat-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid var(--chat-border);
}

.dhani-chat-widget.closed {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.chat-header {
    background-color: var(--chat-primary);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--chat-secondary);
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message {
    background-color: var(--chat-bot-msg);
    color: var(--chat-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-message {
    background-color: var(--chat-user-msg);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 15px;
    background-color: var(--chat-bg);
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 10px;
}

#chat-input-text {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    outline: none;
    background-color: var(--chat-bg);
    color: var(--chat-text);
}

.send-btn {
    background-color: var(--chat-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.typing-indicator {
    font-size: 12px;
    color: #888;
    margin-left: 10px;
    font-style: italic;
}

@media (max-width: 480px) {
    .dhani-chat-widget {
        width: calc(100vw - 40px);
        bottom: 80px;
    }
}
