/* HOY AI Chatbot — floating widget */
:root {
    --hoy-chat-orange: #E8471C;
    --hoy-chat-orange-dark: #D13D18;
    --hoy-chat-navy: #05101E;
    --hoy-chat-bg: #FFFFFF;
    --hoy-chat-user-bg: #E8471C;
    --hoy-chat-user-text: #FFFFFF;
    --hoy-chat-bot-bg: #F3F3F0;
    --hoy-chat-bot-text: #1A1A1A;
}

#hoy-chat-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--hoy-chat-orange);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(232, 71, 28, 0.35), 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: transform 0.2s ease, background 0.2s ease;
    animation: hoy-chat-pulse 2.4s ease-in-out infinite;
}
#hoy-chat-toggle:hover { background: var(--hoy-chat-orange-dark); transform: scale(1.05); }
#hoy-chat-toggle svg { width: 26px; height: 26px; }
#hoy-chat-toggle.hidden { display: none; }

@keyframes hoy-chat-pulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(232, 71, 28, 0.35), 0 0 0 0 rgba(232, 71, 28, 0.45); }
    50%      { box-shadow: 0 10px 30px rgba(232, 71, 28, 0.35), 0 0 0 14px rgba(232, 71, 28, 0); }
}

#hoy-chat-window {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 360px;
    height: 540px;
    max-height: calc(100vh - 140px);
    background: var(--hoy-chat-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(5, 16, 30, 0.25), 0 4px 20px rgba(0,0,0,0.08);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
}
#hoy-chat-window.open { display: flex; animation: hoy-chat-in 0.2s ease; }

@keyframes hoy-chat-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hoy-chat-header {
    background: var(--hoy-chat-navy);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.hoy-chat-header-title { font-weight: 600; letter-spacing: 0.5px; }
.hoy-chat-header-title small { display: block; font-size: 11px; opacity: 0.6; font-weight: 300; }
.hoy-chat-header-actions { display: flex; gap: 8px; }
.hoy-chat-header-actions button {
    background: transparent; border: none; color: #fff; cursor: pointer;
    padding: 4px 8px; font-size: 12px; opacity: 0.7;
}
.hoy-chat-header-actions button:hover { opacity: 1; }

.hoy-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #FAFAF8;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hoy-chat-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.hoy-chat-msg.bot {
    background: var(--hoy-chat-bot-bg);
    color: var(--hoy-chat-bot-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.hoy-chat-msg.user {
    background: var(--hoy-chat-user-bg);
    color: var(--hoy-chat-user-text);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.hoy-chat-msg a { color: inherit; text-decoration: underline; }

.hoy-chat-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    background: var(--hoy-chat-bot-bg);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.hoy-chat-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: #999;
    animation: hoy-chat-bounce 1.3s ease-in-out infinite;
}
.hoy-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.hoy-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hoy-chat-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

.hoy-chat-form {
    border-top: 1px solid #EEE;
    background: #fff;
    padding: 10px;
    display: flex;
    gap: 8px;
}
.hoy-chat-form input {
    flex: 1;
    border: 1px solid #DDD;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
}
.hoy-chat-form input:focus { border-color: var(--hoy-chat-orange); }
.hoy-chat-form button {
    background: var(--hoy-chat-orange);
    border: none;
    color: #fff;
    border-radius: 10px;
    padding: 0 16px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}
.hoy-chat-form button:disabled { background: #CCC; cursor: not-allowed; }
.hoy-chat-form button:hover:not(:disabled) { background: var(--hoy-chat-orange-dark); }

@media (max-width: 640px) {
    #hoy-chat-window {
        right: 0; bottom: 0; left: 0; top: 0;
        width: 100%; height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    #hoy-chat-toggle { right: 16px; bottom: 16px; }
}
