/* Chatbot Toggle Button Styles */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #4fc3f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    background: #29b6f6;
    transform: scale(1.05);
}

.chatbot-toggle i {
    font-size: 24px;
    color: white;
}

.chatbot-toggle .close-icon {
    display: none;
}

/* Chatbot Container Styles */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-height: 550px;
}

.chatbot-container.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Improved Chat Header - Fixed at top */
.chat-header {
    background: linear-gradient(90deg, #4fc3f7, #29b6f6);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-text {
    display: flex;
    flex-direction: column;
}

.chat-header-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.chat-header-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

.header-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages with Improved Scrolling - Fixed height with header consideration */
.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: 300px;
    min-height: 300px;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9f9f9;
    scroll-behavior: smooth;
}

/* Custom scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a5a5a5;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
    font-size: 0.9rem;
    word-wrap: break-word;
}

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

.bot-message {
    background: white;
    border: 1px solid #e0e0e0;
    border-top-left-radius: 5px;
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-message {
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-top-right-radius: 5px;
    align-self: flex-end;
    box-shadow: 0 2px 4px rgba(79, 195, 247, 0.1);
}

/* Service list styles for chatbot messages */
.service-list-small {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.service-item-small {
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid #4fc3f7;
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 0.8rem;
    text-align: left;
}

.service-item-small:hover {
    background: rgba(79, 195, 247, 0.3);
}

.suggested-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid #eee;
}

.suggested-questions button {
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid #4fc3f7;
    color: #333;
    padding: 6px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 0.8rem;
}

.suggested-questions button:hover {
    background: rgba(79, 195, 247, 0.3);
}

.chat-input {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 30px;
    background: #f9f9f9;
    color: #333;
    font-size: 0.9rem;
    outline: none;
}

.chat-input input:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.chat-input button {
    background: #4fc3f7;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 8px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button:hover {
    background: #29b6f6;
}

.chat-input button i {
    color: white;
    font-size: 16px;
}

/* Enquiry Form Styles */
.enquiry-form {
    display: none;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
    background: white;
    border-top: 1px solid #eee;
    max-height: 300px;
    overflow-y: auto;
}

.enquiry-form input,
.enquiry-form textarea {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.enquiry-form input:focus,
.enquiry-form textarea:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.enquiry-form textarea {
    min-height: 60px;
    resize: vertical;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    font-weight: 500;
}

.submit-btn {
    background: #4fc3f7;
    color: white;
}

.submit-btn:hover {
    background: #29b6f6;
}

.cancel-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.cancel-btn:hover {
    background: #e8e8e8;
}

.error-message {
    color: #f44336;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

/* Scroll to bottom indicator */
.scroll-indicator {
    position: absolute;
    bottom: 70px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: rgba(79, 195, 247, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.scroll-indicator.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-indicator i {
    color: white;
    font-size: 14px;
}

@media (max-width: 768px) {
    .chatbot-container {
        width: 320px;
        right: 20px;
        bottom: 90px;
    }

    .chatbot-toggle {
        right: 20px;
        bottom: 20px;
    }

    .chat-header {
        padding: 12px 15px;
    }

    .chat-header-title {
        font-size: 1rem;
    }

    .chat-header-subtitle {
        font-size: 0.7rem;
    }
}
