/* ═══════════════════════════════════════════════════
   SHE'S CHATBOT — Floating Chat Widget
   ═══════════════════════════════════════════════════ */

#shes-chatbot-root {
    --cb-teal: #00C4B4;
    --cb-dark: #0D0D0D;
    --cb-light: #F8FAFB;
    --cb-border: rgba(13,13,13,.08);
    --cb-shadow: 0 8px 32px rgba(0,0,0,.12);
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
}

/* ─── TOGGLE BUTTON ─────────────────────────────── */
.shes-cb-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cb-dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--cb-shadow);
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
}

.shes-cb-toggle:hover {
    transform: scale(1.08);
    background: var(--cb-teal);
}

.shes-cb-toggle svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    transition: transform 0.3s ease;
}

.shes-cb-toggle.active svg {
    transform: rotate(90deg);
}

.shes-cb-pulse {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--cb-teal);
    border-radius: 50%;
    top: 2px;
    right: 2px;
    border: 2px solid #fff;
    animation: cbPulse 2s infinite;
}

@keyframes cbPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* ─── CHAT WINDOW ───────────────────────────────── */
.shes-cb-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--cb-shadow);
    border: 1px solid var(--cb-border);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: cbSlideUp 0.3s ease;
}

.shes-cb-window.open {
    display: flex;
}

@keyframes cbSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── HEADER ────────────────────────────────────── */
.shes-cb-header {
    background: var(--cb-dark);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.shes-cb-avatar {
    width: 36px;
    height: 36px;
    background: var(--cb-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.shes-cb-header-info {
    flex: 1;
}

.shes-cb-header-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.shes-cb-header-status {
    font-size: 11px;
    color: var(--cb-teal);
    display: flex;
    align-items: center;
    gap: 4px;
}

.shes-cb-header-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--cb-teal);
    border-radius: 50%;
}

.shes-cb-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.5);
    cursor: pointer;
    padding: 4px;
    font-size: 20px;
    line-height: 1;
    transition: color 0.2s;
}

.shes-cb-close:hover {
    color: #fff;
}

/* ─── MESSAGES ──────────────────────────────────── */
.shes-cb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 340px;
    min-height: 200px;
    scroll-behavior: smooth;
}

.shes-cb-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
    animation: cbFadeIn 0.3s ease;
}

@keyframes cbFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.shes-cb-msg.bot {
    background: var(--cb-light);
    color: var(--cb-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.shes-cb-msg.user {
    background: var(--cb-dark);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.shes-cb-msg.bot a {
    color: var(--cb-teal);
    text-decoration: none;
    font-weight: 500;
}

.shes-cb-msg.bot a:hover {
    text-decoration: underline;
}

/* ─── TYPING INDICATOR ─────────────────────────── */
.shes-cb-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}

.shes-cb-typing span {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: cbDot 1.4s infinite;
}

.shes-cb-typing span:nth-child(2) { animation-delay: 0.2s; }
.shes-cb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cbDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ─── QUICK REPLIES ─────────────────────────────── */
.shes-cb-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.shes-cb-quick button {
    background: none;
    border: 1px solid var(--cb-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-family: inherit;
    color: var(--cb-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.shes-cb-quick button:hover {
    background: var(--cb-teal);
    color: #fff;
    border-color: var(--cb-teal);
}

/* ─── INPUT ─────────────────────────────────────── */
.shes-cb-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--cb-border);
}

.shes-cb-input {
    flex: 1;
    border: 1px solid var(--cb-border);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: var(--cb-light);
}

.shes-cb-input:focus {
    border-color: var(--cb-teal);
}

.shes-cb-input::placeholder {
    color: #aaa;
}

.shes-cb-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cb-dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.shes-cb-send:hover {
    background: var(--cb-teal);
}

.shes-cb-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.shes-cb-send svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* ─── POWERED BY ────────────────────────────────── */
.shes-cb-powered {
    text-align: center;
    padding: 6px;
    font-size: 9px;
    color: #bbb;
    letter-spacing: 0.5px;
}

/* ─── SCROLLBAR ─────────────────────────────────── */
.shes-cb-messages::-webkit-scrollbar {
    width: 4px;
}

.shes-cb-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* ─── MOBILE ────────────────────────────────────── */
@media (max-width: 480px) {
    #shes-chatbot-root {
        bottom: 16px;
        right: 16px;
    }

    .shes-cb-window {
        width: calc(100vw - 32px);
        max-height: 70vh;
        bottom: 68px;
        right: 0;
    }

    .shes-cb-toggle {
        width: 52px;
        height: 52px;
    }

    .shes-cb-toggle svg {
        width: 24px;
        height: 24px;
    }
}
