/* ─── Chatbot Widget CSS ─────────────────────────────────────────── */

#chatbot-wrapper {
    position: fixed;
    bottom: 165px; /* Positioned above WhatsApp icon (95px) */
    right: 30px;
    z-index: 1000;
    font-family: var(--font-body);
}

/* Chat Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(18, 91, 45, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    transition: var(--transition-bounce);
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--color-primary-dark);
}

.chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.6;
    z-index: -1;
    animation: chatbot-pulse 2s infinite;
}

@keyframes chatbot-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    transform-origin: bottom right;
}

.chatbot-window.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.8);
}

/* Header */
.chatbot-header {
    background: var(--color-primary);
    color: white;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar {
    position: relative;
    width: 40px;
    height: 40px;
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    object-fit: contain;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #4ade80;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
}

.chatbot-header h5 {
    color: white;
    font-size: 1rem;
    margin: 0;
    font-family: var(--font-body);
    font-weight: 600;
}

.chatbot-header p {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.8;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.chatbot-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.5);
}

.chatbot-options-wrapper {
    padding: 0.25rem 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-self: flex-start;
    max-width: 90%;
}

.quick-reply-chip {
    background: white;
    color: #125B2D;
    border: 1px solid #125B2D;
    padding: 0.5rem 0.9rem;
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.quick-reply-chip:hover {
    background: #125B2D;
    color: white;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.bot .message-content {
    background: white;
    color: var(--color-gray-700);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.message.user .message-content {
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.message-time {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.6;
}

.message.user .message-time {
    align-self: flex-end;
}

/* Typing Animation Placeholder */
.typing-indicator {
    padding: 0.5rem 1rem;
    background: white;
    border-radius: var(--radius-md);
    width: fit-content;
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--color-gray-300);
    border-radius: 50%;
    animation: typing-dot 1.4s infinite ease-in-out;
}

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

@keyframes typing-dot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.chatbot-input-area {
    padding: 1.25rem;
    background: white;
    border-top: 1px solid var(--color-gray-100);
}

#chatbot-form {
    display: flex;
    gap: 0.5rem;
}

#chatbot-input {
    flex: 1;
    border: 1px solid var(--color-gray-300);
    padding: 0.6rem 1rem;
    border-radius: 100px;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

#chatbot-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(18, 91, 45, 0.1);
}

#chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-send:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: 70vh;
        right: -10px;
    }
    
    #chatbot-wrapper {
        bottom: 155px;
        right: 20px;
    }
}
