﻿/* =========================
   Chat Icon
/* ========== Base placement (reuses your existing class) ========== */
.fun-chatbot-icon.therapy-buddy {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    background: radial-gradient(circle at 30% 30%, #1e3c72 0%, #2a5298 70%, #0f2027 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Gentle idle motion */
    animation: buddy-bob 2.4s ease-in-out infinite;
    transition: transform .18s ease, box-shadow .18s ease;
}

    .fun-chatbot-icon.therapy-buddy:hover {
        transform: translateY(-2px) scale(1.03);
    }

    .fun-chatbot-icon.therapy-buddy:active {
        transform: translateY(0) scale(0.98);
    }

/* SVG sizing inside the pill */
.buddy-svg {
    width: 44px;
    height: 44px;
}

/* ========== THEME COLORS (tweak these to match Deeksha) ========== */
:root {
    --buddy-primary: #6f62ff; /* headphones, accents */
    --buddy-primary-2: #9a92ff; /* secondary accent */
    --buddy-skin: #ffd9a3; /* face */
    --buddy-line: #3a2a6a; /* outlines / strokes */
    --buddy-shadow: rgba(58,42,106,.18);
    --buddy-smile: #2c1f55;
}

/* Shapes */
.buddy-shadow {
    fill: var(--buddy-shadow);
}

.hp-band {
    fill: none;
    stroke: var(--buddy-primary);
    stroke-width: 6;
    stroke-linecap: round;
}

.hp-cup {
    fill: var(--buddy-primary);
}

.head {
    fill: var(--buddy-skin);
    stroke: #fff;
    stroke-width: 2;
}

.eye {
    fill: var(--buddy-line);
    transform-origin: center;
}

.smile {
    fill: none;
    stroke: var(--buddy-smile);
    stroke-width: 3;
    stroke-linecap: round;
}

.mic-boom {
    fill: none;
    stroke: var(--buddy-primary-2);
    stroke-width: 3;
    stroke-linecap: round;
}

.mic-tip {
    fill: var(--buddy-primary);
}

/* ========== Animations ========== */
@keyframes buddy-bob {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Blink: scale eyes vertically to a line quickly, then back */
.eyes .eye {
    animation: buddy-blink 4.5s infinite;
}

    .eyes .eye:nth-child(2) {
        /* slight offset for a natural winkiness */
        animation-delay: .08s;
    }

@keyframes buddy-blink {
    0%, 92%, 100% {
        transform: scaleY(1);
    }

    94% {
        transform: scaleY(0.15);
    }

    96% {
        transform: scaleY(1);
    }
}

/* ========== Mobile adjustments ========== */
@media (max-width: 600px) {
    .fun-chatbot-icon.therapy-buddy {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
        box-shadow: 0 8px 16px rgba(69, 42, 124, 0.22), inset 0 1px 0 rgba(255,255,255,0.8);
    }

    .buddy-svg {
        width: 36px;
        height: 36px;
    }
}

/* =========================
   Chat Window
========================= */
.fun-chatbot-window {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 500px;
    max-height: 480px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    min-height: 480px;
}

/* Header */
.fun-chatbot-header {
    background: linear-gradient(135deg, #f6d365, #fda085);
    padding: 12px;
    font-weight: bold;
    text-align: center;
    position: relative;
    color: #fff;
    font-size: 16px;
}

/* Close Button */
.fun-chatbot-close {
    position: absolute;
    top: 12px;
    right: 12px;
    cursor: pointer;
    font-size: 18px;
}

/* Body */
.fun-chatbot-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #e6f7ff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Input Area */
.fun-chatbot-input-area {
    display: flex;
    border-top: 1px solid #ddd;
    background: #fff;
}

.fun-chatbot-input {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
    font-size: 14px;
    border-radius: 0;
}

.fun-chatbot-send, .fun-chatbot-end {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    border: none;
    color: white;
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

    .fun-chatbot-send:hover, .fun-chatbot-end:hover {
        transform: scale(1.1);
    }

/* =========================
   Chat Messages with Avatar
========================= */
.fun-chatbot-message {
    display: flex;
    align-items: flex-end;
    max-width: 80%;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    animation: fun-slideup 0.3s forwards;
    overflow-wrap: anywhere; /* better word wrapping */
}

    .fun-chatbot-message .fun-chatbot-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background-size: cover;
        background-position: center;
        flex-shrink: 0;
        margin-right: 8px;
    }

.fun-chatbot-user {
    background: #fff0d1;
    align-self: flex-end;
    display: flex;
    flex-direction: row-reverse;
    border-radius: 15px 15px 0 15px;
    padding: 8px 12px;
}

    .fun-chatbot-user .fun-chatbot-avatar {
        margin-left: 8px;
        margin-right: 0;
        background-image: url('/img/other-img/user-icon.png');
    }

.fun-chatbot-bot {
    background: #d1f0ff;
    align-self: flex-start;
    display: flex;
    flex-direction: row;
    border-radius: 15px 15px 15px 0;
    padding: 8px 12px;
}

    .fun-chatbot-bot .fun-chatbot-avatar {
        margin-right: 8px;
        background-image: url('/img/other-img/deeksha-logo.png');
    }

@keyframes fun-slideup {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   Mobile Responsiveness
========================= */
@media screen and (max-width: 600px) {
    .fun-chatbot-window {
        width: 90%;
        bottom: 80px;
        right: 5%;
        min-height: 350px;
        max-height: 70vh;
        border-radius: 15px;
    }

    .fun-chatbot-input {
        font-size: 12px;
        padding: 8px;
    }

    .fun-chatbot-send, .fun-chatbot-end {
        font-size: 12px;
        padding: 0 10px;
    }

    .fun-chatbot-message {
        font-size: 13px;
        max-width: 100%;
    }

    .fun-chatbot-icon {
        width: 60px;
        height: 60px;
    }

        .fun-chatbot-icon::before {
            font-size: 28px;
        }
}

.fun-chatbot-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

/* Chatbot mascot */
.fun-chatbot-icon.therapy-buddy {
    width: 80px;
    height: 80px;
    cursor: pointer;
}

/* Speech bubble box */
.chat-intro-bubble {
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 220px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    font-family: "Segoe UI", sans-serif;
    line-height: 1.4;
    animation: fadeInUp 0.6s ease;
    position: relative;
}

    /* Tail of speech bubble */
    .chat-intro-bubble::after {
        content: "";
        position: absolute;
        right: -8px;
        bottom: 18px;
        width: 0;
        height: 0;
        border-left: 10px solid #fff;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.1));
    }

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Optional mobile tweaks */
@media (max-width: 600px) {
    .fun-chatbot-wrapper {
        bottom: 20px;
        right: 20px;
        flex-direction: column-reverse;
        align-items: flex-end;
    }

    .chat-intro-bubble {
        max-width: 180px;
        font-size: 13px;
    }

        .chat-intro-bubble::after {
            right: 20px;
            bottom: -8px;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 10px solid #fff;
        }
}
.fun-chatbot-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
}

/* Mascot */
.fun-chatbot-icon.therapy-buddy {
    width: 80px;
    height: 80px;
    cursor: pointer;
    margin-top: 8px; /* small gap below bubble */
}

/* ✅ Welcome Message Box */
.assistant-welcome-box {
    position: fixed;
    bottom: 120px; /* space from bottom */
    right: 30px; /* space from right */
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 18px;
    max-width: 260px;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    text-align: center;
    z-index: 9999;
    animation: welcome-fadeInUp 0.6s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

    /* ✅ Pointer arrow */
    .assistant-welcome-box::after {
        content: "";
        position: absolute;
        bottom: -10px;
        right: 40px; /* aligns arrow toward mascot/chat icon */
        border-width: 10px 8px 0 8px;
        border-style: solid;
        border-color: #ffffff transparent transparent transparent;
        filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
    }

/* ✅ Fade-in Animation */
@keyframes welcome-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ✅ Responsive Adjustments */
@media (max-width: 768px) {
    .assistant-welcome-box {
        bottom: 100px; /* closer to bottom on mobile */
        right: 20px; /* less right spacing */
        max-width: 200px; /* narrower */
        font-size: 13px;
        padding: 10px 14px;
    }

        .assistant-welcome-box::after {
            right: 30px; /* adjust arrow alignment */
        }
}

@media (max-width: 480px) {
    .assistant-welcome-box {
        bottom: 90px; /* tighter fit */
        right: 15px;
        max-width: 180px;
        font-size: 12px;
        padding: 8px 12px;
    }

        .assistant-welcome-box::after {
            right: 25px;
        }
}
