/* General Reset & Font */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Chatbot Icon */
#gemini-chatbot-icon {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 9998;
    transition: transform 0.2s ease-in-out;
}

#gemini-chatbot-icon:hover {
    transform: scale(1.1);
}

#gemini-chatbot-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Chatbot Window */
#gemini-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 370px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background-color: #fff;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none; /* Initially hidden */
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

#gemini-chatbot-header {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    padding: 15px 20px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#gemini-chatbot-header span {
    font-weight: 600;
    font-size: 18px;
}

#gemini-chatbot-close {
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#gemini-chatbot-close:hover {
    opacity: 1;
}

#gemini-chatbot-messages {
    flex: 1; /* Allow this to grow and shrink */
    padding: 20px;
    overflow-y: auto;
    background-color: #f4f7f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-message, .bot-message {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
}

.user-message {
    background: linear-gradient(135deg, #0073aa, #008dc7);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background-color: #e9eef2;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.bot-message.error {
    background-color: #ffebee;
    color: #c62828;
    font-weight: 500;
}

#gemini-chatbot-input-container {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
    flex-shrink: 0;
}

#gemini-chatbot-input {
    display: flex;
    align-items: center;
}

#gemini-chatbot-message-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 25px;
    padding: 12px 20px;
    margin-right: 10px;
    font-size: 16px;
    transition: border-color 0.2s;
}

#gemini-chatbot-message-input:focus {
    outline: none;
    border-color: #0073aa;
}

#gemini-chatbot-send {
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#gemini-chatbot-send:hover {
    background-color: #005a87;
}

#gemini-chatbot-footer {
    padding: 10px;
    text-align: center;
    background-color: #f4f7f9;
    border-top: 1px solid #e9eef2;
    flex-shrink: 0;
}

#gemini-chatbot-footer img {
    height: 30px;
    opacity: 0.7;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    padding: 12px 18px;
    align-items: center;
}
.typing-indicator span {
    height: 9px;
    width: 9px;
    background-color: #9E9EA1;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}
