:root {
    --primary-color: #0056b3; /* Blue from header */
    --text-color: #333;
    --bg-color: #f4f7f6;
    --white: #ffffff;
    --gray-light: #f0f0f0;
    --gray-medium: #e0e0e0;
    --accent-color: #e67e22; /* FAB background orange-ish */
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --animation-speed: 0.3s;
}

/* Chatbot scoped styles */


/* Widget Container */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

/* FAB Toggle Button */
.chat-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    animation: sk-bounce 2s infinite ease-in-out;
}

.chat-toggle:hover {
    transform: scale(1.05);
    animation-play-state: paused;
}

@keyframes sk-bounce {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 8px 25px rgba(230, 126, 34, 0.5); }
}

.avatar-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

#avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.online-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #2ecc71;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
}

/* Initial Bubble */
.initial-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    padding: 12px 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    width: 200px;
    animation: fadeInSlide 0.5s ease-out;
}

.initial-bubble p {
    margin: 0;
    font-size: 14px;
    color: var(--text-color);
}

.close-bubble {
    position: absolute;
    top: 5px;
    right: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #999;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform var(--animation-speed), opacity var(--animation-speed);
}

.chat-window.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* Header */
.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-name {
    font-weight: 600;
    font-size: 16px;
}

.header-actions button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.8;
}

.header-actions button:hover {
    opacity: 1;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fdfdfd;
}

.message {
    margin-bottom: 15px;
    max-width: 85%;
}

.message > strong {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.message p strong {
    display: inline !important;
}

.bot-message p {
    background: var(--gray-light);
    color: #1a1a1a !important;
    padding: 10px 15px;
    border-radius: 15px 15px 15px 5px;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.bot-message strong {
    color: #333 !important;
}

.user-message {
    align-self: flex-end;
    margin-left: auto;
}

.user-message p {
    background: var(--primary-color);
    color: white !important;
    padding: 10px 15px;
    border-radius: 15px 15px 5px 15px;
    margin: 0;
    font-size: 14px;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.option-btn {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    text-align: left;
}

.option-btn:hover {
    background: rgba(0, 86, 179, 0.05);
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--gray-medium);
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-widget #user-input {
    flex: 1;
    border: 1px solid var(--gray-medium);
    padding: 10px 15px !important;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

#chat-widget #user-input::placeholder {
    color: #666 !important;
}

#user-input:disabled {
    background-color: #f9f9f9;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.5;
}

#send-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

#send-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.5;
}

.brand-footer {
    font-size: 10px;
    color: #aaa;
    text-align: center;
    padding-bottom: 10px;
}

/* Animations */
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: var(--gray-light);
    border-radius: 15px 15px 15px 5px;
    width: fit-content;
    margin-bottom: 15px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}
