/* Sopheva Compact & Premium Chat Widget Styles */
#hw-chat-widget { position: fixed; bottom: 40px; right: 40px; z-index: 9999; font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; display: flex; flex-direction: column; align-items: flex-end; }

/* Floating Prompt Badge */
.hw-chat-badge { margin-bottom: 12px; background: #ffffff; border: 1px solid #ebd5d0; padding: 8px 16px; border-radius: 20px; box-shadow: 0 8px 24px rgba(163, 53, 30, 0.15); display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #a3351e; cursor: pointer; animation: hwBounce 2s infinite ease-in-out; transition: opacity 0.3s, transform 0.3s; }
.hw-chat-badge:hover { transform: scale(1.05); }
.hw-badge-dot { width: 8px; height: 8px; background-color: #10b981; border-radius: 50%; box-shadow: 0 0 8px #10b981; animation: hwPulse 2s infinite; }

/* Toggle Button with Pulse Effect */
#hw-chat-toggle { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #a3351e, #892816); color: #fff; border: none; box-shadow: 0 6px 20px rgba(163, 53, 30, 0.35); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); position: relative; z-index: 10; }
#hw-chat-toggle::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%; border: 2px solid #a3351e; animation: hwRipple 2s infinite ease-in-out; z-index: -1; }
#hw-chat-toggle:hover { transform: scale(1.08) rotate(5deg); box-shadow: 0 8px 28px rgba(163, 53, 30, 0.45); }
#hw-chat-toggle span { font-size: 28px; }

/* Chat Window */
#hw-chat-window { position: absolute; bottom: 76px; right: 0; width: 330px; height: 480px; background: #ffffff; border-radius: 20px; box-shadow: 0 12px 40px rgba(163, 53, 30, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #f2e9e6; transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1); transform-origin: bottom right; z-index: 20; }
#hw-chat-window.hidden { opacity: 0; transform: scale(0.85); pointer-events: none; }
.hw-chat-header { background: linear-gradient(135deg, #a3351e, #7a2514); color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.hw-chat-title { font-weight: 600; font-size: 15px; letter-spacing: 0.2px; }
.hw-online-dot { width: 8px; height: 8px; background-color: #10b981; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px #10b981; animation: hwPulse 2s infinite; }
#hw-chat-reset { background: none; border: none; color: #fff; cursor: pointer; opacity: 0.8; padding: 0 4px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
#hw-chat-reset:hover { opacity: 1; transform: rotate(180deg) scale(1.1); }
#hw-chat-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 18px; opacity: 0.8; padding: 0 4px; transition: all 0.2s; }
#hw-chat-close:hover { opacity: 1; transform: scale(1.1); }
#hw-chat-messages { flex: 1; padding: 14px; overflow-y: auto; background: #fdfbfb; display: flex; flex-direction: column; gap: 10px; }
.hw-chat-message { display: flex; gap: 8px; align-items: flex-end; animation: hwFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.hw-chat-ai { justify-content: flex-start; }
.hw-chat-user { justify-content: flex-end; }
.hw-chat-avatar { width: 26px; height: 26px; background: #ebd5d0; color: #a3351e; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 6px rgba(163,53,30,0.1); }
.hw-chat-avatar span { font-size: 15px; }
.hw-chat-bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 13px; line-height: 1.45; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.hw-chat-ai .hw-chat-bubble { background: #fff; border: 1px solid #f2e9e6; border-bottom-left-radius: 4px; color: #4a3530; }
.hw-chat-user .hw-chat-bubble { background: linear-gradient(135deg, #a3351e, #892816); color: #fff; border-bottom-right-radius: 4px; }
.hw-chat-input-area { padding: 10px 14px; background: #fff; border-top: 1px solid #f2e9e6; display: flex; gap: 8px; align-items: center; }
#hw-chat-input { flex: 1; padding: 10px 14px; border: 1px solid #ebd5d0; border-radius: 20px; font-size: 13px; outline: none; transition: all 0.2s; background: #faf8f7; color: #4a3530; }
#hw-chat-input:focus { border-color: #a3351e; background: #fff; box-shadow: 0 0 0 3px rgba(163,53,30,0.1); }
#hw-chat-send { background: linear-gradient(135deg, #a3351e, #892816); color: #fff; border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; box-shadow: 0 2px 8px rgba(163,53,30,0.2); }
#hw-chat-send:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 4px 12px rgba(163,53,30,0.3); }
#hw-chat-send span { font-size: 18px; }
#hw-chat-send:disabled { background: #ebd5d0; cursor: not-allowed; box-shadow: none; }

/* Mobile Optimization with Smooth Slide Sheet */
@media (max-width: 480px) {
    #hw-chat-widget { bottom: 16px; right: 16px; }
    #hw-chat-window { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100vw; height: 100dvh; height: -webkit-fill-available; border-radius: 0; transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1); transform-origin: center bottom; display: flex; flex-direction: column; z-index: 999999; }
    #hw-chat-window.hidden { opacity: 0; transform: translateY(100%); pointer-events: none; }
    .hw-chat-badge { font-size: 12px; padding: 6px 12px; }
    #hw-chat-input { font-size: 16px !important; padding: 10px 14px; }
    .hw-chat-input-area { flex-shrink: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: #fff; z-index: 10; }
    #hw-chat-messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* Quick Replies */
.hw-quick-replies { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px 6px 14px; background: #fdfbfb; border-top: 1px solid #f2e9e6; scrollbar-width: none; }
.hw-quick-replies::-webkit-scrollbar { display: none; }
.hw-quick-reply { flex-shrink: 0; background: #f2e9e6; color: #a3351e; border: 1px solid #ebd5d0; padding: 6px 12px; border-radius: 16px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; }
.hw-quick-reply:hover { background: #a3351e; color: #fff; border-color: #a3351e; transform: translateY(-1px); }

/* Animations */
@keyframes hwFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes hwPulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}
@keyframes hwBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes hwRipple {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.35); opacity: 0; }
}
