/* BarberPro Widget Chat — Floating booking assistant */
:root { --bp-wc-cor: #f5a623; }

/* ── Wrapper ── */
.bp-wc-wrap {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.bp-wc-right { right: 24px; }
.bp-wc-left  { left: 24px; }

/* ── Botão flutuante ── */
.bp-wc-toggle {
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--bp-wc-cor);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.25), 0 0 0 0 rgba(245,166,35,.4);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    transition: transform .2s, box-shadow .2s;
    animation: bpWcPulse 2.5s infinite;
    position: relative;
}
.bp-wc-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0,0,0,.3);
    animation: none;
}
@keyframes bpWcPulse {
    0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,.25), 0 0 0 0 rgba(245,166,35,.4); }
    50%      { box-shadow: 0 4px 20px rgba(0,0,0,.25), 0 0 0 10px rgba(245,166,35,.0); }
}
.bp-wc-badge {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: #fff;
    width: 20px; height: 20px; border-radius: 50%;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}

/* ── Janela do chat ── */
.bp-wc-window {
    position: absolute;
    bottom: 74px;
    width: 340px;
    max-height: 580px;
    background: #1a1a2e;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
    overflow: hidden;
    display: flex; flex-direction: column;
    animation: bpWcSlideIn .25s cubic-bezier(.34,1.56,.64,1);
}
.bp-wc-right .bp-wc-window { right: 0; }
.bp-wc-left  .bp-wc-window { left: 0; }

@keyframes bpWcSlideIn {
    from { opacity:0; transform: translateY(16px) scale(.96); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}

/* ── Header ── */
.bp-wc-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 16px 14px;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.bp-wc-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bp-wc-cor);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.bp-wc-bot-initial { font-size: 1.1rem; font-weight: 800; color: #fff; }
.bp-wc-header-info { flex: 1; min-width: 0; }
.bp-wc-bot-name { font-weight: 700; font-size: .92rem; color: #fff; }
.bp-wc-bot-status {
    font-size: .72rem; color: rgba(255,255,255,.5);
    display: flex; align-items: center; gap: 5px; margin-top: 2px;
}
.bp-wc-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #10b981; flex-shrink: 0;
    box-shadow: 0 0 4px #10b981;
}
.bp-wc-header-close {
    background: rgba(255,255,255,.08); border: none; cursor: pointer;
    color: rgba(255,255,255,.5); padding: 6px; border-radius: 8px;
    transition: background .15s, color .15s;
    display: flex; align-items: center;
}
.bp-wc-header-close:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Mensagens ── */
.bp-wc-messages {
    flex: 1; overflow-y: auto; padding: 16px 14px 8px;
    display: flex; flex-direction: column; gap: 10px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent;
}
.bp-wc-messages::-webkit-scrollbar { width: 4px; }
.bp-wc-messages::-webkit-scrollbar-track { background: transparent; }
.bp-wc-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.bp-wc-msg { display: flex; flex-direction: column; max-width: 84%; }
.bp-wc-msg-bot  { align-self: flex-start; }
.bp-wc-msg-user { align-self: flex-end; }

.bp-wc-msg-bubble {
    padding: 10px 14px; border-radius: 16px;
    font-size: .845rem; line-height: 1.55;
    word-break: break-word;
}
.bp-wc-msg-bot .bp-wc-msg-bubble {
    background: #16213e; color: #e2e8f0;
    border-bottom-left-radius: 4px;
}
.bp-wc-msg-user .bp-wc-msg-bubble {
    background: var(--bp-wc-cor); color: #fff;
    border-bottom-right-radius: 4px;
}
.bp-wc-msg-bubble strong, .bp-wc-msg-bubble b { color: inherit; font-weight: 700; }
.bp-wc-msg-bubble em { opacity: .75; font-style: italic; }

/* Grade de horários dentro do balão */
.bp-wc-slot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.bp-wc-slot-btn {
    flex: 0 0 auto;
    min-width: 52px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: #e2e8f0;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.bp-wc-slot-btn:hover {
    background: var(--bp-wc-cor);
    border-color: var(--bp-wc-cor);
    color: #fff;
    transform: translateY(-1px);
}
.bp-wc-slot-btn:active { transform: scale(.97); }

/* Pagamento online (botão — não link markdown) */
.bp-wc-pay-wrap {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.bp-wc-pay-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--bp-wc-cor), #d97706);
    color: #fff;
    font-size: .88rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: transform .12s, box-shadow .15s, filter .15s;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.bp-wc-pay-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}
