/* Chatbot Variables */
:root {
    --chat-primary: #5AB2FF;
    --chat-bg: #1a1a1a;
    --chat-text: #ffffff;
    --chat-secondary-bg: #2d2d2d;
    --chat-width: 350px;
    --chat-height: 500px;
    --chat-radius: 12px;
}

/* Floating Button */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--chat-primary);
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1);
}

.chatbot-toggle-btn i {
    font-size: 28px;
    color: white;
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: var(--chat-width);
    height: var(--chat-height);
    max-width: 90vw;
    max-height: 80vh;
    background-color: var(--chat-bg);
    border-radius: var(--chat-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Urbanist', sans-serif;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-window.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Header */
.chatbot-header {
    background-color: var(--chat-secondary-bg);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--chat-text);
}

.close-chat-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
}

.close-chat-btn:hover {
    color: white;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.bot {
    background-color: var(--chat-secondary-bg);
    color: var(--chat-text);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message.user {
    background-color: var(--chat-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Link Styling within Messages */
.message a {
    color: var(--chat-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed var(--chat-primary);
    padding-bottom: 2px;
}

.message a:hover {
    color: #fff;
    border-bottom-style: solid;
}

/* Input Area */
.chatbot-input-area {
    padding: 15px;
    background-color: var(--chat-secondary-bg);
    display: flex;
    gap: 10px;
}

.chatbot-input-area input {
    flex: 1;
    background-color: #3d3d3d;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    outline: none;
    font-family: 'Urbanist', sans-serif;
}

.chatbot-input-area input::placeholder {
    color: #bbb;
}

.chatbot-input-area button {
    background-color: var(--chat-primary);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input-area button:hover {
    opacity: 0.9;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chatbot-toggle-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        z-index: 2147483647;
        /* Ensure highest priority */
    }

    .chatbot-window {
        bottom: 80px;
        /* Above the button */
        right: 5%;
        width: 90%;
        /* Take up most width */
        height: 70vh;
        /* Adjust height for keyboard */
        max-width: none;
        max-height: 80vh;
    }

    .chatbot-header h3 {
        font-size: 15px;
        /* Slightly smaller text */
    }
}