/* =====================================================
   PexInsure Breakdown Chatbot — chatbot.css
   ===================================================== */

/* ---- Widget container (fixed bottom-right) ---- */
#pex-chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Toggle button ---- */
#pex-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a56db;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(26,86,219,.45);
    transition: background .2s, transform .15s;
}
#pex-chat-toggle:hover { background: #1648c0; transform: scale(1.05); }

/* ---- Chat window ---- */
#pex-chat-window {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 360px;
    max-height: 560px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
#pex-chat-window[hidden] { display: none !important; }

/* ---- Header ---- */
#pex-chat-header {
    background: #1a56db;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pex-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}
.pex-header-name  { font-size: 14px; font-weight: 600; }
.pex-header-status { font-size: 11px; opacity: .85; }
#pex-chat-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    opacity: .8;
}
#pex-chat-close:hover { opacity: 1; }

/* ---- Messages area ---- */
#pex-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f9fafb;
}

/* ---- Individual message ---- */
.pex-msg { display: flex; flex-direction: column; max-width: 88%; gap: 3px; }
.pex-msg.bot  { align-self: flex-start; }
.pex-msg.user { align-self: flex-end; }

.pex-bubble {
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
}
.pex-msg.bot  .pex-bubble {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #111827;
    border-top-left-radius: 4px;
}
.pex-msg.user .pex-bubble {
    background: #1a56db;
    color: #fff;
    border-top-right-radius: 4px;
}
.pex-msg-time {
    font-size: 10.5px;
    color: #9ca3af;
}
.pex-msg.bot  .pex-msg-time { align-self: flex-start; }
.pex-msg.user .pex-msg-time { align-self: flex-end; }

/* ---- Typing indicator ---- */
.pex-typing { display: flex; gap: 5px; align-items: center; padding: 6px 2px; }
.pex-typing span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    animation: pexBlink 1.2s infinite;
}
.pex-typing span:nth-child(2) { animation-delay: .2s; }
.pex-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes pexBlink { 0%,80%,100%{opacity:.2} 40%{opacity:1} }

/* ---- Option buttons ---- */
.pex-options { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.pex-opt-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #1a56db;
    transition: background .15s, border-color .15s;
}
.pex-opt-btn:hover  { background: #eff6ff; border-color: #1a56db; }
.pex-opt-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Input area ---- */
#pex-input-area {
    border-top: 1px solid #e5e7eb;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    background: #fff;
}
#pex-user-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13.5px;
    outline: none;
    color: #111827;
    background: #f9fafb;
    transition: border-color .15s;
}
#pex-user-input:focus { border-color: #1a56db; background: #fff; }
#pex-send-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #1a56db;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: background .15s;
}
#pex-send-btn:hover { background: #1648c0; }

/* ---- Quote plan cards ---- */
.pex-plans-wrap { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.pex-plan-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
}
.pex-plan-card:hover { border-color: #1a56db; }
.pex-plan-name  { font-weight: 600; font-size: 14px; color: #111827; margin-bottom: 4px; }
.pex-plan-price { font-size: 22px; font-weight: 700; color: #1a56db; margin-bottom: 8px; }
.pex-plan-price span { font-size: 13px; font-weight: 400; color: #6b7280; }
.pex-plan-features { color: #4b5563; line-height: 1.7; margin-bottom: 10px; font-size: 12.5px; }
.pex-plan-features .feat { display: flex; align-items: center; gap: 5px; }
.pex-plan-features .feat.yes::before { content: '✓'; color: #16a34a; font-weight: 700; }
.pex-plan-features .feat.no::before  { content: '✗'; color: #dc2626; }
.pex-buy-btn {
    display: block;
    width: 100%;
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background .15s;
}
.pex-buy-btn:hover { background: #1648c0; color: #fff; text-decoration: none; }

/* ---- Add vehicle form ---- */
.pex-form-group { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.pex-form-group input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 13px;
    color: #111827;
    background: #f9fafb;
    outline: none;
}
.pex-form-group input:focus { border-color: #1a56db; background: #fff; }
.pex-form-submit {
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.pex-form-submit:hover { background: #1648c0; }
.pex-form-note { font-size: 11.5px; color: #6b7280; }

/* ---- Error message ---- */
.pex-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 13px;
    margin-top: 4px;
}

/* ---- Loader spinner ---- */
.pex-spinner {
    width: 18px; height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #1a56db;
    border-radius: 50%;
    animation: pexSpin .7s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes pexSpin { to { transform: rotate(360deg); } }

/* ---- Mobile ---- */
@media (max-width: 480px) {
    #pex-chat-window { width: calc(100vw - 32px); right: 0; bottom: 68px; }
    #pex-chatbot-widget { bottom: 16px; right: 16px; }
}
