/* ========================================
   Chatbot Pro v2.2.0 – Lake Zurich Open MRI
   Prefix: .hcp-
   ======================================== */

/* ── Container ── */
.hcp-bubble-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.hcp-bubble-container.hcp-pos-left {
    right: auto;
    left: 20px;
}

/* ── Launcher Bubble ── */
.hcp-chat-bubble {
    width: 60px;
    height: 60px;
    background: #0056b3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    animation: hcp-pulse 2s infinite;
    transition: transform 0.2s;
}
.hcp-chat-bubble:hover {
    transform: scale(1.08);
}
@keyframes hcp-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,86,179,0.5); }
    70%  { box-shadow: 0 0 0 14px rgba(0,86,179,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,86,179,0); }
}

/* ── Greeting Popup ── */
.hcp-greeting-popup {
    position: absolute;
    bottom: 78px;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    padding: 10px 18px;
    max-width: 260px;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}
.hcp-bubble-container.hcp-pos-left .hcp-greeting-popup {
    right: auto;
    left: 0;
}
.hcp-greeting-popup .hcp-arrow {
    position: absolute;
    bottom: -8px;
    right: 22px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}
.hcp-bubble-container.hcp-pos-left .hcp-greeting-popup .hcp-arrow {
    right: auto;
    left: 22px;
}

/* ── Chat Window ── */
.hcp-chat-window {
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 380px;
    max-height: 620px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.28);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}
.hcp-bubble-container.hcp-pos-left .hcp-chat-window {
    right: auto;
    left: 0;
}

/* ── Header ── */
.hcp-chat-header {
    background: #0056b3;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.hcp-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hcp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
}
.hcp-title {
    font-weight: 600;
    font-size: 14px;
}
.hcp-status {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}
.hcp-status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}
.hcp-close-window {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.hcp-close-window:hover { opacity: 1; }

/* ── Messages Area ── */
.hcp-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 320px;
    max-height: 420px;
}
.hcp-messages-area::-webkit-scrollbar { width: 5px; }
.hcp-messages-area::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.hcp-message {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
    animation: hcp-msg-in 0.2s ease-out;
}
@keyframes hcp-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hcp-message-user {
    background: #0056b3;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.hcp-message-ai {
    background: #e9ecef;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.hcp-message-sender {
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 2px;
    opacity: 0.65;
}
.hcp-system-notice {
    background: #e6f2ff;
    color: #0056b3;
    text-align: center;
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 20px;
    align-self: center;
    font-weight: 500;
}

/* ── Typing Indicator ── */
.hcp-typing {
    display: none;
    align-self: flex-start;
    background: #e9ecef;
    padding: 10px 14px;
    border-radius: 18px;
    margin: 4px 16px;
}
.hcp-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    margin: 0 2px;
    animation: hcp-bounce 1.4s infinite;
}
.hcp-typing span:nth-child(2) { animation-delay: 0.2s; }
.hcp-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes hcp-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ── Input Area ── */
.hcp-input-area {
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    background: #fff;
    flex-shrink: 0;
}
.hcp-input-field {
    flex: 1;
    border: 1px solid #cbd5e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.hcp-input-field:focus {
    border-color: #0056b3;
}
.hcp-input-field:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}
.hcp-send-btn {
    background: #0056b3;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.hcp-send-btn:hover { opacity: 0.9; }
.hcp-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Lead Form ── */
.hcp-lead-form {
    background: #fff;
    border: 2px solid #0056b3;
    border-radius: 16px;
    padding: 18px;
    margin: 8px 0;
    animation: hcp-msg-in 0.3s ease-out;
}
.hcp-lead-form h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #0056b3;
}
.hcp-lead-form input {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    box-sizing: border-box;
}
.hcp-lead-form input:focus {
    border-color: #0056b3;
    outline: none;
}
.hcp-lead-submit-btn {
    width: 100%;
    background: #0056b3;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.hcp-lead-submit-btn:hover { background: #004494; }
.hcp-lead-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Call CTA ── */
.hcp-call-cta {
    background: #fff5f5;
    border: 2px solid #d63638;
    border-radius: 16px;
    padding: 16px;
    margin: 10px 0;
    text-align: center;
    animation: hcp-msg-in 0.3s ease-out;
}
.hcp-call-cta-icon { font-size: 28px; }
.hcp-call-cta-title { font-size: 15px; font-weight: 700; color: #b91c1c; margin: 4px 0; }
.hcp-call-cta-sub { font-size: 12px; color: #888; margin-bottom: 8px; }
.hcp-call-button {
    display: inline-block;
    background: #d63638;
    color: #fff;
    text-decoration: none;
    padding: 8px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}
.hcp-call-button:hover { background: #b91c1c; color: #fff; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .hcp-chat-window {
        width: calc(100vw - 32px);
        right: 16px !important;
        left: 16px !important;
        bottom: 78px;
        max-height: 80vh;
    }
    .hcp-messages-area {
        min-height: 200px;
        max-height: 55vh;
    }
}
