/* Chatbot Widget */
#chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #38bdf8, #2563eb);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.42);
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(24,75,135,0.28), inset 0 1px 0 rgba(255,255,255,0.35);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

#chatbot-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 20px 38px rgba(24,75,135,0.34), inset 0 1px 0 rgba(255,255,255,0.38);
}

#chatbot-toggle .badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #25d366;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.86); }
}

#chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 390px;
    max-height: 560px;
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(24,75,135,0.28), 0 4px 12px rgba(24,75,135,0.12);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(145deg, #f8fbff, #e7f2ff);
    border: 1px solid rgba(37,99,235,0.18);
}

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

.chatbot-header {
    background: radial-gradient(circle at 16% 0%, rgba(255,255,255,0.34), transparent 34%), linear-gradient(135deg, #0b5ed7, #38bdf8 58%, #1d4ed8);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.2);
}

.chatbot-header .info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.chatbot-header .avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.32);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
}

.chatbot-header .status-text {
    font-size: 12px;
    opacity: 0.92;
}

.chatbot-header .close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.24);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chatbot-header .close-btn:hover {
    background: rgba(255,255,255,0.26);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, #f8fbff, #edf6ff);
    min-height: 310px;
    max-height: 380px;
}

.chat-msg {
    max-width: 86%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.55;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 8px 18px rgba(24,75,135,0.08);
}

.chat-msg.bot {
    background: #fff;
    color: #1d2f48;
    border: 1px solid rgba(37,99,235,0.14);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

.chat-msg.user {
    background: linear-gradient(145deg, #38bdf8, #2563eb);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.chat-msg.bot strong {
    color: #0b4ca8;
}

.chat-typing {
    display: none;
    align-self: flex-start;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid rgba(37,99,235,0.14);
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    box-shadow: 0 8px 18px rgba(24,75,135,0.08);
}

.chat-typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #2563eb;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

.chatbot-suggestions {
    padding: 10px 14px;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(37,99,235,0.12);
    background: rgba(255,255,255,0.72);
}

.chat-suggestion {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid rgba(37,99,235,0.24);
    border-radius: 999px;
    color: #0b4ca8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 6px 12px rgba(24,75,135,0.08);
}

.chat-suggestion:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.chatbot-input {
    display: flex;
    padding: 13px 14px 15px;
    gap: 9px;
    background: #f8fbff;
    border-top: 1px solid rgba(37,99,235,0.12);
}

.chatbot-input input {
    flex: 1;
    border: 1px solid rgba(37,99,235,0.2);
    border-radius: 999px;
    padding: 11px 16px;
    font-size: 13px;
    outline: none;
    font-family: 'Poppins', sans-serif;
    background: #fff;
    color: #1d2f48;
}

.chatbot-input input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

.chatbot-input button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(145deg, #38bdf8, #2563eb);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 10px 18px rgba(37,99,235,0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(37,99,235,0.28);
}

@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 86px;
        max-height: 72vh;
        border-radius: 18px;
    }

    #chatbot-toggle {
        bottom: 16px;
        right: 16px;
    }
}
