/* 
    **************************************
    Root styles 
    **************************************
*/
:root {
    --color-primary: #ffffff;
    --color-secondary: #152d4f;;
    --color-tertiary: #152d4f;;
    --color-quaternary: #EEEFF2;
    --color-gray-100: #f9fafb;
    --color-gray-200: #f3f4f6;
    --color-gray-300: #e5e7eb;
    --color-gray-400: #d1d5db;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111928;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-red-500: #f05252;
    --color-red-600: #c81e1e;
    --color-blue-gray: #545e7f;
    --color-dark-blue: #313e6d;
    --color-light-gray: #878891;
    --color-border-gray: #dadce1;
    --color-icon-gray: #d1d5db;
    --color-icon-text: #4b5563;
    --color-time-light: #b0b5c5;
    --color-oklch-blue: #4a5565;
    --color-yellow: #ffc83d;
}

* {
    margin: 0;
    padding: 0;
    /* box-sizing: border-box; */
}

body {
    min-height: 100vh;
}

input, button {
    font-family: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    font-size: 100%;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}

svg {
    width: 1.75rem;
    height: 1.75rem;
}


/* 
    **************************************
    Floating alert message
    **************************************
*/
.alert-message {
    border-radius: 8px;
    position: fixed;
    margin: 1.25rem 0;
    bottom: 5rem;
    right: 0.75rem;
    width: 22rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    cursor: pointer;
}

.notification-header {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    padding-bottom: 0.5rem;
}

.notification-left {
    display: flex;
    align-items: center;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    color: var(--color-oklch-blue);
    font-size: 0.75rem;
    line-height: 1rem;
}

.notification-title {
    color: var(--color-primary);
    font-weight: bold;
    font-size: 20px;
    line-height: 125%;
}

.close-notification {
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 50%;
    background-color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.notification-body {
    padding: 1rem;
    padding-top: 0.5rem;
    background-color: var(--color-white);
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.notification-text {
    margin: 0;
    color: var(--color-gray-900);
    font-weight: normal;
    font-size: 17px;
    line-height: 150%;
}


/* 
    **************************************
    Floating toggle widget button 
    **************************************
*/
.floating-button {
    background-color: var(--color-secondary);
    border-radius: 8px;
    border: 3px solid var(--color-secondary);
    box-shadow: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    position: fixed;
    bottom: 1.5rem;
    right: 0.75rem;
    width: 3.5rem;
    height: 3.5rem;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 1.25rem; /* 1.25rem (20px) */ 
    line-height: 1.75rem;
    cursor: pointer;
}


/* 
    **************************************
    Chat widget container 
    **************************************
*/
.chat-widget-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 999999;
    font-family: "Montserrat", sans-serif !important;
    font-feature-settings: 'liga' 1, 'calt' 1; /* fix for Chrome */
}

.chat-widget {
    /* Responsive sizing */
    height: 90vh;
    max-height: 906px;
    width: 90vw;
    max-width: 450px;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px solid var(--color-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 1.5rem;
    right: 0.75rem;
    z-index: 10;
}

.scroll-container {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    overflow-y: auto;
}

.scroll-container::-webkit-scrollbar {
    width: 6px;
}

.scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.header-gradient {
    background: linear-gradient(to right, var(--color-tertiary), var(--color-secondary));
}


/* 
    **************************************
    Chat widget header 
    **************************************
*/
.chat-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-gray-300);
    box-sizing: border-box;
}

.menu-container {
    position: relative;
}

.menu-button {
    padding: 0;
    width: 28px;
    height: 48px;
    color: var(--color-primary);
    font-size: 1.875rem;
    line-height: 2.25rem;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-dropdown {
    position: absolute;
    left: 0;
    margin-top: 0.5rem;
    width: max-content;
    background-color: var(--color-white);
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0;
    z-index: 20;

    #endChatButton > i {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
}

.menu-dropdown.hidden {
    display: none;
}

.menu-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--color-gray-700);
    text-decoration: none;
}

