/* assets/css/chatbot.css */

/* Floating Chat Bubble Toggle */
.chatbot-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 35%, #d946ef 70%, #f43f5e 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 10px 25px rgba(217, 70, 239, 0.4);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px rgba(217, 70, 239, 0.6);
}

/* Chat Panel Widget */
.chatbot-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-left: 1px solid var(--glass-border);
    border-radius: 0;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 10050;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
}

.chatbot-panel.active {
    right: 0;
    opacity: 1;
    pointer-events: auto;
}

/* Header Panel */
.chatbot-header {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #d946ef 100%);
    padding: 1rem 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Message Log Container */
.chatbot-body {
    flex-grow: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Message Bubbles */
.chat-msg {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-msg.bot {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-color);
    align-self: flex-start;
    border-top-left-radius: 4px;
}

.chat-msg.user {
    background: var(--primary-color);
    color: #fff;
    align-self: flex-end;
    border-top-right-radius: 4px;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    align-self: flex-start;
}
.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Quick Suggestion Buttons */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 1.25rem 0.75rem;
}

.btn-suggestion {
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.15);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-suggestion:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
}

/* Input Form Footer */
.chatbot-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

/* Mobile responsive styling overrides for the chatbot widget */
@media (max-width: 767.98px) {
    .chatbot-bubble {
        bottom: 85px !important; /* Floating above the bottom app navbar */
        right: 20px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 1.45rem !important;
        box-shadow: 0 8px 24px rgba(217, 70, 239, 0.35) !important;
    }
    
    .chatbot-panel {
        top: 0 !important;
        bottom: 0 !important;
        right: -100% !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .chatbot-panel.active {
        right: 0 !important;
    }
}

/* Mic Recording Glow Pulse */
.recording-pulse {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    animation: micGlow 1.2s infinite ease-in-out;
}

@keyframes micGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Floating WhatsApp Bubble */
.whatsapp-bubble {
    position: fixed;
    bottom: 105px; /* Spaced exactly 15px above the 60px chatbot bubble */
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    z-index: 9999;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.whatsapp-bubble:hover {
    transform: scale(1.1) rotate(-8deg);
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.6);
    color: #fff;
}

@media (max-width: 767.98px) {
    .whatsapp-bubble {
        bottom: 152px !important; /* Spaced exactly 15px above the 52px mobile chatbot bubble */
        right: 20px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 1.65rem !important;
        box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35) !important;
    }
}

