/* ============================================
   CHATBOT WIDGET — Premium UI
   ============================================ */

/* Container */
.chatbot-widget {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 1000;
    font-family: 'Outfit', 'Inter', sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow:
        0 6px 25px rgba(26, 26, 46, 0.35),
        0 0 0 4px rgba(201, 168, 76, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(201, 168, 76, 0.3);
    outline: none;
    position: relative;
}

.chatbot-toggle::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(201, 168, 76, 0.15);
    animation: chatPulse 3s ease-in-out infinite;
}

@keyframes chatPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0; }
}

.chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow:
        0 10px 35px rgba(26, 26, 46, 0.45),
        0 0 0 4px rgba(201, 168, 76, 0.3);
}

.chatbot-toggle i {
    transition: transform 0.4s ease;
}

.chatbot-widget.active .chatbot-toggle i {
    transform: rotate(90deg);
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 75px;
    left: 0;
    width: 380px;
    height: 550px;
    background: #fff;
    border-radius: 24px;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.15),
        0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.92);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

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

/* ---- Header ---- */
.chat-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    padding: 1.2rem 1.4rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 120px;
    height: 120px;
    background: rgba(201, 168, 76, 0.08);
    border-radius: 50%;
}

.chat-header img.bot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.bot-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.bot-info h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.bot-info span {
    font-size: 0.72rem;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-weight: 500;
}

.bot-info span::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
}

.close-chat {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ---- Chat Body ---- */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: linear-gradient(180deg, #faf8f5 0%, #ffffff 100%);
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 168, 76, 0.3) transparent;
}

.chat-body::-webkit-scrollbar {
    width: 4px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 10px;
}

/* ---- Messages ---- */
.message {
    max-width: 82%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.6;
    animation: msgSlideIn 0.35s ease forwards;
    word-wrap: break-word;
}

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

.message.bot {
    align-self: flex-start;
    background: #fff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(26, 26, 46, 0.15);
}

/* ---- Typing Indicator ---- */
.typing {
    font-size: 0.78rem;
    color: #9ca3af;
    padding: 0 1.2rem 0.5rem;
    display: none;
    align-items: center;
    gap: 8px;
    background: #fff;
}

.typing::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #c9a84c;
    border-radius: 50%;
    animation: typingDot 1.2s ease infinite;
}

@keyframes typingDot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ---- Quick Replies ---- */
.quick-replies {
    display: flex;
    gap: 0.4rem;
    padding: 0 1rem 0.8rem;
    overflow-x: auto;
    background: #fff;
    scrollbar-width: none;
}

.quick-replies::-webkit-scrollbar {
    display: none;
}

.quick-reply-btn {
    padding: 0.45rem 0.9rem;
    background: #faf8f5;
    border: 1px solid #e8e4de;
    border-radius: 20px;
    font-size: 0.76rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
    color: #1a1a2e;
}

.quick-reply-btn:hover {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
    transform: translateY(-1px);
}

/* ---- Input Area ---- */
.chat-footer {
    padding: 0.8rem 1rem;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    border: 1.5px solid #e8e4de;
    border-radius: 24px;
    padding: 0.7rem 1.1rem;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
    background: #faf8f5;
}

.chat-input:focus {
    border-color: #1a1a2e;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.06);
}

.send-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(26, 26, 46, 0.3);
}

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

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 15px;
        left: 15px;
    }

    .chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: none;
    }

    .chatbot-widget.active .chatbot-toggle {
        display: none;
    }

    .chat-header {
        padding: 1rem;
        border-radius: 0;
    }

    /* Adjust WhatsApp position on mobile */
    .whatsapp-float {
        bottom: 15px !important;
        right: 15px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 1.6rem !important;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .chatbot-window {
        width: 340px;
        height: 500px;
    }
}
