/* MYSITE Chatbot */
#mysite-chatbot {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
}

.chatbot-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.1rem;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #9333ea, #c026d3);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(147, 51, 234, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    max-width: calc(100vw - 2rem);
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(147, 51, 234, 0.45);
}

.chatbot-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.chatbot-toggle-text {
    line-height: 1.2;
    text-align: left;
}

.chatbot-panel {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 0;
    width: min(360px, calc(100vw - 2rem));
    background: #0b0f14;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    max-height: min(520px, calc(100vh - 7rem));
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.chatbot-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.25), rgba(192, 38, 211, 0.15));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.chatbot-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #9333ea, #c026d3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.chatbot-header-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
}

.chatbot-header-status {
    margin: 0.15rem 0 0;
    font-size: 0.6875rem;
    color: #22c55e;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 180px;
}

.chatbot-msg {
    max-width: 88%;
    padding: 0.7rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.chatbot-msg-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    border-bottom-left-radius: 0.25rem;
}

.chatbot-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #9333ea, #a855f7);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0 1rem 0.75rem;
}

.chatbot-quick-btn {
    border: 1px solid rgba(147, 51, 234, 0.35);
    background: rgba(147, 51, 234, 0.1);
    color: #d8b4fe;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.chatbot-quick-btn:hover {
    background: rgba(147, 51, 234, 0.2);
    border-color: rgba(147, 51, 234, 0.55);
}

.chatbot-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.chatbot-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border-radius: 9999px;
    padding: 0.65rem 0.95rem;
    font-size: 0.8125rem;
    outline: none;
    font-family: inherit;
}

.chatbot-input::placeholder {
    color: #6b7280;
}

.chatbot-input:focus {
    border-color: rgba(147, 51, 234, 0.5);
}

.chatbot-send {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background: #9333ea;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.chatbot-send:hover {
    background: #7e22ce;
}

.chatbot-panel.is-open + .chatbot-toggle,
#mysite-chatbot.is-open .chatbot-toggle {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

.chatbot-link {
    color: #c084fc;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chatbot-link:hover {
    color: #e9d5ff;
}

@media (max-width: 480px) {
    #mysite-chatbot {
        bottom: 1rem;
        right: 1rem;
    }

    .chatbot-toggle-text {
        display: none;
    }

    .chatbot-toggle {
        width: 3.5rem;
        height: 3.5rem;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .chatbot-panel {
        width: calc(100vw - 2rem);
        right: 0;
    }
}
