/* -------------------------------------------------
   Nemo AI – Floating Bubble
--------------------------------------------------- */
/* -------------------------------------------------
   Nemo AI – Floating Bubble (Premium Version)
--------------------------------------------------- */

#nemo-ai-bubble {
    position: fixed;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: transparent; 
    box-shadow: none; 
    overflow: visible; 
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, opacity .2s;
}

/* Clean pulse animation: gentle shrink & grow */
@keyframes nemo-breath {
    0%   { transform: scale(1); }
    50%  { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* Bubble breathing animation */
#nemo-ai-bubble {
    animation: nemo-breath 2.4s ease-in-out infinite;
    transform-origin: center;
}

/* REMOVE hover grow — no transform on hover */
#nemo-ai-bubble:hover {
    /* no transform */
}

/* Keep optional click feedback? (small press) */
#nemo-ai-bubble:active {
    transform: scale(0.92);
}


/* Icon container */
#nemo-ai-bubble .nemo-icon {
    width: 100%;
    height: 100%;
    display: block;
    position: relative; /* ensure avatar is positioned inside this circle */
}

#nemo-ai-bubble .nemo-icon img {
    position: absolute;
    width: 68px;
    max-width: none;          /* override global img { max-width:100% } */
    height: auto;
    left: -7px;               /* tweak these to micro-adjust */
    top: -6px;
    object-fit: contain;
    pointer-events: none;
}

/* When chat is open, hide bubble */
.nemo-bubble-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Link styling inside chat */
.nemo-link {
    color: #0ea5e9;
    font-weight: 600;
    text-decoration: none;
}
.nemo-link:hover {
    text-decoration: underline;
}

/* Bubble positions */
.nemo-pos-bottom_right { right: 24px; bottom: 24px; }
.nemo-pos-bottom_left  { left: 24px;  bottom: 24px; }
.nemo-pos-top_right    { right: 24px; top: 24px;    }
.nemo-pos-top_left     { left: 24px;  top: 24px;    }


/* -------------------------------------------------
   Nemo Chat Window (POPUP)
--------------------------------------------------- */
#nemo-ai-chat {
    position: fixed;
    width: 420px;
    height: 70vh;        /* instead of max-height */
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity .25s ease-out, transform .25s ease-out;
}

.nemo-message {
    margin-bottom: 6px;
}

/* Position window relative to bubble */
.nemo-pos-bottom_right + #nemo-ai-chat { right: 24px; bottom: 40px; }
.nemo-pos-bottom_left  + #nemo-ai-chat { left: 24px;  bottom: 96px; }
.nemo-pos-top_right    + #nemo-ai-chat { right: 24px; top: 96px;    }
.nemo-pos-top_left     + #nemo-ai-chat { left: 24px;  top: 96px;    }

/* Open state */
#nemo-ai-chat.nemo-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Utility */
.nemo-hidden {
    display: none !important;
}

/* -------------------------------------------------
   Header
--------------------------------------------------- */
/* Modern rounded header with glow */
.nemo-header {
    padding: 12px 18px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;

    border-radius: 16px 16px 0 0 !important;

    /* Floating glass/glow effect */
    backdrop-filter: blur(14px);
    background: #1877F2 !important;

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.18),
        inset 0 0 12px rgba(255,255,255,0.20);

    position: relative;
    z-index: 2;
}

.nemo-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Header avatar – round, full-cover image */
.nemo-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
}
.nemo-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nemo-header-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.nemo-header-title {
    font-size: 14px;
    font-weight: 600;
}

.nemo-header-status {
    font-size: 12px;
    color: #e0e7ff;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

/* "Online" presence dot */
.nemo-online-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.9);
}

.nemo-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 8px; /* increases tap area */
    margin-right: -8px; /* keeps alignment perfect */
}


/* -------------------------------------------------
   Messages
--------------------------------------------------- */
.nemo-messages {
    padding: 14px;
    flex: 1;
    overflow-y: auto;
    background: #f3f7fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Scrollbar styling (Chrome/WebKit) */
.nemo-messages::-webkit-scrollbar {
    width: 6px;
}
.nemo-messages::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 10px;
}

.nemo-message {
    display: flex;
    max-width: 90%;
}

.nemo-user {
    justify-content: flex-end;
    margin-left: auto;
}

.nemo-bot {
    justify-content: flex-start;
}

.nemo-bubble {
    font-size: 13px;
    line-height: 1.5;
}

/* Messenger-style user bubble */
.nemo-user .nemo-bubble {
    background: #1877F2; /* Messenger blue */
    color: #ffffff;      /* White text */

    padding: 4px 22px;  /* horizontal space mainly; vertical will be controlled below */
    border-radius: 18px;      /* fully rounded rectangle */

    font-size: 14px;
    line-height: 1.4;

    box-shadow: 0 2px 4px rgba(0,0,0,0.15); /* subtle 3D */
}

/* Messenger-style bot bubble */
.nemo-bot .nemo-bubble {
    background: #ffffff;      /* white */
    color: #111111;           /* dark text */

    padding: 12px 16px;
    border-radius: 18px;      /* fully rounded rectangle */

    font-size: 14px;
    line-height: 1.45;

    box-shadow: 0 0px 1px rgba(0,0,0,0.15); /* soft 3D shadow */
    border: 1px solid #f2f2f2; /* tiny outline for depth */
}


