/* Chatbot & FAB Container */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1050;
}

/* Floating Action Buttons */
.fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    text-decoration: none;
    border: none;
}

.fab-btn:hover {
    transform: scale(1.1);
    color: white;
}

.fab-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    animation: pulse-green 2s infinite;
}

.fab-whatsapp:hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    animation: none;
}

.fab-chatbot {
    background: linear-gradient(135deg, #FF5722, #FF9800);
}

.fab-chatbot:hover {
    box-shadow: 0 6px 20px rgba(15, 107, 69, 0.4);
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1050;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--about-primary, #FF5722), #FFC107);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FF5722;
    font-size: 20px;
}

.chatbot-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #25D366;
    border-radius: 50%;
    display: inline-block;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chatbot-close:hover {
    opacity: 1;
}

/* Body */
.chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Custom Scrollbar for Chat Body */
.chatbot-body::-webkit-scrollbar {
    width: 6px;
}

.chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Messages */
.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #FF5722, var(--about-accent, #FF9800));
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 10px rgba(15, 107, 69, 0.2);
}

.msg-bot p,
.msg-user p {
    margin-bottom: 0;
}

.msg-bot a {
    color: #FF5722;
    font-weight: 600;
    text-decoration: underline;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.quick-action-btn {
    background: rgba(15, 107, 69, 0.1);
    color: #FF5722;
    border: 1px solid rgb(255 87 34 / 23%);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: var(--caremed-orange-gradient);
    color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    gap: 4px;
    align-items: center;
}

.typing-indicator.active {
    display: flex;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
        background: var(--about-primary, #0F6B45);
    }
}

/* Input Area */
.chatbot-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 12px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--about-primary, #0F6B45);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    background: #FF5722;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s, background 0.2s;
}

.chatbot-send:hover {
    transform: scale(1.05);
    background: #ff7622;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        transform: translateY(100%);
    }

    .fab-container {
        bottom: 20px;
        right: 20px;
    }
}

.fab-call {
    background: linear-gradient(135deg, #242525, #0f0f0f);
}

.fab-call:hover {
    box-shadow: 0 6px 20px rgba(16, 68, 130, 0.4);
}