:root {
    --zb-bg: #010923;
    --zb-surface: #120938;
    --zb-primary: #007BFF;
    --zb-primary-2: #0056B3;
    --zb-text: #ffffff;
    --zb-text-muted: rgba(255, 255, 255, 0.85);
    --zb-border: rgba(255, 255, 255, 0.12);
    --zb-shadow-1: 0 8px 25px rgba(0, 0, 0, 0.35);
    --zb-shadow-2: 0 20px 40px rgba(0, 123, 255, 0.15);
}

#chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: inherit;
    z-index: 4000;
    display: inline-block;
}


#chatbot-icon {
    display: inline-block;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    width: auto;
    height: auto;
    color: var(--zb-text);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: colorShift 3s infinite linear;
}

#chatbot-icon:hover {
    transform: translateY(-2px) scale(1.05);
}


#chatbot-icon img {
    width: 64px !important;
    height: 64px !important;
    object-fit: contain;
    display: block;
    border-radius: 0 !important;
    pointer-events: none;
    animation: colorShift 3s infinite linear;
}

@keyframes colorShift {
    0% {
        filter: hue-rotate(0deg);
    }

    50% {
        filter: hue-rotate(180deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}


#chatbot-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 360px;
    max-height: 520px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--zb-border);
    border-radius: 16px;
    box-shadow: var(--zb-shadow-1);
    overflow: hidden;
    display: none;
    flex-direction: column;
    color: var(--zb-text);
}

#chatbot-header {
    background: linear-gradient(135deg, var(--zb-primary), var(--zb-primary-2));
    color: var(--zb-text);
    padding: 12px 14px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.2px;
}

#chatbot-close {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    opacity: 0.9;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#chatbot-close:hover {
    transform: scale(1.1);
    opacity: 1;
}

#chatbot-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    background: rgba(1, 9, 35, 0.4);
}


#chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(1, 9, 35, 0.55);
    border-top: 1px solid var(--zb-border);
}


.chatbot-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.chatbot-input-wrap #chatbot-input {
    width: 100%;
    padding-right: 46px;
}

.chatbot-input-wrap #chatbot-mic {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--zb-primary);
    pointer-events: auto;
    z-index: 1;
}

.chatbot-input-wrap #chatbot-mic:hover {
    transform: translateY(-50%);
    filter: none;
}


.chatbot-input-wrap #chatbot-mic.listening {
    animation: micPulseInplace 0.8s infinite alternate;
}

@keyframes micPulseInplace {
    from {
        transform: translateY(-50%) scale(1);
    }

    to {
        transform: translateY(-50%) scale(1.08);
    }
}

#chatbot-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #20c997, #0abde3);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

#chatbot-send:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

#chatbot-send i {
    transform: translateX(1px);
}

#chatbot-input {
    flex: 1;
    background: var(--zb-bg);
    color: var(--zb-text);
    border: 1px solid var(--zb-primary);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
    outline: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#chatbot-input:focus {
    border-color: var(--zb-primary);
    box-shadow: inset 0 0 0 1px var(--zb-primary), 0 8px 20px rgba(0, 123, 255, 0.15);
}

#chatbot-mic {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--zb-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: none;
}

#chatbot-mic:hover {
    transform: none;
    filter: none;
}

#chatbot-mic.listening {
    animation: micPulse 0.8s infinite alternate;
}

@keyframes micPulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}


#chatbot-body::-webkit-scrollbar {
    width: 8px;
}

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

#chatbot-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
}

#chatbot-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-message {
    padding: 10px 12px;
    border-radius: 14px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.45;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-message.bot {
    background: var(--zb-surface);
    border: 1px solid var(--zb-border);
    color: var(--zb-text-muted);
    align-self: flex-start;
}

.chat-message.user {
    background: linear-gradient(135deg, var(--zb-primary), var(--zb-primary-2));
    color: var(--zb-text);
    align-self: flex-end;
    border: 1px solid rgba(255, 255, 255, 0.08);
}


#chatbot-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.chat-btn {
    background: var(--zb-bg);
    color: var(--zb-text);
    border: 1px solid var(--zb-primary);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    font-weight: 600;
}

.chat-btn:hover {
    background: var(--zb-primary);
    color: #fff;
    border-color: var(--zb-primary);
    transform: translateY(-1px);
}


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

    #chatbot-window {
        width: min(92vw, 380px);
        max-height: 70vh;
    }

    #chatbot-body {
        max-height: calc(70vh - 48px);
    }
}