/* ---- CHATBOT WIDGET ---- */
.chatbot-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.35);
    z-index: 9999;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: chatbot-pulse 3s ease-in-out infinite;
}

/* Greeting bubble */
.chatbot-greeting {
    position: fixed;
    bottom: 92px;
    right: 28px;
    max-width: 260px;
    padding: 14px 36px 14px 16px;
    background: var(--accent);
    color: #000;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 6px 24px rgba(0, 212, 170, 0.35);
    z-index: 10000;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.chatbot-greeting.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chatbot-greeting-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
}

.chatbot-greeting-close:hover {
    color: #000;
}

@keyframes chatbot-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0, 212, 170, 0.35);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 30px rgba(0, 212, 170, 0.55);
    }
}

.chatbot-fab:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 28px rgba(0, 212, 170, 0.5);
    animation: none;
}

.chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 28px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 420px;
    max-height: calc(100vh - 140px);
    background: rgba(4, 21, 45, 0.98);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-window.open {
    display: flex;
}

.chatbot-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 212, 170, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px 10px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.chatbot-close:hover {
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.08);
}

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

.chatbot-msg {
    max-width: 90%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.chatbot-msg.bot {
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.12);
    color: var(--text-1);
    align-self: flex-start;
}

.chatbot-msg.user {
    background: rgba(0, 212, 170, 0.18);
    color: var(--text-1);
    align-self: flex-end;
}

.chatbot-msg a {
    color: var(--accent);
    text-decoration: underline;
}

.chatbot-msg .result-card {
    display: block;
    margin: 6px 0;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s;
}

.chatbot-msg .result-card:hover {
    border-color: var(--accent);
}

.chatbot-msg .result-card .rc-title {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.85rem;
}

.chatbot-msg .result-card .rc-type {
    color: var(--text-3);
    font-size: 0.75rem;
    margin-top: 2px;
}

.chatbot-input-row {
    padding: 12px 14px;
    border-top: 1px solid rgba(0, 212, 170, 0.12);
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-1);
    font-family: inherit;
    font-size: 0.88rem;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--accent);
}

.chatbot-send {
    padding: 10px 16px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

.chatbot-send:hover {
    opacity: 0.85;
}

.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.chatbot-suggestion {
    padding: 4px 10px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.15);
    border-radius: 14px;
    color: var(--accent);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s;
}

.chatbot-suggestion:hover {
    background: rgba(0, 212, 170, 0.2);
}

@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .chatbot-fab {
        bottom: 16px;
        right: 16px;
    }
}