/* ══════════════════════════════════════════════════════
   Yoga AI Chatbot — Widget Styles
   ══════════════════════════════════════════════════════ */

:root {
    --yacb-accent: #7c5cbf;
    --yacb-accent-dark: #5e3fa3;
    --yacb-accent-light: #f3eeff;
    --yacb-white: #ffffff;
    --yacb-bg: #f7f5fc;
    --yacb-border: #e8e2f7;
    --yacb-text: #2d2535;
    --yacb-muted: #9e97b0;
    --yacb-bot-bubble: #ffffff;
    --yacb-user-bubble: var(--yacb-accent);
    --yacb-shadow: 0 8px 40px rgba(124, 92, 191, 0.22);
    --yacb-shadow-btn: 0 4px 20px rgba(124, 92, 191, 0.4);
    --yacb-radius: 20px;
    --yacb-radius-sm: 12px;
    --yacb-panel-w: 360px;
    --yacb-panel-h: 560px;
    --yacb-z: 999999;
}

/* ── Positioning ───────────────────────────────────── */
.yacb-widget {
    position: fixed;
    z-index: var(--yacb-z);
    font-family: -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
.yacb-bottom-right { bottom: 24px; right: 24px; }
.yacb-bottom-left  { bottom: 24px; left: 24px; }

/* ── Trigger Button ────────────────────────────────── */
.yacb-trigger {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--yacb-accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: var(--yacb-shadow-btn);
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s;
    outline: none;
}
.yacb-trigger:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(124,92,191,.55); }
.yacb-trigger:active { transform: scale(.95); }
.yacb-trigger-icon { line-height: 1; }

