:root {
    --gemini-primary: #3b82f6; /* Fallback, overridden by inline CSS */
    --gemini-bg: #ffffff;
    --gemini-text: #1e293b;
    --gemini-gray: #f1f5f9;
}

/* Container */
.gemini-chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Floating Trigger Button */
.gemini-chatbot-trigger {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gemini-primary), #6366f1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gemini-chatbot-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

/* Chat Window */
.gemini-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px); /* Glassmorphism */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    
    /* Animation initial state */
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gemini-chatbot-window.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (max-width: 480px) {
    .gemini-chatbot-window {
        width: calc(100vw - 48px);
        height: 60vh;
        bottom: 70px;
    }
}

/* Header */
.gemini-chat-header {
    background: linear-gradient(135deg, var(--gemini-primary), #6366f1);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-status {
    width: 10px;
    height: 10px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

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

.gemini-chat-body::-webkit-scrollbar {
    width: 6px;
}
.gemini-chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.bot-message .message-bubble {
    background: var(--gemini-gray);
    color: var(--gemini-text);
    border-bottom-left-radius: 4px;
}

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

/* Footer (Input) */
.gemini-chat-footer {
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
}

#gemini-chat-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: rgba(255,255,255,0.8);
}

#gemini-chat-input:focus {
    border-color: var(--gemini-primary);
}

.send-btn {
    background: var(--gemini-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.send-btn:hover {
    filter: brightness(1.1);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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