/* ==========================================================================
   Chatbot Floating Widget - VVT Global Style (Terracota & Amarillo)
   ========================================================================== */

/* Chatbot Floating Button */
.chatbot-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #c06a58, #e7b468);
    /* Terracota to Amarillo Gradient */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 26px;
    box-shadow: 0 8px 25px rgba(192, 106, 88, 0.4);
    /* Terracota matching shadow */
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 30px rgba(192, 106, 88, 0.6);
}

.chatbot-fab.active {
    transform: rotate(90deg);
    background: #e15b5b;
    /* Soft Red to close */
    box-shadow: 0 8px 25px rgba(225, 91, 91, 0.4);
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 580px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(192, 106, 88, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    font-family: 'Outfit', 'Poppins', sans-serif;
    border: 1px solid rgba(192, 106, 88, 0.1);
}

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

/* Header */
.chat-header {
    background: linear-gradient(135deg, #c06a58, #d88e74);
    /* Terracota Gradient Header */
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bot-avatar {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e7b468;
    /* Amarillo border */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

.chat-info h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #ffffff;
}

.chat-info span {
    font-size: 0.8rem;
    color: #ffdcb0;
    /* Light Amarillo text */
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    margin-top: 2px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    /* Green status dot */
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

#closeChatIcon {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    font-size: 16px;
    padding: 5px;
}

#closeChatIcon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fdfbf9;
    /* Warm Sandstone Light background */
}

/* Slim Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(192, 106, 88, 0.3);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(192, 106, 88, 0.6);
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.45;
    position: relative;
    word-wrap: break-word;
    box-sizing: border-box;
    animation: fadeInSlide 0.25s ease forwards;
}

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

.message.bot {
    align-self: flex-start;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    color: #2c3e50;
    border-bottom-left-radius: 4px;
    border: 1px solid #f1e7db;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #c06a58, #d38573);
    /* Terracota gradient for user */
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(192, 106, 88, 0.2);
    border-bottom-right-radius: 4px;
}

/* Markdown Styles in Bot Messages */
.message.bot ul, .message.bot ol {
    padding-left: 20px;
    margin: 6px 0;
}

.message.bot li {
    margin-bottom: 4px;
}

.message.bot strong {
    color: #c06a58;
    /* Highlight bold with terracota */
    font-weight: 700;
}

.message.bot p {
    margin: 0 0 8px;
}

.message.bot p:last-child {
    margin: 0;
}

.message.bot a {
    color: #c06a58;
    text-decoration: underline;
    font-weight: 500;
}

.message.bot a:hover {
    color: #a25141;
}

/* Input Area */
.chat-input-area {
    padding: 15px 20px;
    background: #ffffff;
    border-top: 1px solid #f1e7db;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    background: #faf6f0;
    border: 2px solid transparent;
    padding: 10px 16px;
    border-radius: 24px;
    color: #2c3e50;
    outline: none;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.chat-input-area input:focus {
    background: #ffffff;
    border-color: #c06a58;
    /* Terracota focus border */
    box-shadow: 0 0 0 3px rgba(192, 106, 88, 0.1);
}

.chat-send-btn {
    background: #c06a58;
    /* Terracota button */
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(192, 106, 88, 0.3);
}

.chat-send-btn:hover {
    background: #a25141;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(192, 106, 88, 0.4);
}

.chat-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Typing Indicator */
.typing-indicator {
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    border: 1px solid #f1e7db;
    width: fit-content;
    display: none;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    align-self: flex-start;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: #e7b468;
    /* Amarillo dots */
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    opacity: 0.7;
}

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

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
    background: #c06a58;
    /* Terracota dot */
}

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

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}
