/* Floating Button */
:root {
    --grad-start: #b537f2;
    --grad-mid: #6a00ff;
    --grad-end: #00eaff;
    --bg-white: #ffffff;
}

.chat-container {
    position: fixed;
    bottom: 40px !important;
    right: 40px !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    cursor: pointer;
    z-index: 10000;
}

.chat-message {
    background: var(--bg-white);
    padding: 15px 20px;
    border-radius: 20px 20px 5px 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    font-size: 14px;
    color: #333;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 200px;
    pointer-events: none;
}

.chat-container:hover .chat-message {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.chat-avatar-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--grad-start), var(--grad-mid), var(--grad-end));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 0 20px rgba(181, 55, 242, 0.4), 0 0 40px rgba(0, 234, 255, 0.2);
    animation: float 4s ease-in-out infinite;
}

.avatar-icon {
    fill: white;
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    background-color: var(--grad-end);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 15px var(--grad-end);
}

.chat-avatar-circle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--grad-end);
    opacity: 0;
    animation: pulse-glow 2.5s infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

@keyframes pulse-glow {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Chat Window */
#gemini-bot-container {
    position: fixed;
    bottom: 130px;
    right: 40px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header */
.gemini-bot-header {
    background-color: #075E54;
    /* WhatsApp Dark Green */
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* Prevent header from shrinking */
}

.gemini-bot-header h3 {
    margin: 0;
    font-size: 16px;
    margin-left: 10px;
}

.gemini-bot-close {
    margin-left: auto;
    cursor: pointer;
    font-size: 20px;
}

/* Body Area */
.gemini-bot-body {
    flex: 1;
    background-color: #E5DDD5;
    /* WhatsApp BG */
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    position: relative;
    min-height: 0;
    /* Important for nested flex scrolling */
}

/* Lead Form */
#gemini-bot-form {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#gemini-bot-form input {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    /* Fix padding issue */
}

#gemini-bot-form button {
    width: 100%;
    background-color: #25D366;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

/* Messages */
.gemini-bot-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    /* Ensure long words don't break layout */
    overflow-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background-color: #DCF8C6;
    /* WhatsApp User Msg */
}

.message.bot {
    align-self: flex-start;
    background-color: #fff;
}

.message-time {
    display: block;
    font-size: 10px;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

/* Footer / Input */
.gemini-bot-footer {
    padding: 10px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* Prevent footer from shrinking */
}

#gemini-bot-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

#gemini-bot-send {
    background: none;
    border: none;
    margin-left: 10px;
    cursor: pointer;
    color: #075E54;
    font-size: 20px;
}