/* Pulse ring */
.yacb-trigger-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--yacb-accent);
    opacity: .35;
    animation: yacb-pulse 2.2s infinite;
    pointer-events: none;
}
@keyframes yacb-pulse {
    0%   { transform: scale(1);    opacity: .35; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

/* Unread dot */
.yacb-unread-dot {
    position: absolute;
    top: 2px; right: 2px;
    width: 14px; height: 14px;
    background: #ff4757;
    border-radius: 50%;
    border: 2.5px solid white;
}

/* ── Chat Panel ────────────────────────────────────── */
.yacb-chat-panel {
    position: absolute;
    bottom: 76px;
    width: var(--yacb-panel-w);
    height: var(--yacb-panel-h);
    background: var(--yacb-white);
    border-radius: var(--yacb-radius);
    box-shadow: var(--yacb-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: yacb-panel-in .3s cubic-bezier(.34, 1.56, .64, 1);
    transform-origin: bottom right;
}
.yacb-bottom-right .yacb-chat-panel { right: 0; }
.yacb-bottom-left  .yacb-chat-panel { left: 0; transform-origin: bottom left; }
@keyframes yacb-panel-in {
    from { opacity: 0; transform: scale(.85) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Header ────────────────────────────────────────── */
.yacb-chat-header {
    background: linear-gradient(135deg, var(--yacb-accent), #a07fdf);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.yacb-chat-header-left { display: flex; align-items: center; gap: 10px; }
.yacb-avatar {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    border: 2px solid rgba(255,255,255,.4);
    flex-shrink: 0;
}
.yacb-bot-name { color: white; font-weight: 700; font-size: 14px; }
.yacb-bot-status { color: rgba(255,255,255,.8); font-size: 11px; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.yacb-status-dot { width: 7px; height: 7px; background: #2ecc71; border-radius: 50%; display: inline-block; animation: yacb-blink 2s infinite; }
@keyframes yacb-blink { 0%,100%{opacity:1} 50%{opacity:.5} }

.yacb-close-btn {
    background: rgba(255,255,255,.2);
    border: none; color: white;
    width: 28px; height: 28px;
    border-radius: 50%; cursor: pointer;
    font-size: 14px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.yacb-close-btn:hover { background: rgba(255,255,255,.35); }

/* ── Messages Area ─────────────────────────────────── */
.yacb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--yacb-bg);
}
.yacb-messages::-webkit-scrollbar { width: 4px; }
.yacb-messages::-webkit-scrollbar-track { background: transparent; }
.yacb-messages::-webkit-scrollbar-thumb { background: var(--yacb-border); border-radius: 4px; }

/* ── Bubbles ───────────────────────────────────────── */
.yacb-msg { display: flex; gap: 8px; animation: yacb-msg-in .25s ease; }
@keyframes yacb-msg-in { from { opacity: 0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }

.yacb-msg-bot  { align-items: flex-start; }
.yacb-msg-user { align-items: flex-end; flex-direction: row-reverse; }

.yacb-msg-avatar {
    width: 28px; height: 28px;
    background: var(--yacb-accent-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0; margin-top: 2px;
    border: 1.5px solid var(--yacb-border);
}

.yacb-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}
.yacb-msg-bot  .yacb-bubble {
    background: var(--yacb-bot-bubble);
    color: var(--yacb-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    border: 1px solid var(--yacb-border);
}
.yacb-msg-user .yacb-bubble {
    background: var(--yacb-user-bubble);
    color: white;
    border-bottom-right-radius: 4px;
}

.yacb-msg-time {
    font-size: 10px;
    color: var(--yacb-muted);
    margin-top: 4px;
    display: block;
}

/* Quick reply chips */
.yacb-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.yacb-chip {
    background: var(--yacb-accent-light);
    border: 1.5px solid var(--yacb-accent);
    color: var(--yacb-accent);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.yacb-chip:hover { background: var(--yacb-accent); color: white; }

/* ── Typing Indicator ──────────────────────────────── */
.yacb-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 8px;
    background: var(--yacb-bg);
    flex-shrink: 0;
}
.yacb-typing-avatar { font-size: 16px; }
.yacb-typing-dots {
    background: white;
    border: 1px solid var(--yacb-border);
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    gap: 5px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.yacb-typing-dots span {
    width: 7px; height: 7px;
    background: var(--yacb-muted);
    border-radius: 50%;
    animation: yacb-dot 1.4s infinite;
}
.yacb-typing-dots span:nth-child(2) { animation-delay: .2s; }
.yacb-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes yacb-dot { 0%,80%,100%{transform:scale(.7);opacity:.5} 40%{transform:scale(1);opacity:1} }

/* ── Lead Form ─────────────────────────────────────── */
.yacb-lead-form {
    background: white;
    border-top: 1.5px solid var(--yacb-border);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    animation: yacb-slide-up .3s ease;
}
@keyframes yacb-slide-up { from { transform: translateY(20px); opacity:0; } to { transform:translateY(0); opacity:1; } }
.yacb-form-title { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--yacb-text); }
.yacb-input {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--yacb-border);
    border-radius: var(--yacb-radius-sm);
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
    font-family: inherit;
}
.yacb-input:focus { border-color: var(--yacb-accent); }
.yacb-lead-btn {
    background: var(--yacb-accent);
    color: white;
    border: none;
    border-radius: var(--yacb-radius-sm);
    padding: 11px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s;
    font-family: inherit;
}
.yacb-lead-btn:hover { background: var(--yacb-accent-dark); transform: translateY(-1px); }
.yacb-lead-btn:active { transform: translateY(0); }
.yacb-skip-btn {
    background: none; border: none;
    color: var(--yacb-muted); font-size: 12px;
    cursor: pointer; text-align: center; padding: 4px;
    text-decoration: underline; font-family: inherit;
}

/* ── Input Area ────────────────────────────────────── */
.yacb-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1.5px solid var(--yacb-border);
    background: white;
    flex-shrink: 0;
}
.yacb-user-input {
    flex: 1;
    border: 1.5px solid var(--yacb-border);
    border-radius: 14px;
    padding: 9px 13px;
    font-size: 13.5px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
    max-height: 80px;
    overflow-y: auto;
    transition: border-color .15s;
}
.yacb-user-input:focus { border-color: var(--yacb-accent); }
.yacb-send-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--yacb-accent);
    border: none;
    color: white;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}
.yacb-send-btn:hover { background: var(--yacb-accent-dark); transform: scale(1.05); }
.yacb-send-btn:disabled { background: var(--yacb-muted); cursor: not-allowed; transform: none; }

/* ── Footer ────────────────────────────────────────── */
.yacb-footer-text { text-align: center; font-size: 10.5px; color: var(--yacb-muted); padding: 4px 0 8px; background: white; flex-shrink: 0; }

/* ── Mobile ────────────────────────────────────────── */
@media (max-width: 480px) {
    :root { --yacb-panel-w: calc(100vw - 24px); }
    .yacb-bottom-right { right: 12px; bottom: 16px; }
    .yacb-bottom-left  { left: 12px; bottom: 16px; }
    .yacb-chat-panel { right: 0; width: 100%; }
    .yacb-bottom-left .yacb-chat-panel { left: 0; }
}
