/* Chatbot Floating Widget Styles */
#chatbot-bubble {
    position: fixed;
    bottom: 30px;
    right: 90px; /* Offset from WhatsApp button */
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6a13, #e85a0d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 106, 19, 0.4);
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(255, 106, 19, 0.6);
}

.bubble-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 106, 19, 0.4);
    animation: bubblePulse 2s infinite;
    z-index: -1;
}

@keyframes bubblePulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Chatbox Layout */
#chatbot-box {
    position: fixed;
    bottom: 100px;
    right: 40px;
    width: 380px;
    height: 520px;
    background: rgba(18, 16, 14, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 106, 19, 0.15);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chatbot-box.collapsed {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* Header */
.chat-header {
    background: linear-gradient(to right, rgba(30, 27, 24, 0.9), rgba(18, 16, 14, 0.9));
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: #ff6a13;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 0 10px rgba(255, 106, 19, 0.3);
}

.chat-agent-info h5 {
    color: #fff;
    font-size: 14px;
    margin: 0;
    font-weight: 600;
}

.chat-agent-info span {
    color: #4ade80;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-agent-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}

#chat-close {
    background: transparent;
    border: none;
    color: #a0938a;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}

#chat-close:hover {
    color: #ff6a13;
}

/* Body (Messages) */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    animation: bubbleIn 0.3s ease-out;
}

.chat-bubble.bot {
    background: rgba(255, 255, 255, 0.05);
    color: #e6e4e2;
    border-radius: 0 15px 15px 15px;
    align-self: flex-start;
}

.chat-bubble.user {
    background: #ff6a13;
    color: white;
    border-radius: 15px 0 15px 15px;
    align-self: flex-end;
}

@keyframes bubbleIn {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Options / Quick Replies */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    align-self: flex-start;
}

.chat-option-btn {
    background: rgba(255, 106, 19, 0.1);
    color: #ffb884;
    border: 1px solid rgba(255, 106, 19, 0.3);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-option-btn:hover {
    background: #ff6a13;
    color: white;
}

/* Footer (Input) */
.chat-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    gap: 10px;
    background: rgba(18, 16, 14, 0.95);
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 15px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
}

#chat-input:focus {
    border-color: rgba(255, 106, 19, 0.5);
}

#chat-send {
    background: #ff6a13;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#chat-send:active {
    transform: scale(0.9);
}

/* Typing Indicator (Wait) */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 15px 15px 15px;
    align-self: flex-start;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #a0938a;
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-dot:nth-child(2) { animation-delay: 0.3s; }
.typing-dot:nth-child(3) { animation-delay: 0.6s; }

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

@media (max-width: 480px) {
    #chatbot-box {
        bottom: 0; right: 0;
        width: 100%; height: 100%;
        border-radius: 0;
    }
}
