/* Fox Stone Chatbot Widget */

#chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: "Poppins", sans-serif;
}

#chatbot-toggle {
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
    box-shadow: none;
    transition: transform 0.25s ease;
    animation: chatbot-bounce-in 0.7s ease both;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

#chatbot-toggle img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4));
}

#chatbot-toggle:hover {
    transform: scale(1.08);
}

#chatbot-toggle:hover img {
    filter: drop-shadow(0 8px 18px rgba(0, 194, 255, 0.35));
}

#chatbot-toggle:focus-visible {
    outline: 2px solid #00c2ff;
    outline-offset: 3px;
}

@keyframes chatbot-bounce-in {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.6);
    }
    60% {
        opacity: 1;
        transform: translateY(-6px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#chatbot-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(165deg, #132b1a 0%, #0d1f14 55%, #0a1a10 100%);
    border: 1px solid rgba(10, 122, 62, 0.45);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: bottom right;
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
    visibility: visible;
}

#chatbot-window.chatbot-hidden {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    visibility: hidden;
    pointer-events: none;
}

.chatbot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(90deg, #0a7a3e, #0d5c32);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.chatbot-header img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.chatbot-header-title {
    flex: 1;
    line-height: 1.2;
}

.chatbot-header-sub {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.85;
}

#chatbot-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

#chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(10, 122, 62, 0.5);
    border-radius: 3px;
}

.chatbot-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #ffffff;
    animation: chatbot-fade-up 0.3s ease both;
}

.chatbot-bubble.bot {
    align-self: flex-start;
    background: #0a7a3e;
    border-bottom-left-radius: 4px;
}

.chatbot-bubble.user {
    align-self: flex-end;
    background: #00c2ff;
    color: #0a1a10;
    font-weight: 500;
    border-bottom-right-radius: 4px;
}

.chatbot-bubble p {
    margin: 0;
}

.chatbot-bubble p + p {
    margin-top: 0.5em;
}

@keyframes chatbot-fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
    max-width: 100%;
    animation: chatbot-fade-up 0.35s ease 0.08s both;
}

.chatbot-chip {
    border: 1.5px solid #00c2ff;
    background: rgba(0, 194, 255, 0.1);
    color: #00c2ff;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    text-align: left;
    line-height: 1.3;
}

.chatbot-chip:hover {
    background: #00c2ff;
    color: #0a1a10;
    transform: translateY(-1px);
}

.chatbot-chip:focus-visible {
    outline: 2px solid #00c2ff;
    outline-offset: 2px;
}

.chatbot-chip.back {
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
}

.chatbot-chip.back:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

@media (max-width: 420px) {
    #chatbot-widget {
        bottom: 16px;
        right: 12px;
        left: 12px;
    }

    #chatbot-toggle {
        margin-left: auto;
    }

    #chatbot-window {
        width: 100%;
        right: 0;
        left: 0;
        height: min(500px, calc(100vh - 100px));
        bottom: 72px;
    }
}
