/* 
   Veer Teja Water Technology - AI Chatbot Premium Design
   Glassmorphism + Water Theme 
*/

:root {
    --chat-primary: #0077ff;
    --chat-secondary: #00d2ff;
    --chat-bg-glass: rgba(255, 255, 255, 0.85);
    --chat-bg-dark: #0a192f;
    --chat-text-dark: #0f172a;
    --chat-text-muted: #64748b;
    --chat-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    --chat-radius: 24px;
    --chat-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Floating Toggle Button */
#chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 119, 255, 0.4);
    z-index: 9999;
    transition: var(--chat-transition);
    animation: chat-glow 3s infinite;
}

#chatbot-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

@keyframes chat-glow {
    0% { box-shadow: 0 0 0 0 rgba(0, 119, 255, 0.6); }
    70% { box-shadow: 0 0 0 20px rgba(0, 119, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 119, 255, 0); }
}

/* Chat Container */
#chatbot-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: var(--chat-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: var(--chat-transition);
}

#chatbot-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--chat-bg-dark), var(--chat-primary));
    padding: 20px 25px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

.chatbot-header .close-btn {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.7;
    transition: 0.3s;
}

.chatbot-header .close-btn:hover {
    opacity: 1;
}

.chatbot-header .bot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
}

.chatbot-header .bot-avatar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid var(--chat-bg-dark);
    border-radius: 50%;
}

/* Chat Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.2);
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: message-slide 0.4s ease-out;
}

@keyframes message-slide {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.bot-message {
    align-self: flex-start;
    background: white;
    color: var(--chat-text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.user-message {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Quick Replies */
.quick-replies {
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(255, 255, 255, 0.3);
}

.quick-reply-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--chat-primary);
    color: var(--chat-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
}

.quick-reply-btn:hover {
    background: var(--chat-primary);
    color: white;
}

/* Typing Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 18px;
    background: white;
    border-radius: 18px;
    align-self: flex-start;
    width: fit-content;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--chat-text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

/* Chat Input */
.chatbot-input-area {
    padding: 20px;
    background: white;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.chatbot-input-area input {
    flex: 1;
    border: none;
    background: #f1f5f9;
    padding: 12px 20px;
    border-radius: 12px;
    outline: none;
    font-size: 0.95rem;
}

.chatbot-input-area .send-btn {
    background: var(--chat-primary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.chatbot-input-area .send-btn:hover {
    background: var(--chat-bg-dark);
}

/* Action Buttons (WhatsApp/Call) */
.chat-action-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.wa-btn {
    background: #25d366;
    color: white;
}

.call-btn {
    background: var(--chat-bg-dark);
    color: white;
}

.action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Lead Form */
.lead-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    background: rgba(0, 119, 255, 0.05);
    padding: 15px;
    border-radius: 15px;
    border: 1px dashed var(--chat-primary);
}

.lead-form input {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

.lead-form button {
    background: var(--chat-primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Custom Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #chatbot-container {
        right: 10px;
        bottom: 90px;
        width: calc(100vw - 20px);
        height: calc(100vh - 110px);
        max-height: none;
    }

    #chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}
