/* General Styles */
#ai-chatbot-container * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Chat Bubble */
#chat-bubble { 
    position: fixed; 
    bottom: 2rem; 
    right: 2rem; 
    width: 60px; 
    height: 60px; 
    background-color: #0052cc; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); 
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease; 
    z-index: 9999; 
}
#chat-bubble:hover { 
    transform: scale(1.1); 
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); 
}

/* Chat Window */
#chat-window { 
    position: fixed; 
    bottom: 6.5rem; 
    right: 2rem; 
    width: 90%; 
    max-width: 400px; 
    height: 70vh; 
    max-height: 600px; 
    background-color: white; 
    border-radius: 1rem; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); 
    display: none; 
    flex-direction: column; 
    overflow: hidden; 
    transition: opacity 0.3s, transform 0.3s; 
    transform-origin: bottom right; 
    z-index: 10000; 
}
#chat-window.open { 
    display: flex; 
    opacity: 1; 
    transform: scale(1); 
}
#chat-window.closed { 
    opacity: 0; 
    transform: scale(0.95); 
    pointer-events: none; 
}

/* Header */
.chat-header { 
    background-color: #0052cc; 
    color: white; 
    padding: 1rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #0041a3; 
}
.chat-header h3 { 
    font-size: 1.125rem; 
    font-weight: 600; 
    margin: 0; 
}
#close-chat { 
    background: none; 
    border: none; 
    color: white; 
    cursor: pointer; 
    padding: 0.25rem; 
    opacity: 0.8; 
    transition: opacity 0.2s; 
}
#close-chat:hover { 
    opacity: 1; 
}

/* Messages Area */
.chat-messages { 
    flex: 1; 
    padding: 1rem; 
    overflow-y: auto; 
    background-color: #f8f9fa; 
}
.chat-message { 
    display: flex; 
    margin-bottom: 1rem; 
    max-width: 90%; 
}
.user-message { 
    margin-left: auto; 
    flex-direction: row-reverse; 
}
.ai-message { 
    margin-right: auto; 
}
.msg-bubble { 
    padding: 0.65rem 1rem; 
    border-radius: 1.1rem; 
    line-height: 1.5; 
}
.user-message .msg-bubble { 
    background-color: #0052cc; 
    color: white; 
    border-bottom-right-radius: 0.25rem; 
}
.ai-message .msg-bubble { 
    background-color: #e9ecef; 
    color: #212529; 
    border-bottom-left-radius: 0.25rem; 
}
.msg-bubble p { 
    margin: 0; 
}

/* Typing Indicator */
.typing-indicator span { 
    height: 8px; 
    width: 8px; 
    margin: 0 1px; 
    background-color: #adb5bd; 
    border-radius: 50%; 
    display: inline-block; 
    animation: wave 1.4s infinite ease-in-out both; 
}
.typing-indicator span:nth-child(1) { 
    animation-delay: -0.32s; 
}
.typing-indicator span:nth-child(2) { 
    animation-delay: -0.16s; 
}
@keyframes wave { 
    0%, 80%, 100% { transform: scale(0); } 
    40% { transform: scale(1.0); } 
}

/* Input Area */
.chat-input-area { 
    padding: 1rem; 
    background-color: #fff; 
    border-top: 1px solid #dee2e6; 
}
.chat-input-area form { 
    display: flex; 
    align-items: center; 
}
#chat-input { 
    flex: 1; 
    border: 1px solid #ced4da; 
    border-radius: 9999px; 
    padding: 0.6rem 1rem; 
    font-size: 1rem; 
    transition: border-color 0.2s, box-shadow 0.2s; 
}
#chat-input:focus { 
    outline: none; 
    border-color: #0052cc; 
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.2); 
}
#chat-submit { 
    margin-left: 0.75rem; 
    background-color: #0052cc; 
    color: white; 
    border: none; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    transition: background-color 0.2s; 
}
#chat-submit:hover { 
    background-color: #0041a3; 
}