.menu-item:hover {
    background-color: var(--color-gray-200);
}

.chat-title {
    margin: 0;
    font-size: 1rem;
    line-height: 125%;
    font-weight: normal;
    color: var(--color-primary);
    white-space: pre-wrap;
}

.minimize-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 8px 0;
    background-color: var(--color-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1.75rem;
}


/* 
    **************************************
    Chat widget transcript 
    **************************************
*/
.transcript-container {
    height: calc(100% - 176px);
    flex-grow: 1;
    padding: 1rem;
    background-color: var(--color-white);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.quick-replies-container {
    display: flex; 
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.quick-replies-button {
    padding: 0.25rem 0.5rem;
    border-color: var(--color-blue-gray);
    border-style: solid;
    border-radius: 0.5rem; 
    border-width: 1px;
    font-weight: 500;
    background-color: var(--color-quaternary);
    color: var(--color-primary);
    font-size: 1rem;
    line-height: 150%;
    cursor: pointer;
}

.quick-replies-button:focus {
    outline: none;
}

.quick-replies-button:disabled {
    border-color: var(--color-border-gray);
    color: var(--color-light-gray);
}

.message-bubble {
    margin-bottom: 1rem;
}

.message-bubble-bot-container {
    display: flex;
    align-items: flex-start;
}

.message-bubble-bot-content {
    background-color: var(--color-quaternary);
    border-radius: 0px 20px 20px 20px;
    padding-right: 0.5rem;
    padding-bottom: 0.5rem;
    padding-top: 1rem;
    padding-left: 1rem;
}

.message-bubble-bot-name-container {
    padding: 0.75rem 1rem;
}

.message-bubble-bot-icon {
    display: flex;
    margin-right: 0.5rem;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background-color: var(--color-icon-gray);
    color: var(--color-icon-text);
}

.message-bubble-bot-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* .message-bubble-bot-content p {
    margin: 0;
    padding-right: 0.5rem;
    color: var(--color-gray-900);
    max-width: 350px;
    font-size: 0.875rem;
    line-height: 150%;
    white-space: pre-wrap;
} */

.message-bubble-bot-text, .message-bubble-bot-text * {
    margin: 0;
    padding-right: 0.5rem;
    color: var(--color-gray-900);
    max-width: 350px;
    font-size: 0.875rem;
    line-height: 150%;
    white-space: pre-wrap;
}

.message-bubble-bot-text a {
    color: -webkit-link;
}

.message-bubble-bot-text ul, .message-bubble-bot-text ol {
    list-style-position: inside;
}

.message-bubble-bot-time {
    display: flex;
    margin-top: 0.25rem;
    margin-bottom: 0;
    justify-content: flex-start;
    color: var(--color-gray-500);
    font-size: 0.625rem;
    line-height: 150%;
}

.message-bubble-bot-content.typing {
    padding: 0.75rem;
}

.message-bubble-bot-typing-container {
    display: flex;

    & > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0.25rem;
    }
}

.message-bubble-user-container {
    display: flex;
    justify-content: flex-end;
}

.message-bubble-user-content {
    background-color: var(--color-secondary);
    color: var(--color-white);
    border-radius: 20px 0px 20px 20px;
    padding-right: 0.5rem;
    padding-bottom: 0.5rem;
    padding-top: 1rem;
    padding-left: 1rem;
}        

.message-bubble-user-text {
    margin: 0;
    padding-right: 0.5rem;
    color: var(--color-white);
    max-width: 394px;
    font-size: 0.875rem;
    line-height: 150%;
}

.message-bubble-user-time {
    display: flex;
    margin-top: 0.25rem;
    margin-bottom: 0;
    justify-content: flex-start;
    color: var(--color-time-light);
    font-size: 0.625rem;
    line-height: 150%;
}

.message-bubble-feedback-container {
    display: flex;
    padding: 0.75rem 0;
    gap: 10px;
}

.message-bubble-feedback-icon {
    border: 1px solid var(--color-gray-500);
    border-radius: 10px;
    padding: 0.5rem;
    cursor: pointer;
}

.message-bubble-feedback-icon svg {
    width: 15px;
    height: 15px;
    fill: var(--color-yellow);
}

.radio-group {
    margin-bottom: 1rem;
    display: flex;
    justify-content: end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-input {
    display: grid;
    gap: 0.5rem;
}

.custom-form-view {
    display: flex;
    padding-top: 1rem;
    padding-bottom: 1rem;
    flex-direction: row-reverse;
    gap: 0.625rem;
}

.custom-form-view-submit-button {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    border-width: 1px;
    font-weight: 500;
    color: var(--color-white);
    background-color: var(--color-dark-blue);
    border-color: var(--color-blue-gray);
    font-size: 0.875rem;
    line-height: 150%;
}

.custom-form-view-action-button {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem; 
    border-width: 1px; 
    font-weight: 500; 
    border-color: var(--color-blue-gray);
    color: var(--color-blue-gray);
    font-size: 0.875rem;
    line-height: 150%;
}

.custom-form-view-input-container {
    display: grid;
    padding-right: 0.5rem; 
    gap: 0.5rem; 
    max-width: 344px;
}

.custom-form-view-input-label {
    font-weight: 500;
    color: var(--color-gray-900);
    font-size: 0.875rem;
    line-height: 150%;
}

.custom-form-view-input-label.invalid {
    color: var(--color-red-600);
}

.custom-form-view-input-input {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border-width: 1px;
    width: 100%;
    background-color: var(--color-gray-100);
    border-color: var(--color-gray-400);
    color: var(--color-gray-900);
    font-size: 0.875rem;
    line-height: 150%;
}

.custom-form-view-input-input.invalid {
    background-color: #FDF2F2;
    border-color: var(--color-red-500);
    color: var(--color-red-600);
}

.custom-form-view-input-small {
    color: var(--color-red-600);
    font-size: 0.875rem;
    line-height: 125%;
}

.typing-dot {
    animation: bounce 1s infinite;
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--color-gray-500); 
    border-radius: 50%;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.1s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.2s;
}


/* 
    **************************************
    Chat widget composer 
    **************************************
*/
.composer-container {
    height: 96px;
    border-top: 1px solid var(--color-gray-300);
    background-color: var(--color-white);
}

.composer-inner {
    padding: 0.75rem 1rem;
}

.input-container {
    display: flex;
    padding: 0.875rem 1rem;
    border: 1px solid #676565;
    border-radius: 1.75rem;
    border-style: solid;
}

.message-input {
    flex-grow: 1;
    color: var(--color-black);
    /* font-size: 1.25rem; */
    line-height: 18px;
    border: none;
    outline: none;
}

.message-input::placeholder {
    color: var(--color-gray-500);
}

.send-button {
    margin-left: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}


/* 
    **************************************
    Utility classes 
    **************************************
*/
.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.text-xl {
    font-size: 1.25rem; /* 1.25rem (20px) */ 
    line-height: 1.75rem;
}

.chat-ended-message {
    margin: 0;
    font-size: 1rem;
    line-height: 150%;
    font-weight: 500;
    text-align: center;
    color: var(--color-secondary);
}


/* 
    **************************************
    Animations 
    **************************************
*/
@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: none;
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}


/* 
    **************************************
    Media queries for responsive design
    **************************************
*/
@media (min-width: 768px) {
    .chat-widget {
        bottom: 2rem;
        right: 2rem;
    }
    
    .floating-button {
        bottom: 2rem;
        right: 2rem;
    }
    
    .alert-message {
        bottom: 6rem;
        right: 2rem;
        width: 24rem;
    }
}

@media (min-width: 430px) {
    .message-input {
        font-size: 1.25rem;
    }
}