/*** AI Chatbot Widget ***/
.chatbot-toggle {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 156, 255, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 999;
    cursor: pointer;
    transition: transform .3s, box-shadow .3s;
    animation: chatbot-pulse 2.5s infinite;
}

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

@keyframes chatbot-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(0, 156, 255, .45); }
    50% { box-shadow: 0 8px 24px rgba(0, 156, 255, .8); }
}

.chatbot-panel {
    position: fixed;
    right: 30px;
    bottom: 170px;
    width: 370px;
    max-width: 92vw;
    height: 500px;
    max-height: 72vh;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(.97);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--primary), #0067b3);
    color: #FFFFFF;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-title i {
    font-size: 22px;
}

.chatbot-header-title strong {
    display: block;
    font-size: 15px;
}

.chatbot-header-title small {
    display: block;
    opacity: .85;
    font-size: 12px;
}

.chatbot-close {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.chatbot-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    background: var(--light);
}

.chatbot-msg {
    display: flex;
    margin-bottom: 12px;
}

.chatbot-msg-bot {
    justify-content: flex-start;
}

.chatbot-msg-user {
    justify-content: flex-end;
}

.chatbot-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-msg-bot .chatbot-bubble {
    background: #FFFFFF;
    border: 1px solid #E5E9EC;
    color: var(--dark);
    border-bottom-left-radius: 4px;
}

.chatbot-msg-user .chatbot-bubble {
    background: var(--primary);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.chatbot-msg-typing .chatbot-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 14px;
}

.chatbot-msg-typing .chatbot-bubble span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary);
    display: inline-block;
    animation: chatbot-typing 1s infinite ease-in-out;
}

.chatbot-msg-typing .chatbot-bubble span:nth-child(2) { animation-delay: .15s; }
.chatbot-msg-typing .chatbot-bubble span:nth-child(3) { animation-delay: .3s; }

@keyframes chatbot-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.chatbot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
    flex-shrink: 0;
    background: var(--light);
}

.chatbot-chip {
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    color: var(--dark);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: .3s;
}

.chatbot-chip:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

.chatbot-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #E5E9EC;
    background: #FFFFFF;
    flex-shrink: 0;
}

.chatbot-form input {
    flex: 1 1 auto;
    border: 1px solid #DEE2E6;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}

.chatbot-form input:focus {
    border-color: var(--primary);
}

.chatbot-form button {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .3s;
}

.chatbot-form button:hover {
    background: #0078cc;
}

@media (max-width: 576px) {
    .chatbot-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 150px;
    }

    .chatbot-toggle {
        right: 20px;
    }
}
