/* ============================================
   Indistylex Chatbot Widget
   ============================================ */

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1A1A1A;
    border: none;
    color: #C8A962;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(26, 26, 26, 0.4);
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(26, 26, 26, 0.55);
}
.chatbot-toggle .badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #10B981;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(15,23,42,0.15);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s ease-out;
}
.chatbot-window.open {
    display: flex;
}
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.chatbot-header {
    background: #1A1A1A;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.chatbot-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.chatbot-header .info {
    flex: 1;
}
.chatbot-header .info h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.chatbot-header .info small {
    opacity: 0.85;
    font-size: 0.75rem;
}
.chatbot-header .close-chat {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.chatbot-header .close-chat:hover {
    opacity: 1;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    min-height: 200px;
    background: #EFF6FF;
}
.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: #93C5FD;
    border-radius: 4px;
}

/* Message Bubbles */
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.chat-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #2C3E50;
    border: 1px solid #BFDBFE;
    border-bottom-left-radius: 4px;
}
.chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #1A56DB, #3B82F6);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg a {
    color: #3B82F6;
    text-decoration: underline;
}
.chat-msg.user a {
    color: #BFDBFE;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 16px;
    align-self: flex-start;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #93C5FD;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite both;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Quick Replies */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 4px;
    background: #EFF6FF;
}
.chatbot-suggestions .chip {
    padding: 5px 12px;
    border-radius: 20px;
    background: #DBEAFE;
    color: #1A56DB;
    font-size: 0.78rem;
    cursor: pointer;
    border: 1px solid #93C5FD;
    transition: all 0.2s;
    white-space: nowrap;
}
.chatbot-suggestions .chip:hover {
    background: #1A56DB;
    color: #fff;
    border-color: #1A56DB;
}

/* Input Area */
.chatbot-input {
    display: flex;
    padding: 10px 14px;
    border-top: 1px solid #DBEAFE;
    background: #fff;
    gap: 8px;
}
.chatbot-input input {
    flex: 1;
    border: 1px solid #BFDBFE;
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}
.chatbot-input input:focus {
    border-color: #1A56DB;
}
.chatbot-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #1A56DB;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chatbot-input button:hover {
    background: #3B82F6;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .chatbot-window {
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 100dvh;
        border-radius: 0;
    }
    .chatbot-messages {
        max-height: calc(100dvh - 180px);
    }
    .chatbot-toggle {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
        font-size: 1.4rem;
    }
}
