﻿
::-webkit-scrollbar,
scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track,
scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb,
scrollbar-thumb {
    background-color: var(--current-color);
    outline: 1px solid var(--current-color);
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow: hidden;
}

h1 {
    color: #1f2937;
    font-family: Univers, sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
}

.subtitle {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    margin-top: 2px;
    letter-spacing: 0;
    line-height: 1 !important;
}

/* Header banner styling to match screenshot */
#banner {
    background: linear-gradient(135deg, #f5fafd 0%, #e8f0fc 100%);
    border-bottom: 1px solid #e5eaf2;
    display: flex;
    align-items: center;
    height: 64px;
    min-height: 64px;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    padding-block: 10px;
    gap: 18px;
}
.logo-titles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
}

    .logo-titles strong {
        padding-top:15px;
        font-weight: 600;
        font-size: 20px;
        color: #1F252A;
    }

    .logo-titles p {
        font-weight: 400;
        font-size: 14px;
        color: #A2AAAD;
    }


.logo-icon {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.04);
    color: #1976d2;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
    border: none;
    padding: 3px;
}

.logo-container img {
/*    width: 100%;*/
    height: 25px;
    object-fit: contain;
    max-width: 200px;
}
.logoutBtn-holder {
    margin-left: auto;
    margin-right: 50px;
}

@media (max-width: 768px) {
    .logoutBtn-holder {
        margin-right: 20px;
    }
}

.logoutBtn {
    display: flex;
    align-items: center;
    color: #005EB8;
    text-decoration: none;
    position: relative;
    border-bottom: 1px solid blue;
    gap: 10px;
    padding-bottom: 5px;
    font-size: 14px;
    font-weight: 400;
}
    .logoutBtn::before {
        content: '';
        width: 10px;
        height: 10px;
        background-image: url(/images/back-logout-icon.svg);
        background-repeat: no-repeat;
        background-size: contain;
        pointer-events: none;
        z-index: 1; /* make sure it stays above/below as needed */
    }

#webchat {
    height: calc(100% - clamp(44px, 8vh, 60px) - env(safe-area-inset-top));
    overflow: hidden;
    position: fixed;
    top: calc(clamp(44px, 8vh, 60px) + env(safe-area-inset-top));
    width: 100%;
    padding-bottom: env(safe-area-inset-bottom);
    background: linear-gradient(135deg, #f5fafd 0%, #e8f0fc 100%);
}

    #webchat::after {
        content: '';
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 160px;
        background: linear-gradient(to top, rgba(245, 250, 253, 1) 0%, rgba(245, 250, 253, 0.98) 25%, rgba(245, 250, 253, 0.9) 60%, rgba(245, 250, 253, 0) 100%);
        pointer-events: none;
        z-index: 99;
    }

.webchat__suggested-actions {
    position: absolute !important;
    top: 0;
    left: 0;
    translate: 0 -100%;
    pointer-events: none;
}

    .webchat__suggested-actions button {
        border-radius: 20px !important;
        border: solid 1px var(--current-color) !important;
        pointer-events: all;
        cursor: pointer;
        transition: all 0.4s ease;
        z-index: 30;
    }

        .webchat__suggested-actions button:hover {
            background-color: var(--current-color) !important;
            color: white !important;
        }


#webchat .webchat__basic-transcript__transcript {
    max-width: 860px;
    width: 100%;
    margin-inline: auto;
    padding-bottom: 180px;
}

.webchat__basic-transcript__activity:first-child p {
    font-size: 20px !important;
    line-height: 1.3 !important;
    text-wrap: balance !important;
    margin-bottom: 40px !important;
    font-weight: 500 !important;
}

    .webchat__basic-transcript__activity:first-child p strong {
        font-weight: 500 !important;
    }

.webchat__typing-indicator {
    max-width: 815px;
    width: 100% !important;
    margin-inline: auto;
    position: absolute;
    bottom: 162px;
    left: 50%;
    translate: -50% 0;
}

@media (max-width: 768px) {

    #webchat .webchat__basic-transcript__transcript {
        padding-bottom: 150px;
    }

    .webchat__typing-indicator {
        max-width: unset !important;
        width: 30px !important
    }
}

.webchat__activity-status {
    display: none !important;
}

/* Ensure new messages appear properly spaced */
.webchat__basic-transcript__activity {
    margin-bottom: 20px !important;
}