/* -------------------------------------------------
   ChatGPT-style Typing Dots
--------------------------------------------------- */
.nemo-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.nemo-typing-dot {
    width: 6px;
    height: 6px;
    background: #c0c7d1;
    border-radius: 50%;
    animation: nemo-bounce 1.3s infinite ease-in-out;
}

.nemo-typing-dot:nth-child(2) {
    animation-delay: .15s;
}

.nemo-typing-dot:nth-child(3) {
    animation-delay: .3s;
}

@keyframes nemo-bounce {
    0%   { transform: translateY(0);   opacity: 0.4; }
    30%  { transform: translateY(-4px);opacity: 1;   }
    60%  { transform: translateY(0);   opacity: 0.4; }
    100% { transform: translateY(1px); opacity: 0.2; }
}

/* -------------------------------------------------
   Premium Floating Input Bar (OpenAI style)
--------------------------------------------------- */
.nemo-input-area {
    border-top: 1px solid #e0e4e8;
    padding: 14px 12px;
    background: #ffffff;
}

/* Floating "pill" */
.nemo-input-shell {
    display: flex;
    align-items: center;
    gap: 12px;

    background: #ffffff;
    border-radius: 999px;

    padding: 10px 18px;
    min-height: 52px;

    box-shadow: 0 6px 14px rgba(0,0,0,0.08),
                0 1px 3px rgba(0,0,0,0.05);
}

.nemo-input-shell textarea {
    flex: 1;
    resize: none;
    border: none;
    background: transparent;
    padding: 17px 0 0 0;  /* Only TOP padding */
    font-size: 16px;
    line-height: 20px;
    height: auto;
    min-height: 20px;
    max-height: 100px;
    overflow-y: auto;
    outline: none;
    font-weight: 400;
    color: #111;
}

.nemo-input-shell textarea::placeholder {
    color: #a7acb4;
    font-weight: 300;  /* ← Lighter placeholder */
}


/* Send button – floating circular button */
.nemo-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #000;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    flex-shrink: 0;

    transition: transform .12s ease-out, box-shadow .12s ease-out;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* Arrow icon */
.nemo-send-icon {
    font-size: 18px;
    transform: translateY(-1px);
}

/* Touch feedback */
.nemo-send:active {
    transform: scale(0.92);
}

/* Hover (desktop) */
@media (hover:hover) {
    .nemo-send:hover {
        background: #1a1a1a;
    }
}

/* -------------------------------------------------
   Mobile (bottom sheet)
--------------------------------------------------- */
@media (max-width: 480px) {
    #nemo-ai-chat {
        width: 100%;
        max-width: 100%;
        height: 80vh;
        max-height: 80vh;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 18px 18px 0 0;
    }

    .nemo-pos-bottom_right + #nemo-ai-chat,
    .nemo-pos-bottom_left  + #nemo-ai-chat,
    .nemo-pos-top_right    + #nemo-ai-chat,
    .nemo-pos-top_left     + #nemo-ai-chat {
        left: 0;
        right: 0;
        bottom: 0;
    }
}


/* -------------------------------------------------
   WhatsApp Button inside messages
--------------------------------------------------- */
.nemo-wa-btn {
    display: inline-block;
    background: #25D366;
    color: #fff !important;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: background .2s;
}
.nemo-wa-btn:hover {
    background: #1EBE5A;
}

/* Smooth message fade-in */
@keyframes nemo-msg-appear {
    from {
        transform: translateY(6px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nemo-message {
    animation: nemo-msg-appear .25s ease-out;
}

/* Stack user bubble + "Read" vertically, aligned to the right */
.nemo-message.nemo-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 90%;
}

.nemo-read {
    font-size: 11px;
    color: #888;
    margin-top: 3px;       /* small gap */
    padding-right: 6px;    /* align with bubble edge */
    line-height: 1;
}

/* Bot avatar next to bot messages */
.nemo-message.nemo-bot {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 85%;
}

.nemo-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.nemo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Typing bubble layout */
.nemo-typing-advanced {
    background: #fff;
    border-radius: 18px;
    padding: 10px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Typing label */
.nemo-typing-label {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}

/* Dots animation */
.nemo-typing-dot {
    width: 6px;
    height: 6px;
    background: #c0c7d1;
    border-radius: 50%;
    animation: nemo-bounce 1.3s infinite ease-in-out;
}
.nemo-typing-dot:nth-child(2) { animation-delay: .15s; }
.nemo-typing-dot:nth-child(3) { animation-delay: .30s; }

@keyframes nemo-bounce {
    0%   { transform: translateY(0);   opacity: 0.4; }
    30%  { transform: translateY(-4px); opacity: 1; }
    60%  { transform: translateY(0);   opacity: 0.4; }
    100% { transform: translateY(1px); opacity: 0.2; }
}



/* -------------------------------------------------
   Nemo – Safe user bubble vertical alignment
   (scoped so it doesn't affect the rest of the site)
--------------------------------------------------- */

#nemo-ai-chat .nemo-user .nemo-bubble {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 22px !important; /* adjust 8px if you want more/less height */
}

#nemo-ai-chat .nemo-user .nemo-bubble p {
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    line-height: 1.4 !important;
}

@media (max-width: 480px) {

    /* Smaller bubble */
    #nemo-ai-bubble {
        width: 50px;
        height: 50px;
    }



    /* Resize and recenter avatar */
    #nemo-ai-bubble .nemo-icon img {
        width: 60px;
        max-width: none;
        left: -5px;
        top: -5px;
    }
    
}
