/* Chatbot Base Container */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Playfair Display', serif;
}

/* Toggle Button */
#chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #5abe8c;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 2001; /* High z-index initially */
}

/* Lower z-index when chat window is open */
.chat-open #chatbot-toggle {
    z-index: 900; /* Lower z-index so chat window appears on top */
}
#chatbot-toggle:hover {
    transform: scale(1.1);
    background: #4a906d;
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 40px;
    width: 380px;
    height: 600px;
    background: #1a1a1a;
    border-radius: 15px;
    overflow: hidden;
    display: none; /* Hidden initially */
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* Above most elements but below open toggle */
}

/* Chat Header */
.chat-header {
    padding: 15px 20px;
    background: #252222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.header-text {
    color: white;
}

.header-text h3 {
    margin: 0;
    font-size: 16px;
}

/* Status wrapper for dot and text */
.status-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

/* The green dot */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4CAF50;
}

/* The "Online" text */
.status-text {
    font-size: 12px;
    color: #4CAF50;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #1a1a1a;
}

/* Message Styling */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    animation: messageAppear 0.3s ease-out;
}

.bot-message {
    
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: white; 

}
/* Chatbot Message Links Styling */
.bot-message a {
    color: #00C6FF; /* Change this to match your chatbot theme */
    text-decoration: none; /* Remove underline */
    font-weight: bold;
    transition: color 0.3s ease;
}

.bot-message a:hover {
    color: #0072FF; /* Slightly darker shade on hover */
    text-decoration: underline;
}
.user-message {
    align-self: flex-end;
    background: #5abe8c;
    color: white;
}

/* Welcome Message Topics List */
.chat-topics {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.chat-topics li {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Chat Input */
.chat-input {
    padding: 15px;
    background: #252222;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure Input Container is Visible */
.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 8px 15px;
    width: 100%;
}

/* Fix Message Input */
.message-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    outline: none;
    line-height: 1.4;
}

.message-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Add to chatbot.css */

/* Category Buttons Styling */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    justify-content: flex-start; /* Align buttons to the left */
}

.category-button {
    background: #5abe8c;
    color: white;
    border: none;
    padding: 10px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Playfair Display', serif;
    box-shadow: 0 2px 6px rgba(90, 190, 140, 0.2);
}

.category-button:hover {
    background: #4a906d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(90, 190, 140, 0.3);
}

.category-button:active {
    transform: translateY(0);
}

/* Enhanced Subcategories Styling */
.sub-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(90, 190, 140, 0.05);
    border-radius: 12px;
    margin: 8px 0;
    width: 100%;
    animation: slideIn 0.3s ease-out;
}

.sub-category-button {
    background: transparent;
    color: #5abe8c;
    border: 1px solid #5abe8c;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    text-align: left;
    font-family: 'Playfair Display', serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-category-button:hover {
    background: rgba(90, 190, 140, 0.1);
    transform: translateX(5px);
    border-color: #4a906d;
}

.sub-category-button:active {
    transform: translateX(2px);
}

/* Message with Buttons Container */
.message.bot-message:has(.quick-replies),
.message.bot-message:has(.sub-categories) {
    max-width: 100%;
    background: transparent;
    padding: 0;
}

/* Fix Send Button */
.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #5abe8c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-button:hover {
    background: #4a906d;
    transform: scale(1.1);
}

.send-button svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

/* Close Button */
.close-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.close-button svg {
    stroke: white;
    width: 20px;
    height: 20px;
}

.message.thinking {
    background: none !important; /* Remove background */
    padding: 8px 0; /* Adjust padding */
    box-shadow: none !important; /* Remove any shadow */
}

.drone-loader {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px; /* Add some spacing from the left */
}

.drone-loader img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Smooth fade in animation */
.message.thinking {
    animation: fadeIn 0.3s ease-out;
}
.chat-icon-animate {
    animation: pulseAndBounce 2s infinite;
}

.notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid white;
}
.message-link {
    background-color: #ff4c4c;
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.message-link:hover {
    background-color: #d43f3f;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}
@keyframes pulseAndBounce {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.1) translateY(-5px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
}


/* Mobile Responsive */
@media (max-width: 768px) {
    /* Make the chat window full screen */
    .chatbot-window {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100%;
        z-index: 1002; /* Ensures it's above everything */
        display: flex;
        flex-direction: column;
    }
    /* Prevent background scrolling when chat is open */
    .chat-open {
        overflow: hidden;
        height: 100vh;
        touch-action: none;
        position: fixed;
        width: 100%;
    }
    /* Hide toggle button when chat is open */
    .chat-open #chatbot-toggle {
        visibility: hidden;
        opacity: 0;
        z-index: -1;
    }

    /* Ensure the chat toggle button does not overlap the chat window */
    #chatbot-toggle {
        position: fixed;
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        z-index: 2001; /* Keep above the chat window when closed */
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    /* Ensure chat window is scrollable */
    .chat-messages {
        flex: 1;
        padding: 20px;
        overflow-y: auto;
        max-height: calc(100vh - 250px); /* Adjust based on header & input area height */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    }

    /* Keep input at bottom of screen */
    .chat-input {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 10px;
        display: flex;
        align-items: center;
        z-index: 1100; /* Ensure it's always above messages */
    }

 /* Input Area Refinements */
.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 8px 15px;
    width: 100%;
    transition: background-color 0.3s ease;
}

.input-container:focus-within {
    background: rgba(255, 255, 255, 0.15);
}

    /* Fix input field behavior */
    .message-input {
        flex: 1;
        font-size: 16px;
        padding: 10px;
        min-height: 40px;
        max-height: 100px;
        resize: none;
        background: transparent;
        color: white;
        border: none;
        outline: none;
    }
    .input-container {
        padding: 10px 15px;
    }

    .quick-replies {
        padding: 12px 0;
    }

    .sub-categories {
        padding: 15px;
    }
    /* Adjust send button size */
    .send-button {
        width: 45px;
        height: 45px;
        border-radius: 50%;
        border: none;
        background: #5abe8c;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .send-button:hover {
        background: #4a906d;
        transform: scale(1.1);
    }

    .send-button svg {
        width: 20px;
        height: 20px;
        stroke: white;
    }
    .category-button {
        padding: 12px 20px;
        font-size: 15px;
    }

    .sub-category-button {
        padding: 12px 18px;
        font-size: 14px;
    }
}