/* =========================
   GLOBAL CHATBOT CSS
========================= */


/* Chatbot Container */

#chatbot {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 350px;
    max-width: 95%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    display: none;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    z-index: 2147483647 !important;
    /* 🔥 FIX */
    animation: chatbotFade 0.4s ease;
}


/* Animation */

@keyframes chatbotFade {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* Header */

#header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(45deg, #855436, #c89b6d);
    color: white;
    font-weight: bold;
}

.avatar {
    font-size: 26px;
}

.status {
    font-size: 14px;
    color: #00bd42;
}


/* Chat Area */

#chat-box {
    height: 280px;
    overflow-y: auto;
    padding: 15px;
    scroll-behavior: smooth;
}


/* Scrollbar */

#chat-box::-webkit-scrollbar {
    width: 5px;
}

#chat-box::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}


/* Messages */

.msg {
    padding: 10px 14px;
    border-radius: 18px;
    margin: 8px 0;
    max-width: 75%;
    font-size: 14px;
    line-height: 1.5;
    animation: msgFade 0.3s ease;
}

@keyframes msgFade {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* User Message */

.user {
    background: linear-gradient(45deg, #855436, #c89b6d);
    margin-left: auto;
    color: white;
}


/* Bot Message */

.bot {
    background: #334155;
    color: #e2e8f0;
}


/* Typing Animation */

.typing {
    font-size: 13px;
    opacity: 0.7;
}

.typing::after {
    content: "...";
    animation: dots 1s infinite;
}

@keyframes dots {
    0% {
        content: ".";
    }
    50% {
        content: "..";
    }
    100% {
        content: "...";
    }
}


/* Input Area */

.input-area {
    display: flex;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* Input */

input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
    font-size: 14px;
}


/* Buttons */

button {
    background: transparent;
    color: white;
    border: none;
    font-size: 18px;
    margin-left: 6px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    transform: scale(1.2);
}


/* Floating Button */

#openBtn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(45deg, #855436, #c89b6d);
    color: white;
    font-size: 26px;
    border: black;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 2147483647 !important;
    /* 🔥 FIX */
    animation: pulse 1.5s infinite;
}


/* Pulse Animation */

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}


/* Mobile Responsive */

@media (max-width: 768px) {
    #chatbot,
    #openBtn {
        visibility: hidden;
        opacity: 0;
        pointer-events: visible;
    }
}