/* AI Chat Widget - Westy */
#chatToggle {
    position: fixed; bottom: 20px; right: 20px; z-index: 9998;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent, #d69e2e); color: var(--primary-dark, #0f2744);
    border: none; font-size: 1.5rem; cursor: pointer;
    box-shadow: 0 10px 15px rgba(0,0,0,0.2); transition: all 0.3s ease;
}
#chatToggle:hover { transform: scale(1.08); }
.chat-pulse {
    position: absolute; top: 2px; right: 2px; width: 12px; height: 12px;
    background: #38a169; border-radius: 50%; border: 2px solid #fff;
    animation: chatPulse 2s infinite;
}
@keyframes chatPulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

#chatPanel {
    display: none; position: fixed; bottom: 88px; right: 20px; z-index: 9998;
    width: 340px; max-width: calc(100vw - 40px); height: 480px; max-height: 70vh;
    background: #fff; border-radius: 12px;
    box-shadow: 0 20px 25px rgba(0,0,0,0.15); flex-direction: column; overflow: hidden;
    border: 1px solid #e2e8f0;
}
#chatPanel.open { display: flex; }

.chat-header {
    background: linear-gradient(135deg, #1a365d 0%, #0f2744 100%);
    color: #fff; padding: 0.875rem 1rem;
    display: flex; align-items: center; gap: 0.75rem;
}
.chat-avatar {
    width: 36px; height: 36px; background: #d69e2e;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #0f2744; font-size: 1rem; flex-shrink: 0;
}
.chat-header small { display: block; font-size: 0.7rem; opacity: .85; }
.chat-dot { display: inline-block; width: 7px; height: 7px; background: #4ade80; border-radius: 50%; margin-right: 4px; }
.chat-close { margin-left: auto; background: none; border: none; color: #fff; cursor: pointer; font-size: 1rem; }

#chatBody { flex: 1; overflow-y: auto; padding: 1rem; background: #f7fafc; }
.chat-msg { max-width: 85%; padding: 0.625rem 0.875rem; border-radius: 14px; margin-bottom: 0.625rem; font-size: 0.85rem; line-height: 1.5; white-space: pre-line; }
.chat-msg.bot { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.chat-msg.user { background: #1a365d; color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-msg a { color: #2c5282; font-weight: 600; }

.chat-chips { display: flex; gap: 0.375rem; padding: 0.5rem 0.75rem; flex-wrap: wrap; background: #fff; border-top: 1px solid #e2e8f0; }
.chat-chips button {
    border: 1px solid #e2e8f0; background: #f7fafc;
    border-radius: 20px; padding: 0.25rem 0.75rem; font-size: 0.75rem;
    cursor: pointer; color: #4a5568;
}
.chat-chips button:hover { background: #edf2f7; }

#chatForm { display: flex; gap: 0.5rem; padding: 0.75rem; background: #fff; }
#chatInput { flex: 1; border: 1px solid #e2e8f0; border-radius: 20px; padding: 0.5rem 1rem; font-size: 0.875rem; }
#chatInput:focus { outline: none; border-color: #2c5282; }
#chatForm button {
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: #d69e2e; color: #0f2744; cursor: pointer;
}

@media (max-width: 480px) {
    #chatPanel { right: 10px; left: 10px; width: auto; bottom: 80px; }
    #chatToggle { right: 14px; bottom: 14px; }
}
