/* ====================
   AI Chatbot Float
   ==================== */
.chatbot-float {
    position: fixed;
    bottom: 218px;
    right: 30px;
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #c9a84c, #a67c00);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    animation: chatbot-pulse 2.5s infinite;
}

@keyframes chatbot-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4); }
    50% { transform: scale(1.08); box-shadow: 0 6px 28px rgba(201, 168, 76, 0.6); }
}

.chatbot-float:hover {
    background: linear-gradient(135deg, #b8963f, #95700a);
    transform: scale(1.1);
    animation: none;
}

.chatbot-float.active {
    background: #c62828;
    animation: none;
    transform: rotate(0) scale(1);
    box-shadow: 0 4px 14px rgba(198, 40, 40, 0.35);
}

.chatbot-float.active:hover {
    background: #b71c1c;
}

.chatbot-float.active .fa-robot {
    display: none;
}

.chatbot-float.active .fa-times {
    display: inline;
}

.chatbot-float .fa-times {
    display: none;
}

/* Chatbot Badge */
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #c62828;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-bounce 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.chatbot-float.active .chatbot-badge {
    display: none;
}

/* ====================
   Chatbot Panel
   ==================== */
.chatbot-panel {
    position: fixed;
    bottom: 218px;
    right: 96px;
    width: 370px;
    height: 460px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

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

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.chatbot-header-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #c9a84c, #a67c00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
}

.chatbot-header-info {
    flex: 1;
}

.chatbot-header-info h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.chatbot-header-info span {
    color: rgba(255,255,255,0.7);
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatbot-header-info .online-dot {
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* Message Bubbles */
.chat-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
    animation: msg-in 0.3s ease;
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
    background: #f0f4ff;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.bot .bot-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #c9a84c, #a67c00);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #fff;
    margin-right: 6px;
    vertical-align: middle;
}

.chat-msg.user {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg a {
    color: #1565c0;
    text-decoration: underline;
    font-weight: 600;
}

.chat-msg a:hover {
    color: #0d47a1;
}

.chat-msg ul {
    margin: 6px 0 0 16px;
    padding: 0;
}

.chat-msg ul li {
    margin-bottom: 3px;
}

/* Typing indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #f0f4ff;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    max-width: 70px;
}

.chat-typing span {
    width: 7px;
    height: 7px;
    background: #90a4ae;
    border-radius: 50%;
    animation: typing-bounce 1.2s ease-in-out infinite;
}

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

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Quick Replies */
.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 8px;
}

.quick-reply-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1.5px solid #c9a84c;
    color: #8d6e23;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: #c9a84c;
    color: #fff;
    transform: translateY(-1px);
}

/* Input Area */
.chatbot-input-area {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    background: #fafafa;
    
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.3s ease;
}

.chatbot-input:focus {
    border-color: #c9a84c;
}

.chatbot-input::placeholder {
    color: #aaa;
    font-size: 12px;
}

.chatbot-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #c9a84c, #a67c00);
    color: #fff;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-send:hover {
    background: linear-gradient(135deg, #b8963f, #95700a);
    transform: translateY(-1px);
}

/* ====================
   Chatbot Responsive
   ==================== */
@media (max-width: 992px) {
    .chatbot-panel {
        width: 340px;
        height: 440px;
    }
}

@media (max-width: 768px) {
    .chatbot-float {
        bottom: 200px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    .chatbot-panel {
        bottom: 64px;
        right: 16px;
        left: 16px;
        width: auto;
        height: 380px;
        border-radius: 14px;
    }
}

@media (max-width: 480px) {
    .chatbot-panel {
        bottom: 56px;
        right: 10px;
        left: 10px;
        height: 350px;
    }
    .chatbot-float {
        bottom: 196px;
    }
}