/* --- Design System & Variables --- */
:root {
    --primary-color: #008C99; /* The teal color from your site's menu */
    --primary-dark: #006a75;
    --font-family-base: 'Assistant', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --text-color: #333;
    --background-light: #f7f9fa;
    --background-white: #ffffff;
    --border-color: #e9ecef;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 8px 25px rgba(0, 0, 0, 0.12);
    --border-radius-main: 12px;
    --border-radius-bubble: 18px;
}

/* --- Base Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@400;600;700&display=swap');

/* --- Toggle Button --- */
.chatbot-toggle-button {
    position: fixed;
    /* HIGHER POSITIONING to avoid WhatsApp button */
    bottom: 85px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--background-white);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 9998;
    box-shadow: var(--shadow-strong);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chatbot-toggle-button:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: var(--primary-dark);
}

.chatbot-toggle-button .icon-wrapper {
    font-size: 28px;
    transition: transform 0.3s ease;
}

/* --- Chat Container --- */
.chatbot-container {
    position: fixed;
    /* Positioning above the toggle button */
    bottom: 160px;
    right: 20px;
    width: 370px;
    max-height: 70vh;
    background-color: var(--background-light);
    border-radius: var(--border-radius-main);
    box-shadow: var(--shadow-strong);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    font-family: var(--font-family-base);
    
    /* Animation */
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-container.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- Header --- */
.chatbot-header {
    background: var(--primary-color);
    color: var(--background-white);
    padding: 1rem 1.25rem;
    border-top-left-radius: var(--border-radius-main);
    border-top-right-radius: var(--border-radius-main);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-close-button {
    background: none;
    border: none;
    color: var(--background-white);
    font-size: 2rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.chatbot-close-button:hover {
    opacity: 1;
}

/* --- Messages Area --- */
.chatbot-messages {
    flex-grow: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bot-message, .user-message {
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-bubble);
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 1rem;
}

.bot-message {
    background-color: var(--background-white);
    color: var(--text-color);
    align-self: flex-start;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.user-message {
    background-color: var(--primary-color);
    color: var(--background-white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* --- Options / Buttons Area --- */
.chatbot-options {
    padding: 0.5rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--background-white);
    border-bottom-left-radius: var(--border-radius-main);
    border-bottom-right-radius: var(--border-radius-main);
}

.chatbot-option-button {
    width: 100%;
    padding: 0.85rem 1rem;
    font-family: var(--font-family-base);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--primary-color);
    background-color: var(--background-white);
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.chatbot-option-button:hover {
    background-color: var(--primary-color);
    color: var(--background-white);
}

.chatbot-option-button:disabled {
    background-color: var(--border-color);
    border-color: var(--border-color);
    color: #999;
    cursor: not-allowed;
    transform: none;
}


/* --- Responsiveness for Mobile --- */
@media (max-width: 768px) {
    .chatbot-toggle-button {
        bottom: 85px; /* Adjust if needed to clear WhatsApp button */
        right: 15px;
        width: 55px;
        height: 55px;
    }
    .chatbot-toggle-button .icon-wrapper {
        font-size: 24px;
    }

    .chatbot-container {
        /* Full width on mobile, with small margins */
        width: calc(100% - 30px);
        max-width: 400px;
        bottom: 155px; /* Adjust to stay above the button */
        right: 15px;
        max-height: 65vh;
    }
}


/* --- Responsiveness for Mobile --- */
@media (max-width: 768px) {
    .chatbot-toggle-button {
        bottom: 80px; /* Adjust if needed to clear WhatsApp button */
        right: 15px;
        width: 55px;
        height: 55px;
    }
    .chatbot-toggle-button .icon-wrapper {
        font-size: 24px;
    }

    .chatbot-container {
        /* Full width on mobile, with small margins */
        width: calc(100% - 30px);
        max-width: 400px;
        bottom: 150px; /* Adjust to stay above the button */
        right: 15px;
        max-height: 65vh;
    }
}


/* --- Responsiveness for Mobile --- */
@media (max-width: 768px) {
    .chatbot-toggle-button {
        bottom: 80px; /* Adjust if needed to clear WhatsApp button */
        right: 15px;
        width: 55px;
        height: 55px;
    }
    .chatbot-toggle-button .icon-wrapper {
        font-size: 24px;
    }

    .chatbot-container {
        /* Full width on mobile, with small margins */
        width: calc(100% - 30px);
        max-width: 400px;
        bottom: 150px; /* Adjust to stay above the button */
        right: 15px;
        max-height: 65vh;
    }
}
