/* Healthcare AI Chatbot Pro — Frontend Styles */
#hc-bot-container {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Greeting Bubble ── */
#hc-greeting-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    font-size: 14px;
    color: #333;
    width: 230px;
    line-height: 1.5;
    z-index: 1000000;
}

#hc-greeting-bubble .hc-arrow {
    position: absolute;
    bottom: -8px;
    right: 28px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

/* ── Launcher ── */
#hc-bot-launcher {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#hc-bot-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.hc-circle { border-radius: 50%; }
.hc-square  { border-radius: 12px; }

/* ── Chat Window ── */
#hc-bot-window {
    display: none;
    width: 370px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    overflow: hidden;
    margin-bottom: 16px;
    flex-direction: column;
}

/* ── Header ── */
#hc-bot-header {
    padding: 14px 16px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hc-header-info { display: flex; align-items: center; gap: 10px; }
.hc-header-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.4); }
.hc-bot-name { font-weight: 600; font-size: 15px; }
.hc-bot-status { font-size: 11px; opacity: 0.85; }
#hc-bot-close {
    background: none; border: none; color: #fff;
    font-size: 22px; cursor: pointer; padding: 0; line-height: 1;
    opacity: 0.8; transition: opacity 0.2s;
}
#hc-bot-close:hover { opacity: 1; }

/* ── Messages ── */
#hc-bot-messages {
    padding: 16px;
    height: 400px;
    overflow-y: auto;
    background: #f4f6fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#hc-bot-messages::-webkit-scrollbar { width: 5px; }
#hc-bot-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* Message bubbles */
.hc-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.hc-msg-row.user { flex-direction: row-reverse; }

.hc-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hc-msg {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 78%;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.hc-msg.bot  { background: #fff; color: #333; border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.hc-msg.user { color: #fff; border-bottom-right-radius: 4px; }

/* System/escalation notice */
.hc-system-msg {
    text-align: center;
    font-size: 12px;
    color: #666;
    background: #e8f4fd;
    border: 1px solid #bee3f8;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 4px 0;
}

/* Appointment CTA button */
.hc-appt-btn {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 10px;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    margin-top: 4px;
    text-align: left;
    transition: opacity 0.2s;
    max-width: 78%;
}
.hc-appt-btn:hover { opacity: 0.9; color: #fff !important; text-decoration: none; }

/* Typing indicator */
#hc-typing-indicator {
    display: none;
    align-items: flex-end;
    gap: 8px;
}
.hc-typing-dots {
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.hc-typing-dots span {
    width: 7px; height: 7px;
    background: #bbb;
    border-radius: 50%;
    animation: hc-bounce 1.2s infinite;
}
.hc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.hc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes hc-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Human agent notice */
.hc-agent-notice {
    text-align: center;
    font-size: 12px;
    color: #2271b1;
    background: #e6f2ff;
    padding: 8px;
    border-radius: 6px;
    font-weight: 600;
}

/* ── Pre-chat Form ── */
#hc-prechat-form {
    padding: 0;
    overflow-y: auto;
    height: 400px;
}
.hc-prechat-inner {
    padding: 20px;
}
#hc-prechat-form h3 { margin: 0 0 6px; font-size: 16px; color: #1a1a2e; text-align: center; }
#hc-prechat-form p  { margin: 0 0 16px; font-size: 13px; color: #666; text-align: center; }
#hc-prechat-form input,
#hc-prechat-form select {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}
#hc-prechat-form input:focus,
#hc-prechat-form select:focus { border-color: #0056b3; }
#hc-btn-start {
    width: 100%;
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 14px;
    transition: opacity 0.2s;
}
#hc-btn-start:hover { opacity: 0.9; }
.hc-hipaa-notice {
    font-size: 11px;
    color: #555;
    background: #f7f9fc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    line-height: 1.5;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.hc-hipaa-icon { color: #ccc; font-size: 8px; margin-top: 4px; flex-shrink: 0; }
.hc-prechat-footer {
    text-align: center;
    font-size: 10px;
    color: #aaa;
    letter-spacing: 0.08em;
    margin-top: 8px;
}

/* ── Input Area ── */
#hc-bot-input-area {
    padding: 12px 14px;
    border-top: 1px solid #eef0f5;
    display: flex;
    gap: 10px;
    background: #fff;
    align-items: center;
}
#hc-bot-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 10px 16px;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
}
#hc-bot-input:focus { border-color: #0056b3; }
#hc-bot-send {
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s;
}
#hc-bot-send:hover { opacity: 0.9; transform: scale(1.05); }
