/* ========================================
   CHATBOT STYLES - NEXT LEVEL
   ======================================== */
:root {
    --chat-primary: #f25824;
    /* Brand Orange */
    --chat-bg: #fff;
    --chat-header-bg: #f25824;
    --chat-user-msg: #f25824;
    --chat-bot-msg: #f2f2f2;
    --chat-text: #1f1f1f;
    --chat-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
}

.chatbot-toggler {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    border: none;
    outline: none;
    height: 60px !important;
    width: 60px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: none;
    z-index: 9999 !important;
    animation: pulse-zoom 2s ease-in-out infinite;
}

/* Pulse Zoom Animation */
@keyframes pulse-zoom {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.chatbot-toggler span {
    position: absolute;
    color: #fff;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.chatbot-toggler span img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    /* border: 2px solid white; */
}

.chatbot-toggler:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgb(255, 255, 255);
}

body.show-chatbot .chatbot-toggler {
    transform: rotate(90deg);
    background: #333;
}

body.show-chatbot .chatbot-toggler span:first-child {
    opacity: 0;
    transform: rotate(90deg);
}

body.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
    transform: rotate(-90deg);
}

.chatbot-toggler span:last-child {
    opacity: 0;
}

/* Chatbot Container */
.active-chatbot {
    position: fixed;
    right: 35px;
    bottom: 100px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: var(--chat-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--chat-shadow);
    transform-origin: bottom right;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9998;
    display: flex;
    flex-direction: column;
}

body.show-chatbot .active-chatbot {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* NUCLEAR SCROLL LOCK */
html.show-chatbot,
body.show-chatbot {
    overflow: hidden !important;
}

/* Header */
.active-chatbot header {
    background: #fff;
    padding: 20px;
    text-align: left;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.active-chatbot header h2 {
    color: var(--chat-header-bg);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 10px;
}

.active-chatbot header h2 i {
    font-size: 1.4rem;
}

.active-chatbot header .close-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    /* Hide close btn on desktop as toggler does the job */
}

/* Chatbox */
.active-chatbot .chatbox {
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    padding: 20px;
    background-color: #f9f9f9;
}

.active-chatbot .chatbox::-webkit-scrollbar {
    width: 6px;
}

.active-chatbot .chatbox::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.chatbox .chat {
    display: flex;
    list-style: none;
    margin-bottom: 15px;
}

.chatbox .chat p {
    white-space: pre-wrap;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.95rem;
    max-width: 80%;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Incoming (Bot) */
.chatbox .incoming span {
    width: 35px;
    height: 35px;
    background: transparent;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    align-self: flex-end;
    flex-shrink: 0;
}

.chatbox .incoming span img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    border-radius: 50%;
    /* background: white; */
    padding: 2px;
}

.chatbox .incoming p {
    background: var(--chat-bot-msg);
    color: var(--chat-text);
    border-bottom-left-radius: 0;
    animation: slideInLeft 0.3s ease;
}

/* Outgoing (User) */
.chatbox .outgoing {
    justify-content: flex-end;
}

.chatbox .outgoing p {
    background: var(--chat-user-msg);
    color: #fff;
    border-bottom-right-radius: 0;
    animation: slideInRight 0.3s ease;
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Input Area */
.active-chatbot .chat-input {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #fff;
    align-items: center;
}

.chat-input textarea,
.chat-input input {
    height: 45px;
    width: 100%;
    border: 1px solid #ddd;
    outline: none;
    resize: none;
    padding: 0 15px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fdfdfd;
    transition: all 0.2s;
}

.chat-input input:focus {
    border-color: var(--chat-primary);
    background: #fff;
}

.chat-input span {
    color: var(--chat-primary);
    font-size: 1.3rem;
    cursor: pointer;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-input span:hover {
    background: #fff1eb;
}

/* Options / Suggestions */
.chat-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    margin-left: 45px;
    margin-bottom: 15px;
    /* Indent to align with bot msg */
}

.chat-option-btn {
    border: 1px solid var(--chat-primary);
    background: transparent;
    color: var(--chat-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.chat-option-btn:hover {
    background: var(--chat-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(242, 88, 36, 0.2);
}

/* Slider Container */
.chat-slider-container {
    display: flex;
    gap: 12px;
    padding: 10px 0 10px 45px;
    /* aligned with message */
    overflow-x: auto;
    width: 100%;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.chat-slider-container::-webkit-scrollbar {
    height: 4px;
}

.chat-slider-container::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

/* Slide Item */
.chat-slide-item {
    flex: 0 0 120px;
    /* fixed width cards */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-slide-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.chat-slide-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    /* circular images */
    margin-bottom: 8px;
    background: #f8f8f8;
}

.chat-slide-item span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    line-height: 1.2;
}

/* Mobile Responsive */
@media (max-width: 490px) {
    .active-chatbot {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }

    .chatbot-toggler {
        bottom: 20px;
        right: 20px;
    }

    .active-chatbot header .close-btn {
        display: block;
    }
}