:root {
    --chat-primary: #0d6efd;
    /* Bootstrap Primary or Site Brand Color */
    --chat-secondary: #6c757d;
    --chat-bg: #ffffff;
    --chat-header-text: #ffffff;
    --chat-user-msg-bg: #e9ecef;
    --chat-bot-msg-bg: #e7f1ff;
    --chat-font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#jaraba-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--chat-font-family);
}

#chat-toggle-btn {
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.3s;
}

#chat-toggle-btn:hover {
    transform: scale(1.1);
}

#whatsapp-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25d366;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s;
    z-index: 9999;
}

#whatsapp-floating-btn:hover {
    transform: scale(1.1);
    color: white;
}

#chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background-color: var(--chat-bg);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

#chat-container.open {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.chat-header {
    background-color: var(--chat-primary);
    color: var(--chat-header-text);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f8f9fa;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.chat-message.bot {
    align-self: flex-start;
    background-color: var(--chat-bg);
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 2px;
    color: #333;
}

.chat-message.user {
    align-self: flex-end;
    background-color: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    background: white;
    display: flex;
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

#chat-send,
#chat-mic {
    background: var(--chat-primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-mic.listening {
    background: #dc3545;
    animation: pulse 1.5s infinite;
}

#chat-speaker {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 10px;
}

#chat-speaker.muted {
    opacity: 0.5;
    text-decoration: line-through;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.chat-option-btn {
    background-color: white;
    border: 1px solid var(--chat-primary);
    color: var(--chat-primary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-option-btn:hover {
    background-color: var(--chat-primary);
    color: white;
}

/* Form Styles inside Chat */
.chat-form {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-top: 5px;
}

.chat-form-group {
    margin-bottom: 10px;
}

.chat-form-group label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: #555;
}

.chat-form-control {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.chat-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-sm-chat {
    padding: 5px 10px;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.btn-primary-chat {
    background-color: var(--chat-primary);
    color: white;
}

.btn-secondary-chat {
    background-color: #6c757d;
    color: white;
}

@media (max-width: 480px) {
    #chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}