/*
Available Jinja Variables:
- header_background_color: The background color of the header
- header_text_color: The text color of the header
- user_message_background_color: The background color of the user message
- user_message_text_color: The text color of the user message
- hook_message_background_color: The background color of the hook message
- hook_message_text_color: The text color of the hook message
- hook_icon_border_style: The border style of the hook icon
- make_desktop_icon_larger: Whether to make the desktop icon larger (string "true" or "false")
- chatbot_font_family: The font family with fallback chain
*/

:root {
    --header-bg: #f5f5f5;
    --header-text-color: #171717;
    --user-message-bg: #235aa7;
    --user-message-text-color: #ffffff;
    --hook-message-bg: #e7e7e7;
    --hook-message-text-color: #171717;
    --hook-icon-border-style: 4px solid #235aa7;

    /* Icon sizing - defaults to small (mobile) sizes */
    --bubble-icon-size: 64px;
    --hook-message-width: 190px;
    --hook-message-padding: 11px;
    --hook-message-padding-right: 25px;
    --hook-message-font-size: 12px;
    --hook-message-line-height: 16px;
}

body, button, input, select, textarea {
    font-family: 'Inter', sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
}

body {
    display: flex;
    justify-content: flex-end;
    align-items: end;
    overflow: hidden;
}

ul, ol, li {
    margin-left: 10px;
}

ul, ol {
    display: grid;
    padding-left: 10px;
}

.chat-bubble-container {
    position: relative;
    display: flex;
    align-items: center;
    overflow: visible;
    margin: 5px; /*due to pulse*/

    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1); /* Normal size */
        opacity: 1; /* Fully visible */
    }
    50% {
        transform: scale(1.03); /* Slightly larger */
        opacity: 1; /* Slightly faded */
    }
    100% {
        transform: scale(1); /* Back to normal size */
        opacity: 1; /* Fully visible */
    }
}

.hook-message {
    display: none; /* flex */
    align-items: center;
    margin-right: -12px;
    box-sizing: border-box;
    max-width: var(--hook-message-width);
    padding: var(--hook-message-padding);
    padding-right: var(--hook-message-padding-right);
    border-radius: 8px;

    font-weight: 500;
    font-size: var(--hook-message-font-size);
    line-height: var(--hook-message-line-height);
    letter-spacing: 0.01em;

    background-color: var(--hook-message-bg);
    color: var(--hook-message-text-color);

    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);

}

.close-hook-message {
    display: none; /* flex */
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    padding: 2px;
    border-radius: 1000px;
    background-color: #FFFFFF;
    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);

}

.chat-bubble {
    position: relative;

    box-sizing: border-box;

    cursor: pointer;
}

.chat-bubble-icon {
    background-color: #FFFFFF;
    border-radius: 1000px;
    width: var(--bubble-icon-size);
    height: var(--bubble-icon-size);
    border: var(--hook-icon-border-style);

    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
}

.chat-window {
    height: 100%;
    background-color: white;
    display: none;
    flex-direction: column;
    overflow: hidden;

    border-radius: 16px;

    box-shadow: 0px 1px 3px rgba(16, 24, 40, 0.08);
}

.chat-header {
    background-color: var(--header-bg);

    padding-top: 16px;
    padding-right: 24px;
    padding-bottom: 16px;
    padding-left: 24px;

    height: 64px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
}

.chat-header-logo {
    width: 42px;
    height: 42px;
    margin-right: 10px; /* Add some space between the icon and the text */
    border-radius: 1000px;
}

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

.chat-header-title {
    font-weight: 500;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: -0.01em;

    color: var(--header-text-color);
}

.chat-header-subtitle {
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: -0.02em;

    color: var(--header-text-color);
}

.chat-header-close {
    stroke: unset;
    width: 24px;
    height: 24px;
    cursor: pointer;
    stroke: var(--header-text-color);
    fill: none;
}

#chat-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto; /* Grow to take up the remaining space */
    overflow: hidden; /* Prevent overflow */
}

.chatnav-privacy {
    font-weight: 400;
    font-size: 10px;
    line-height: 100%;
    letter-spacing: -0.02em;
    text-align: center;
    color: #ABABAB;
}

.privacy-policy-link {
    color: #0A4CB0;
    text-decoration: none; /* Remove underline */
}