.webchat__text-content {
    padding: 16px !important;
    padding-block: 0 !important;
}

    .webchat__text-content :is(ul, ol):not(:last-child) {
        padding-left: 1.2rem;
        margin-bottom: 2rem;
    }

    .webchat__text-content :is(p, li):not(:last-child) {
        margin-bottom: 1rem;
    }

/* Send box styling - fixed at bottom */
.webchat__send-box {
    background: #fff !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 12px !important;
    margin: 0 !important;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 40px;
    z-index: 100;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.12), 0 8px 32px rgba(0, 0, 0, 0.08) !important;
    max-width: 820px;
    width: calc(100% - 64px);
    border: 1px solid #e5e7eb;
}

    .webchat__send-box .webchat__send-box__main {
        border-top: unset !important;
    }

.webchat__send-box-text-box__input {
    border: none !important;
    background: transparent !important;
    font-family: Univers, sans-serif !important;
    font-size: 16px !important;
    padding: 20px 24px !important;
    color: #1a1a1a !important;
    outline: none !important;
    resize: none !important;
    width: 100% !important;
    line-height: 1.5 !important;
}

.webchat__bubble--from-user .webchat__bubble__content {
    padding: 8px !important;
    font-size: 15px !important;
}

/* Send button styling */
.webchat__icon-button {
    background-color: #005EB8 !important;
    border: none !important;
    border-radius: 8px !important;
    width: 64px !important;
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 8px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4) !important;
}

    .webchat__icon-button:hover {
        transform: scale(1.05) !important;
        box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5) !important;
    }

    .webchat__icon-button:active {
        transform: scale(0.95) !important;
    }

    .webchat__icon-button svg {
        fill: white !important;
        width: 24px !important;
        height: 24px !important;
    }

.webchat__icon-button__shade {
    display: none;
}

/* Remove the old backdrop - we're using the mask approach now */
.webchat__send-box::before {
    display: none;
}


@media (max-width: 480px) {

    .webchat__avatar,
    .webchat__avatar img,
    .webchat__avatar__initials {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
        line-height: 36px !important;
    }

    .webchat__avatar__initials {
        font-size: 1em !important;
        line-height: 36px !important;
    }
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    h1 {
        font-size: 16px;
        padding: 0 12px;
    }
/*
    #banner {
        display: none;
    }*/

    #webchat {
        height: calc(100% - env(safe-area-inset-top));
        top: env(safe-area-inset-top);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 14px;
        padding: 0 10px;
    }

/*    #banner {
        display: none;
    }*/

    #webchat {
        height: calc(100% - env(safe-area-inset-top));
        top: env(safe-area-inset-top);
    }
}

/* Prevent zoom on inputs in iOS */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    font-size: 16px !important;
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #banner {
        height: 40px;
        min-height: 40px;
    }

    #webchat {
        height: calc(100% - 40px - env(safe-area-inset-top));
        top: calc(40px + env(safe-area-inset-top));
    }

    h1 {
        font-size: 14px;
        padding: 0 8px;
    }
}

/* Loading state */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: inherit;
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    padding: 32px;
    z-index: 1001;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.webchat__typing-indicator {
    max-width: 815px;
    width: 100% !important;
    margin-inline: auto;
    position: absolute;
    bottom: 162px;
    left: 50%;
    translate: -50% 0;
    z-index: 101; /* ✅ ADDED: Above send box backdrop */
}

@media (max-width: 768px) {

    #webchat .webchat__basic-transcript__transcript {
        padding-bottom: 150px;
    }

    /* ✅ UPDATED: Show typing indicator properly on mobile */
    .webchat__typing-indicator {
        max-width: 100% !important;
        width: auto !important; /* ✅ CHANGED: Was 30px */
        padding: 0 20px; /* ✅ ADDED */
        bottom: 140px; /* ✅ ADDED: Position above send box */
    }
}

/* ... existing styles ... */

@media (max-width: 480px) {

    .webchat__avatar,
    .webchat__avatar img,
    .webchat__avatar__initials {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
        line-height: 36px !important;
    }

    .webchat__avatar__initials {
        font-size: 1em !important;
        line-height: 36px !important;
    }

    /* ✅ ADDED: Adjust send box for mobile keyboard */
    .webchat__send-box {
        bottom: max(20px, env(safe-area-inset-bottom));
        width: calc(100% - 32px);
    }
}