/* WP Smart Chat - Widget Styles */
#wpsc-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

#wpsc-widget *,
#wpsc-widget *::before,
#wpsc-widget *::after {
    box-sizing: inherit;
}

/* -------------------------------------------------------
   Toggle Button
------------------------------------------------------- */
#wpsc-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wpsc-primary, #2563eb);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(37,99,235,.4);
    transition: transform .2s, box-shadow .2s;
    margin-left: auto;
}

#wpsc-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37,99,235,.5);
}

/* -------------------------------------------------------
   Chat Window
------------------------------------------------------- */
#wpsc-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-height: 540px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wpscSlideUp .25s ease;
}

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

/* -------------------------------------------------------
   Header
------------------------------------------------------- */
#wpsc-header {
    background: var(--wpsc-primary, #2563eb);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#wpsc-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#wpsc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

#wpsc-bot-name {
    font-weight: 600;
    font-size: 14px;
}

#wpsc-status {
    font-size: 11px;
    opacity: .8;
}
#wpsc-status::before {
    content: '●';
    color: #4ade80;
    margin-right: 4px;
    font-size: 10px;
}

#wpsc-close-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    opacity: .8;
    padding: 4px;
    line-height: 1;
    transition: opacity .2s;
}
#wpsc-close-btn:hover { opacity: 1; }

/* -------------------------------------------------------
   Messages
------------------------------------------------------- */
#wpsc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

#wpsc-messages::-webkit-scrollbar { width: 4px; }
#wpsc-messages::-webkit-scrollbar-track { background: transparent; }
#wpsc-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.wpsc-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.wpsc-msg-bot {
    background: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.wpsc-msg-user {
    background: var(--wpsc-primary, #2563eb);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.wpsc-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    background: #f1f5f9;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.wpsc-typing span {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: wpscBounce 1.2s infinite;
}
.wpsc-typing span:nth-child(2) { animation-delay: .2s; }
.wpsc-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes wpscBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-6px); }
}

/* -------------------------------------------------------
   FAQ Quick Buttons
------------------------------------------------------- */
#wpsc-faq-buttons {
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.wpsc-faq-btn {
    background: #eff6ff;
    color: var(--wpsc-primary, #2563eb);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.wpsc-faq-btn:hover {
    background: var(--wpsc-primary, #2563eb);
    color: #fff;
    border-color: transparent;
}

/* -------------------------------------------------------
   Input Area
------------------------------------------------------- */
#wpsc-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    gap: 8px;
    flex-shrink: 0;
}

#wpsc-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 13.5px;
    outline: none;
    transition: border-color .2s;
    background: #f8fafc;
}
#wpsc-input:focus {
    border-color: var(--wpsc-primary, #2563eb);
    background: #fff;
}

#wpsc-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--wpsc-primary, #2563eb);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity .2s;
}
#wpsc-send:hover  { opacity: .85; }
#wpsc-send:disabled { opacity: .4; cursor: not-allowed; }

/* -------------------------------------------------------
   Footer
------------------------------------------------------- */
#wpsc-footer {
    text-align: center;
    font-size: 10px;
    color: #aaa;
    padding: 4px 0 6px;
    flex-shrink: 0;
}

/* -------------------------------------------------------
   Mobile
------------------------------------------------------- */
@media (max-width: 480px) {
    #wpsc-widget { bottom: 12px; right: 12px; }
    #wpsc-window {
        width: calc(100vw - 24px);
        max-height: 70vh;
        right: 0;
    }
}
