:root {
    --chat-primary: #C9A84C;
    --chat-primary-dark: #a88a2e;
    --chat-bg: #0F172A;
    --chat-bg-light: #1E293B;
    --chat-bg-card: #1E293B;
    --chat-text: #F8F7F4;
    --chat-text-muted: #94A3B8;
    --chat-user-bg: #C9A84C;
    --chat-user-text: #0F172A;
    --chat-border: rgba(201, 168, 76, 0.25);
    --chat-shadow: rgba(0, 0, 0, 0.4);
    --chat-radius: 16px;
}

.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-primary);
    border: none;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(201, 168, 76, 0.55);
}
.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: #0F172A;
    transition: opacity 0.3s ease;
}
.chatbot-toggle .icon-close {
    display: none;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #0F172A;
    stroke-width: 2.5;
    stroke-linecap: round;
}
.chatbot-toggle.is-open .icon-chat { display: none; }
.chatbot-toggle.is-open .icon-close { display: block; }

.chatbot-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-height: 580px;
    height: 580px;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius);
    box-shadow: 0 8px 40px var(--chat-shadow);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    animation: chatSlideUp 0.3s ease;
}
.chatbot-panel.is-open {
    display: flex;
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--chat-border);
    background: var(--chat-bg-light);
    flex-shrink: 0;
}
.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--chat-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #0F172A;
    font-weight: 700;
    flex-shrink: 0;
}
.chatbot-header-text h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--chat-text);
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}
.chatbot-header-text p {
    font-size: 11px;
    color: var(--chat-text-muted);
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}
.chatbot-header-close {
    background: none;
    border: none;
    color: var(--chat-text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}
.chatbot-header-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--chat-text);
}
.chatbot-header-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chat-border);
    border-radius: 3px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    font-family: 'Source Sans Pro', sans-serif;
    word-wrap: break-word;
    animation: msgFadeIn 0.25s ease;
}
@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
    align-self: flex-end;
    background: var(--chat-user-bg);
    color: var(--chat-user-text);
    border-bottom-right-radius: 4px;
}
.chat-message.assistant {
    align-self: flex-start;
    background: var(--chat-bg-light);
    color: var(--chat-text);
    border: 1px solid var(--chat-border);
    border-bottom-left-radius: 4px;
}
.chat-message.assistant p { margin: 0 0 6px 0; }
.chat-message.assistant p:last-child { margin-bottom: 0; }

.chat-message .msg-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

.typing-indicator {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 18px;
    background: var(--chat-bg-light);
    border: 1px solid var(--chat-border);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    animation: msgFadeIn 0.2s ease;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chat-text-muted);
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.chatbot-suggested {
    padding: 0 16px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chatbot-suggested button {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 12px;
    border: 1px solid var(--chat-border);
    background: rgba(201,168,76,0.08);
    color: var(--chat-primary);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.chatbot-suggested button:hover {
    background: rgba(201,168,76,0.2);
    border-color: var(--chat-primary);
}

.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-bg-light);
    flex-shrink: 0;
}
.chatbot-input-area input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--chat-border);
    background: var(--chat-bg);
    color: var(--chat-text);
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.chatbot-input-area input::placeholder {
    color: var(--chat-text-muted);
}
.chatbot-input-area input:focus {
    border-color: var(--chat-primary);
}
.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--chat-primary);
    color: #0F172A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.chatbot-send-btn:hover {
    background: var(--chat-primary-dark);
    transform: scale(1.05);
}
.chatbot-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.chatbot-send-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chatbot-human-btn {
    text-align: center;
    padding: 8px 16px 12px;
    flex-shrink: 0;
}
.chatbot-human-btn button {
    background: none;
    border: none;
    font-size: 11px;
    color: var(--chat-text-muted);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.chatbot-human-btn button:hover {
    color: var(--chat-primary);
}

@media (max-width: 480px) {
    .chatbot-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
    .chatbot-toggle {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
    .chatbot-toggle.is-open {
        display: none;
    }
}
