/* 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 8px 24px rgba(0, 0, 0, 0.12);
    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) translateY(-2px);
    color: white;
}

.fab-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    animation: pulse-green 2s infinite;
}

.fab-whatsapp:hover {
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.45);
    animation: none;
}

.fab-chatbot {
    background: linear-gradient(135deg, #00a651, #007d3c);
    box-shadow: 0 8px 24px rgba(0, 166, 81, 0.25);
}

.fab-chatbot:hover {
    box-shadow: 0 10px 28px rgba(0, 166, 81, 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: 105px;
    right: 30px;
    width: 370px;
    height: 560px;
    max-height: calc(100vh - 130px);
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(3, 43, 92, 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.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(3, 43, 92, 0.08);
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #032b5c, #0a4385);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.chatbot-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.chatbot-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chatbot-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #25D366;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(37, 211, 102, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Body */
.chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Custom Scrollbar for Chat Body */
.chatbot-body::-webkit-scrollbar {
    width: 5px;
}

.chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: rgba(3, 43, 92, 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 cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(3, 43, 92, 0.04);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-bot {
    align-self: flex-start;
    background: #ffffff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(3, 43, 92, 0.05);
}

.msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #00a651, #008541);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 166, 81, 0.2);
}

.msg-bot p,
.msg-user p {
    margin-bottom: 0;
}

.msg-bot a {
    color: #00a651;
    font-weight: 700;
    text-decoration: underline;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-action-btn {
    background: rgba(0, 166, 81, 0.05);
    color: #00a651;
    border: 1px solid rgba(0, 166, 81, 0.2);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: 600;
}

.quick-action-btn:hover {
    background: #00a651;
    color: white;
    border-color: #00a651;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 166, 81, 0.15);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: white;
    padding: 14px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(3, 43, 92, 0.05);
    gap: 5px;
    align-items: center;
}

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

.typing-dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    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.6);
        background: #cbd5e1;
    }
    40% {
        transform: scale(1.1);
        background: #00a651;
    }
}

/* Input Area */
.chatbot-footer {
    padding: 16px;
    background: white;
    border-top: 1px solid rgba(3, 43, 92, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    background: #f8fafc;
    color: #1e293b;
}

.chatbot-input:focus {
    border-color: #00a651;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: #00a651;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0, 166, 81, 0.2);
}

.chatbot-send:hover {
    transform: scale(1.05);
    background: #008541;
    box-shadow: 0 5px 12px rgba(0, 166, 81, 0.35);
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        transform: translateY(100%);
    }

    .fab-container {
        bottom: 20px;
        right: 20px;
    }
}