.bp-wc-pay-btn:active { transform: scale(.98); }

.bp-wc-msg-time {
    font-size: .65rem; color: rgba(255,255,255,.25);
    margin-top: 3px; padding: 0 4px;
}
.bp-wc-msg-user .bp-wc-msg-time { text-align: right; }

/* Typing indicator */
.bp-wc-typing {
    animation: bpWcMsgIn .15s ease-out;
}
.bp-wc-typing .bp-wc-msg-bubble {
    padding: 12px 16px;
}
.bp-wc-typing-dots { display: flex; gap: 4px; align-items: center; }
.bp-wc-typing-dots span {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,.4);
    animation: bpWcDot 1.1s ease-in-out infinite;
}
.bp-wc-typing-dots span:nth-child(2) { animation-delay: .15s; }
.bp-wc-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bpWcDot {
    0%,80%,100% { transform: translateY(0) scale(1); opacity:.3; }
    40%          { transform: translateY(-5px) scale(1.15); opacity:1; }
}

/* Animação de entrada das mensagens */
.bp-wc-msg-in {
    animation: bpWcMsgIn .2s ease-out;
}
@keyframes bpWcMsgIn {
    from { opacity:0; transform: translateY(6px); }
    to   { opacity:1; transform: translateY(0); }
}

/* Mensagem de sucesso */
.bp-wc-msg-success .bp-wc-msg-bubble {
    background: linear-gradient(135deg, #064e3b, #065f46);
    border: 1px solid rgba(16,185,129,.3);
}

/* ── Quick replies ── */
.bp-wc-quick-replies {
    padding: 6px 14px 10px;
    display: flex; flex-wrap: wrap; gap: 6px;
    flex-shrink: 0;
}
.bp-wc-qr {
    padding: 6px 14px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.05); color: rgba(255,255,255,.8);
    font-size: .78rem; font-weight: 600; cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    white-space: nowrap;
}
.bp-wc-qr:hover {
    background: var(--bp-wc-cor);
    border-color: var(--bp-wc-cor); color: #fff;
    transform: translateY(-1px);
}
.bp-wc-qr:active { transform: scale(.96); }

/* ── Input ── */
.bp-wc-input-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.bp-wc-input {
    flex: 1; background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1); border-radius: 24px;
    color: #fff; padding: 10px 16px; font-size: .86rem;
    outline: none; transition: border-color .2s;
}
.bp-wc-input::placeholder { color: rgba(255,255,255,.3); }
.bp-wc-input:focus { border-color: var(--bp-wc-cor); }
.bp-wc-send {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bp-wc-cor); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
    transition: transform .15s, opacity .15s;
}
.bp-wc-send:hover { transform: scale(1.08); }
.bp-wc-send:disabled { opacity: .4; cursor: default; }

/* ── Powered by ── */
.bp-wc-powered {
    text-align: center; font-size: .62rem;
    color: rgba(255,255,255,.18); padding: 0 0 10px;
    letter-spacing: .3px;
}

/* ── Responsivo ── */
@media (max-width: 400px) {
    .bp-wc-window { width: calc(100vw - 32px); }
    .bp-wc-right { right: 16px; }
    .bp-wc-left  { left: 16px; }
    .bp-wc-wrap  { bottom: 16px; }
}
