﻿:root {
    --grad: linear-gradient(90deg, #00b4ff 0%, #00ffa3 15%, #ffd84d 40%, #ffc300 70%, #ffae00 100%);
}



/* ===========================================================
           FLOATING WIDGET
        ============================================================ */
#chatWidget {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9999;
}

.chat-button {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    transition: 0.3s ease;
}

    .chat-button:hover {
        transform: scale(1.08);
        background: #111;
    }

    .chat-button.is-hidden {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.8);
    }

.chat-floating-icon {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
}

/* Floating status text */
.chat-status {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 18px;
    white-space: nowrap;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(3px);
    animation: fadeInStatus 0.4s ease-out forwards;
}

@keyframes fadeInStatus {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
#closeChatFloating {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 30px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    transition: 0.3s ease;
    z-index: 9999;
}

    #closeChatFloating:hover {
        transform: scale(1.1);
    }

/* ===========================================================
           CHAT WINDOW
        ============================================================ */
.chat-window {
    position: fixed;
    right: 15px;
    bottom: 90px;
    width: 360px;
    max-width: 92vw;
    height: 520px;
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(40px) scale(0.96);
    transition: 0.35s ease;
    display: flex;
    flex-direction: column;
    z-index: 9998;
}

    .chat-window.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

/* ===========================================================
           CHAT HEADER
        ============================================================ */
.chat-header {
    background: #000;
    padding: 12px 16px 24px 16px;
    border-bottom-left-radius: 100% 22px;
    border-bottom-right-radius: 100% 22px;
}

.chat-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #000;
    border: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.chat-logo {
    width: 36px;
    height: 36px;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.title {
    font-size: 14px;
    font-weight: 700;
    margin-top: 6px;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===========================================================
           BODY
        ============================================================ */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 20px 20px;
    background: #fff;
}

/* CHAT MESSAGE STYLING LIKE YOUR ORIGINAL DESIGN */
.msg {
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    padding: 14px 18px;
    border-radius: 18px;
    margin: 10px 0;
    word-wrap: break-word;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

    /* USER MESSAGE (RIGHT SIDE – BLUE) */
    .msg.user {
        background: #c9ecff; /* soft sky blue */
        margin-left: auto;
        margin-right: 0;
        border-top-right-radius: 4px;
    }

    /* BOT MESSAGE (LEFT SIDE – GREY) */
    .msg.bot {
        background: #efefef;
        margin-right: auto;
        margin-left: 0;
        border-top-left-radius: 4px;
    }


/* ===========================================================
           FOOTER
        ============================================================ */
.chat-footer {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    background: #fff;
    border-top: 1px solid #ddd;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 12px;
}
:root {
    --grad: linear-gradient(90deg, #00b4ff 0%, #00ffa3 15%, #ffd84d 40%, #ffc300 70%, #ffae00 100%);
}




/* =========================================================== FLOATING WIDGET ============================================================ */

#chatWidget {
    position: fixed;
    right: 7px;
    bottom: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-button {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    transition: 0.3s ease;
}

    .chat-button:hover {
        transform: scale(1.08);
        background: #111;
    }

    .chat-button.is-hidden {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.8);
    }
/* Floating close button */

#closeChatFloating {
    position: fixed;
    right: 7px;
    bottom: 25px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 30px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    transition: 0.3s ease;
    z-index: 9999;
}

    #closeChatFloating:hover {
        transform: scale(1.1);
    }
/* =========================================================== CHAT WINDOW (compact glass panel) ============================================================ */

.chat-window {
    position: fixed;
    right: 10px;
    bottom: 100px;
    width: 360px;
    max-width: 92vw;
    height: 520px;
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(40px) scale(0.96);
    transition: 0.35s ease;
    display: flex;
    flex-direction: column;
    z-index: 9998;
}

    .chat-window.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }
/* =========================================================== CURVED HEADER (compact MU-style) ============================================================ */

