/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Launcher Button */
.chatbot-launcher {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.chatbot-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chatbot-icon {
    font-size: 24px;
    color: white;
}

.chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(74, 100, 145, 0.4);
    animation: pulse 2s infinite;
    z-index: -1;
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-container.active .chatbot-window {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Header */
.chatbot-header {
    padding: 15px;
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    display: flex;
    align-items: center;
    position: relative;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #2c3e50;
    font-size: 18px;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

.chatbot-close {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chatbot-close:hover {
    opacity: 1;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-form-container {
    display: none;
    padding: 0 0 10px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    overflow: visible;
}

.chatbot-container.form-visible .chatbot-form-container {
    display: block;
}

/* Keep messages visible below the form when it is shown */

.chatbot-contact-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.chatbot-contact-form input,
.chatbot-contact-form select,
.chatbot-contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    transition: border 0.2s, box-shadow 0.2s;
}

.chatbot-contact-form input:focus,
.chatbot-contact-form select:focus,
.chatbot-contact-form textarea:focus {
    border-color: #4a6491;
    box-shadow: 0 0 0 3px rgba(74, 100, 145, 0.15);
}

.chatbot-contact-form textarea {
    grid-column: 1 / -1;
    resize: vertical;
}

.chatbot-contact-form .form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    background: #fff;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid #eee;
}

.chatbot-contact-form button[type="submit"] {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.chatbot-contact-form button[type="submit"]:hover {
    opacity: 0.95;
}

@media (max-width: 480px) {
    .chatbot-contact-form {
        grid-template-columns: 1fr;
    }
}

.message {
    max-width: 80%;
    padding: 12px 15px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 14px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.user-message {
    align-self: flex-end;
    background: #4a6491;
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
}

.chatbot-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border 0.3s;
}

.chatbot-input:focus {
    border-color: #4a6491;
}

.chatbot-send {
    width: 45px;
    height: 45px;
    margin-left: 10px;
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.chatbot-send:hover {
    transform: scale(1.05);
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    padding: 8px 12px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    align-self: flex-start;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4a6491;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #4a6491;
}