.privacy-policy-link:hover {
    text-decoration: underline; /* Underline on hover */
}

#messages {
    overflow-y: auto;
    padding: 10px;
    padding-bottom: 0;
    flex-basis: 100%;
}

/* Message bubbles */
.message {
    margin: 8px 0;
    border-radius: 16px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

.user-message {
    max-width: 75%;

    margin-left: auto;
    overflow-x: auto; /* Allow horizontal scrolling */

    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom-left-radius: 16px;
    padding: 12px;

    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: -0.01em;

    background-color: var(--user-message-bg);
    color: var(--user-message-text-color);
}

.bot-message {
    display: flex; /* Make the bot message shrink to its content */
    flex-direction: column;
    max-width: 75%;
    margin-right: auto;
    white-space: pre-wrap; /* CSS property to respect white space and new lines */
    overflow-x: auto; /* Allow horizontal scrolling */

    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: -0.01em;

    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    padding: 12px;

    background-color: #F5F5F5;
    color: #474747;
}

img {
    max-width: 150px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.bot-message-container {
    display: flex;
    flex-direction: row;
}

.agent-icon {
    width: 40px; /* Set the width of the icon */
    height: 40px; /* Set the height of the icon */
    margin-right: 2px; /* Add some space between the icon and the text */
    margin-top: 10px; /* Move the icon a bit down at start */
    align-self: flex-end;
    border-radius: 1000px;
}

.chat-footer {
    padding: 24px;
    background-color: #FAFAFA;
    border-top: 1px solid #E7E7E7;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-container {
    display: flex;
    gap: 16px;
    height: 48px;
    box-sizing: border-box;
    padding-top: 12px;
    padding-right: 12px;
    padding-bottom: 12px;
    padding-left: 20px;
    border-radius: 16px;
    border-width: 1px;
    background-color: #FFFFFF;
    border: 1px solid #ABABAB;
}

.input-container:focus-within {
    border: 1px solid var(--user-message-bg);
}

.message-input {
    flex: 1;
    border: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: -0.01em;
    color: #474747;
    background-color: #FFFFFF;
}

.message-input::placeholder {
    color: #ABABAB;
}

.message-input:focus {
    outline: none;
    border: none;
}

.send-button {
    width: 24px;
    height: 24px;

    cursor: pointer;

    fill: var(--user-message-bg);
}

.send-button.disabled {
    fill: #666666; /* Change to desired disabled text color */
}

/* Voice button */
.voice-status {
    min-height: 16px;
    padding: 0 12px 4px;
    font-size: 11px;
    color: #888;
    text-align: center;
    letter-spacing: 0.02em;
    transition: opacity 0.2s ease;
}

.voice-status:empty {
    display: none;
}

.voice-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--user-message-bg);
    flex-shrink: 0;
}

.voice-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.voice-button.active {
    color: #d32f2f;
    animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(1.15); }
}

.loading-message {
    display: flex;
    flex-direction: row;
    max-width: fit-content; /* Adjust width to fit content */
}

.loading-dots {
    display: inline-block;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

.loading-dots span {
    animation: blink 1.4s infinite both;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% {
        opacity: 0.2;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}

#suggestions-container {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping to the next line */
    overflow-x: auto; /* Enable horizontal scrolling */
    gap: 6px;
    height: 96px;
    box-sizing: border-box;
    align-items: center;
    border-bottom-width: 1px;
    padding: 24px;
    overflow-y: hidden;

    /* Hide scrollbar for WebKit browsers */
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For Internet Explorer and Edge */
}

#suggestions-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for WebKit browsers */
}

.suggestion {
    flex-shrink: 0;;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;

    height: 48px;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 12px;
    border-width: 1px;
    background-color: #FAFAFA;
    color: #171717;

    border: 1px solid #ABABAB;
    box-shadow:
        0px 2px 4px -2px rgba(16, 24, 40, 0.06),
        0px 4px 8px -2px rgba(16, 24, 40, 0.10);

    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: -0.01em;
    vertical-align: middle;


}

.suggestion:hover {
    background-color: #e1e1e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#suggestions-container.dragging {
    cursor: grabbing;
}
#suggestions-container {
    cursor: grab;
}