.chat-header {
    background: #000;
    padding: 12px 16px 24px 16px;
    border-bottom-left-radius: 100% 22px;
    border-bottom-right-radius: 100% 22px;
}

.chat-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #000;
    border: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.chat-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    font-family: "Poppins", system-ui, Arial;
}

.title {
    font-size: 14px;
    font-weight: 700;
    margin-top: 6px;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes headerSlide {
    from {
        transform: translateY(-10px);
        opacity: .8;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* =========================================================== QUICK SUGGESTION CHIPS ============================================================ */

.suggestions-wrapper {
    padding: 10px 16px 4px 16px;
    background: #fff;
}

.suggestions-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #666;
    margin-bottom: 6px;
}

.quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

    .suggestion-chip span.icon {
        font-size: 13px;
    }

    .suggestion-chip:hover {
        background: #f0f7ff;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        transform: translateY(-1px);
    }
/* =========================================================== CHAT BODY (messages) ============================================================ */

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 20px 20px;
    scroll-behavior: smooth;
    background: #fff;
}

.msg {
    background: #f4f4f4;
    padding: 10px 14px;
    border-radius: 14px;
    margin-bottom: 10px;
    font-size: 14px;
    animation: fadeInUp 0.25s ease;
    max-width: 88%;
    word-wrap: break-word;
}

    .msg.user {
        background: #d8f1ff;
        margin-left: auto;
        margin-right: 0;
    }

    .msg.bot {
        background: #ededed;
        margin-right: auto;
        margin-left: 0;
    }

    .msg.system-label {
        background: transparent;
        color: #777;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        text-align: center;
        margin: 6px 0;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Typing indicator */

.wtyping {
    display: inline-block;
    padding: 8px 12px;
    background: #000; /* black bubble */
    border-radius: 14px;
    width: 50px;
    text-align: center;
    margin-bottom: 10px;
    animation: fadeInUp 0.2s ease;
    color: #fff; /* white dots */
}

    .wtyping span {
        animation: blink 1.4s infinite both;
        font-size: 18px;
        color: #fff; /* white dots */
    }


@keyframes blink {
    0% {
        opacity: .2;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: .2;
    }
}

.wtyping span:nth-child(2) {
    animation-delay: .2s;
}

.wtyping span:nth-child(3) {
    animation-delay: .4s;
}
/* =========================================================== FOOTER ============================================================ */

.chat-footer {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    background: #fff;
    border-top: 1px solid #ddd;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

    #userInput:focus {
        outline: none;
        border-color: #00b4ff;
        box-shadow: 0 0 8px rgba(0, 180, 255, 0.5);
    }

.send-btn {
    border: none;
    background: transparent;
    padding: 0;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

    .send-btn:hover {
        transform: translateX(2px);
    }

.send-icon-img {
    width: 22px;
    height: 22px;
}


.send-btn {
    border: none;
    background: transparent;
    padding: 10px 12px;
    width: 50px;
    height: 50px;
    font-size: xx-large;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.send-btn:hover {
    transform: translateX(2px);
}

.send-icon-img {
    width: 40px;
    height: 40px;
}
/* FORCE correct text color inside chat messages */
.msg.bot {
    color: #000 !important; /* Bot reply text → black */
}

.msg.user {
    color: #000 !important; /* User message text → black */
}

/* Quick suggestion chip text */
.suggestion-chip {
    color: #000 !important;
}

/* bouncing dots */
.chat-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .chat-status .dots {
        display: inline-flex;
        gap: 3px;
    }

    .chat-status .dot {
        width: 5px;
        height: 5px;
        background: #fff;
        border-radius: 50%;
        animation: bounceDot 1.2s infinite ease-in-out;
    }

        .chat-status .dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .chat-status .dot:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes bounceDot {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* BOT MESSAGE WITH AVATAR */
.msg.bot {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: transparent !important; /* remove old background */
    box-shadow: none !important;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: url('https://res.cloudinary.com/dc3ijuowd/image/upload/v1763552907/das_liahge.png') no-repeat center center / cover !important;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(0,0,0,0.25);
}

.bot-text {
    background: #ededed;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    max-width: 80%;
    line-height: 1.45;
    animation: fadeInUp 0.25s ease;
}

@media (max-width: 600px) {
    #chatWidget {
        right: 12px;
        bottom: 16px;
    }

    .chat-window {
        right: 0;
        left: 0;
        margin: 0 auto;
        width: 95vw;
        height:550px;
        max-width: 100vw;
        bottom: 0;
        border-radius: 18px 18px 0 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto; /* 🔥 Important fix */
    }

    .chat-header {
        padding: 14px 16px 28px 16px; /* slightly more curve space */
    }


    .brand {
        font-size: 16px;
    }

    .title {
        font-size: 13px;
    }

    .chat-body {
        padding: 10px 14px 14px 14px;
    }

    .suggestions-wrapper {
        padding: 8px 7px 4px 7px;
    }

    .chat-status {
        bottom: 76px;
        right: 6px;
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 600px) {

    .chat-window {
        bottom: 0 !important; /* always stick to bottom */
        top: 120px!important; /* prevent jumping to top */
        transform: translateY(0) !important;
    }
}



/* ========== MOBILE FIX ========== */
@media (max-width: 600px) {

    /* FLOATING window above icons */
    .chat-window {
        position: fixed;
        left: 0;
        right: 0;
        margin: auto;
        width: 95vw;
        height: 75vh;
        bottom: 110px; /* ⬆️ Lifts whole window */
        border-radius: 20px;
        overflow: hidden;
        transform: translateY(0) !important;
    }

    /* BODY scrolls normally */
    .chat-body {
        padding: 12px 14px 80px 14px; /* space for footer */
    }

    /* FOOTER stays inside window, not at bottom of screen */
    .chat-footer {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 14px;
        background: #fff;
        border-top: 1px solid #ddd;
    }

    /* Remove earlier footer hacks */
    .chat-footer {
        margin-bottom: 0 !important;
        padding-bottom: 12px !important;
    }

    /* Remove earlier extra-top or bottom adjustments */
    .chat-window {
        top: auto !important;
        max-height: 75vh !important;
    }
}
@media (max-width: 600px) {

    .chat-window {
        position: fixed;
        left: 0;
        right: 0;
        margin: auto;
        width: 94vw;
        height: 72vh; /* ⭐ perfect mobile height */
        bottom: 42px; /* ⭐ ideal floating gap */
        border-radius: 22px;
        background: rgba(255,255,255,0.97);
        overflow: hidden;
        box-shadow: 0 14px 40px rgba(0,0,0,0.25); /* soft premium shadow */
        transform: translateY(0) !important;
        max-height: 72vh;
        z-index: 99999;
    }

    .chat-body {
        padding: 14px 16px 95px 16px; /* ⭐ comfortable padding for footer */
    }

    .chat-footer {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid rgba(0,0,0,0.08);
        padding: 14px 16px;
        margin: 0 !important;
        height: auto;
    }
}

@media (max-width: 600px) {

    .chat-window {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 100vw;
        height: calc(100dvh - 110px); /* ⭐ PERFECT universal height */
        background: #fff;
        border-radius: 20px 20px 0 0;
        overflow: hidden;
        z-index: 999999;
    }

    .chat-body {
        overflow-y: auto;
        height: calc(100% - 80px); /* footer height */
        padding: 14px 16px;
    }

    .chat-footer {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #ddd;
        padding: 12px 14px;
        height: 80px;
    }


}
/* ================================================
   MOBILE CLOSE BUTTON (TOP-RIGHT INSIDE HEADER)
   ================================================ */
@media (max-width: 600px) {

    .mobile-close-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: rgba(255,255,255,0.15);
        color: #fff;
        border: 1px solid rgba(255,255,255,0.4);
        font-size: 20px;
        cursor: pointer;
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 999999; /* always on top */
    }

        .mobile-close-btn:hover {
            background: rgba(255,255,255,0.25);
            transform: scale(1.07);
        }

    /* Hide bottom close button in mobile */
    #closeChatFloating {
        display: none !important;
    }
}

/* Hide mobile close button on desktop */
.mobile-close-btn {
    display: none;
}

@media (max-width: 600px) {
    .mobile-close-btn {
        display: flex !important;
    }

    /* Hide bottom close button only on mobile */
    #closeChatFloating {
        display: none !important;
    }

    @media (max-width: 600px) {
        .chat-header-inner {
            padding-right: 55px; /* space for the close button */
        }
    }


}

/* =========================================================
   FINAL MOBILE LAYOUT FIX – restores clean flex behaviour
   ========================================================= */
@media (max-width: 600px) {

    /* Chat window: float above icons but keep normal flex layout */
    .chat-window {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 90px !important; /* adjust if needed */
        top: auto !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        height: 70vh !important; /* panel height */
        max-height: 70vh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; /* only body scrolls */
        border-radius: 22px !important;
        z-index: 99999 !important;
    }

    /* Body: normal flex child, NO absolute */
    .chat-body {
        position: static !important;
        top: auto !important;
        bottom: auto !important;
        height: auto !important;
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 10px 14px 10px 14px !important;
    }

    /* Footer: normal block at bottom of flex column */
    .chat-footer {
        position: static !important;
        bottom: auto !important;
        height: auto !important;
        padding: 12px 14px !important;
        border-top: 1px solid #ddd !important;
        background: #fff !important;
    }
}






/* MAIN WRAPPER */
#whatsappWidget {
    position: fixed;
    left: 25px;
    bottom: 25px;
    z-index: 99999 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* WhatsApp round button */
.wa-button {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(0,0,0,0.4);
    transition: 0.25s ease;
}

    .wa-button:hover {
        transform: scale(1.08);
    }

/* Tooltip */
.wa-status {
    position: absolute;
    bottom: 75px; /* above the icon */
    left: 0;
    background: rgba(0,0,0,0.88);
    color: #fff;
    padding: 7px 16px;
    font-size: 13px;
    border-radius: 18px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: 0.3s ease;
    z-index: 99999;
}

    /* show tooltip */
    .wa-status.show {
        opacity: 1;
        transform: translateY(0);
    }

/* Mobile adjust */
@media(max-width:768px) {
    #whatsappWidget {
        left: 15px;
        bottom: 15px;
    }

    .wa-button {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }

    .wa-status {
        bottom: 45px;
        font-size: 12px;
    }
}


/* FORCE WhatsApp tooltip visibility */
#waStatus,
.wa-status {
    position: absolute !important;
    bottom: 65px !important;
    left: 0 !important;
    z-index: 999999 !important;
    background: rgba(0,0,0,0.88) !important;
    color: #fff !important;
    padding: 7px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 18px !important;
    white-space: nowrap !important;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
}

    /* Make tooltip visible */
    #waStatus.show {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }


#waStatus,
.wa-status {
    position: absolute !important;
    bottom: 65px !important;
    left: 0 !important;
    z-index: 999999 !important;
    background: rgba(0,0,0,0.88) !important;
    color: #fff !important;
    padding: 7px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 18px !important;
    white-space: nowrap !important;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
}

    #waStatus.show {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

/* Mr. Das – typing dots animation */
/*.chat-status::after {
    content: "";
    display: inline-block;
    width: 20px;
    text-align: left;
    animation: typingDots 1.4s infinite steps(4);
}

@keyframes typingDots {
    0%   { content: ""; }
    25%  { content: "."; }
    50%  { content: ".."; }
    75%  { content: "..."; }
    100% { content: ""; }
}*/
