/* WPFreeSupport AI Blogger — Chatbot Widget */
:root {
    --wpfs-bot-color: #2271b1;
    --wpfs-bot-radius: 16px;
}

/* Wrapper */
.wpfs-chat-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Bubble */
.wpfs-chat-bubble {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--wpfs-bot-color, #2271b1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    transition: transform .2s, box-shadow .2s;
    position: relative;
}

.wpfs-chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,.3);
}

.wpfs-chat-bubble svg {
    width: 26px;
    height: 26px;
}

.wpfs-chat-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #e64646;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 2px solid #fff;
}

/* Window */
.wpfs-chat-window {
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: var(--wpfs-bot-radius);
    box-shadow: 0 8px 40px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 12px;
    animation: wpfs-slide-up .25s ease;
}

@keyframes wpfs-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* Header */
.wpfs-chat-header {
    background: var(--wpfs-bot-color, #2271b1);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--wpfs-bot-radius) var(--wpfs-bot-radius) 0 0;
}

.wpfs-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.wpfs-chat-header strong { font-size: 15px; display: block; }

.wpfs-chat-status {
    font-size: 11px;
    opacity: .85;
    color: #90ee90;
}

.wpfs-chat-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
}

.wpfs-chat-close:hover { background: rgba(0,0,0,.15); color: #fff; }

/* Messages */
.wpfs-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.wpfs-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    animation: wpfs-msg-in .2s ease;
}

@keyframes wpfs-msg-in {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1);   }
}

.wpfs-msg-bot {
    background: #fff;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.wpfs-msg-user {
    background: var(--wpfs-bot-color, #2271b1);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.wpfs-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.wpfs-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #aab;
    animation: wpfs-bounce 1.2s infinite ease-in-out;
}

.wpfs-typing span:nth-child(2) { animation-delay: .2s; }
.wpfs-typing span:nth-child(3) { animation-delay: .4s; }

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

/* Input */
.wpfs-chat-input-wrap {
    padding: 12px 14px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    background: #fff;
}

.wpfs-chat-input-wrap input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}

.wpfs-chat-input-wrap input:focus { border-color: var(--wpfs-bot-color, #2271b1); }

#wpfs-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--wpfs-bot-color, #2271b1);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity .15s;
}

#wpfs-chat-send:hover { opacity: .85; }
#wpfs-chat-send svg { width: 16px; height: 16px; }

/* Footer */
.wpfs-chat-footer {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    padding: 6px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

/* Mobile */
@media (max-width: 480px) {
    .wpfs-chat-wrapper { bottom: 16px; right: 16px; }
    .wpfs-chat-window  { width: calc(100vw - 32px); }
}

/* ── User Registration Form ──────────────────────────────────────────────── */
.wpfs-chat-user-form {
    flex: 1;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
    justify-content: center;
}

.wpfs-chat-user-form p {
    margin: 0 0 4px;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}

.wpfs-chat-user-form input[type="text"],
.wpfs-chat-user-form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    background: #fff;
    transition: border-color .15s;
}

.wpfs-chat-user-form input:focus {
    border-color: var(--wpfs-bot-color, #2271b1);
}

.wpfs-chat-user-form button#wpfs-chat-start-btn {
    margin-top: 4px;
    padding: 10px 0;
    background: var(--wpfs-bot-color, #2271b1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    width: 100%;
}

.wpfs-chat-user-form button#wpfs-chat-start-btn:hover { opacity: .88; }
.wpfs-chat-user-form button#wpfs-chat-start-btn:disabled { opacity: .55; cursor: not-allowed; }

.wpfs-chat-reg-error {
    color: #c0392b;
    font-size: 12px;
    background: #fff5f5;
    border: 1px solid #f5c6c6;
    border-radius: 6px;
    padding: 6px 10px;
}
