@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

/* Chat Widget Styles */
#alie-chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    flex-direction: column;
    z-index: 9999;

    font-family: "Noto Sans", sans-serif;
    font-size: 13px;
}

#alie-chat-widget-container,
#alie-chat-widget-container * {
    font-family: "Noto Sans", sans-serif;
}

#alie-chat-bubble {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #007bff, #0056d2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.875rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
}

#alie-chat-bubble:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15),
        0 10px 10px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

#alie-chat-bubble svg {
    width: 40px;
    height: 40px;
    color: white;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background-color: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    min-width: 280px;
    white-space: normal;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}



#alie-chat-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    font-size: 0.875rem;
    height: 70vh;
    max-height: 70vh;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#alie-chat-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#alie-chat-popup #chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px 6px 10px;
    background-color: #006EFA;
    color: white;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(135deg, #007bff, #0056d2);
}

#alie-chat-popup #chat-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: 'Roboto Slab', serif;
}

#alie-chat-popup #close-popup {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#alie-chat-popup #close-popup:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#close-popup svg {
    height: 24px;
    width: 24px;
}

#user-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap: 12px;
}

#user-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

#user-form input,
#user-form textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    outline: none;
    font-size: 0.875rem;
    box-sizing: border-box;
}

#user-form input:focus,
#user-form textarea:focus {
    border-color: #1f2937;
    box-shadow: 0 0 0 1px #1f2937;
}

#user-form textarea {
    resize: none;
}

#start-chat {
    width: 100%;
    background-color: #006EFA;
    color: white;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

#start-chat:hover {
    background-color: rgb(10, 88, 202);
}

/* Chat Interface Styles */
#alie-chat-popup #chat-interface {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#alie-chat-popup #chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    min-height: 0;
}

#alie-chat-popup .message-container {
    /* display: flex; */
    margin-bottom: 12px;
    font-size: 14px;
}

#alie-chat-popup .message-container.user {
    display: flex;
    justify-content: flex-end;
}

#alie-chat-popup .message-container.bot {
    color: #333;
    /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); */
    background: #f8f9fa;
    border-radius: 0px 14px 14px 14px;
    border: 1px solid #e3e3e352;
    justify-content: flex-start;
}

#alie-chat-popup .message-content {
    border-radius: 8px;
    padding: 2px 15px;
    word-wrap: break-word;
    position: relative;
}

#alie-chat-popup .message-content p {
    margin: 1em 0 !important;
}

#alie-chat-popup .message-content.user {
    max-width: 80%;
    background: linear-gradient(135deg, #007bff, #0056d2);
    color: #fff;
    border-radius: 14px 14px 0 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#alie-chat-popup .message-content.bot {
    line-height: 1.4;
    overflow: auto;
}


#alie-chat-popup .message-footer {
    padding: 6px 10px;
    background: #f8f9fa;
    border-top: 1px solid #e6e6e659;
    border-radius: 0 0 14px 14px;
    font-size: 13px;
    color: #777;
    gap: 10px;
}

#alie-chat-popup #chat-input-container {
    padding: 10px 5px;
    border-top: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

#alie-chat-popup #chat-input {
    height: 40px;
    flex: 1 1;
    border: none;
    outline: none;
    resize: none;
    margin-right: 30px;
    font-size: 14px;
    height: 34px;
    margin-right: 30px;
    overflow: hidden;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

#alie-chat-popup .input-row {
    position: relative;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    background-color: #fff;
    margin: auto;
    padding-top: 0;
    padding-left: 10px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

#alie-chat-popup textarea#chat-input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

#alie-chat-popup .msg_send_btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    position: absolute;
    right: 0px;
    bottom: 4px;
    margin-right: 0;
    padding-top: 5px;
    padding-bottom: 0 !important;
    padding: 5px 10px 5px 8px;
}

#alie-chat-popup .footer-text {
    display: flex;
    text-align: center;
    font-size: 0.60rem;
    padding-top: 16px;
}

#alie-chat-popup .footer-text span {
    flex: 1;
    color: #6b7280;
}

#alie-chat-popup .footer-text a {
    color: #0659ff;
    cursor: pointer;
    font-weight: 500;
}

/* Loading indicator */
#alie-chat-popup .loading-indicator {
    display: flex;
    box-sizing: content-box !important;
    align-items: center;
    gap: 4px;
    padding: 15px 15px;
    background-color: #f3f4f6;
    border-radius: 8px;
    max-width: 10%;
}

#alie-chat-popup .loading-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #333;
    animation: loading-pulse 1.4s ease-in-out infinite both;
}

#alie-chat-popup .loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

#alie-chat-popup .loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading-pulse {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* #alie-chat-popup {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        bottom: 0;
    } */

    #alie-chat-widget-container {
        bottom: 20px;
        right: 20px;
    }

    .tooltip {
        right: -50px;
        max-width: 200px;
    }
}

/* Scrollbar Styling */
#alie-chat-popup #chat-messages::-webkit-scrollbar {
    width: 6px;
}

#alie-chat-popup #chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#alie-chat-popup #chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#alie-chat-popup #chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Error validation styles for chat widget */

/* Required field indicator */
#alie-chat-popup .required {
    color: #e53e3e;
    font-weight: bold;
}

/* Error state for input fields */
#alie-chat-popup .error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 1px #e53e3e !important;
}

/* Error message styling */
#alie-chat-popup .field-error-message {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
    animation: fadeIn 0.3s ease-in;
    font-weight: 500;
}

/* Fade in animation for error messages */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus state for error fields */
#alie-chat-popup input.error:focus,
#alie-chat-popup textarea.error:focus {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.2) !important;
    outline: none;
}

/* Enhanced label styling */
#alie-chat-popup label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

/* Input field enhancements */
#alie-chat-popup input[type="text"],
#alie-chat-popup input[type="email"],
#alie-chat-popup textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#alie-chat-popup input[type="text"]:focus,
#alie-chat-popup input[type="email"]:focus,
#alie-chat-popup textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
    outline: none;
}

#alie-chat-popup .message-container .inline-form-input {
    width: 90%;
    margin-bottom: 0.5rem;
}

#alie-chat-popup .message-container .inline-form-submit {
    background-color: #007bff;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 10px;
    -webkit-appearance: none;
    appearance: none;
}

/* Form field container spacing */
#alie-chat-popup #user-form>div {
    margin-bottom: 15px;
}

/* Button hover state enhancement */
#alie-chat-popup #start-chat {
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

#alie-chat-popup #start-chat:hover {
    opacity: 0.9;
}

#alie-chat-popup #start-chat:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button loading animation styles */
#alie-chat-popup .button-loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

#alie-chat-popup .button-loading-indicator .loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    animation: buttonLoadingPulse 1.4s ease-in-out infinite both;
}

#alie-chat-popup .button-loading-indicator .loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

#alie-chat-popup .button-loading-indicator .loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

#alie-chat-popup .button-loading-indicator .loading-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes buttonLoadingPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading state for start chat button */
#alie-chat-popup #start-chat.loading {
    pointer-events: none;
    position: relative;
}

/* Ensure button maintains its height during loading */
#alie-chat-popup #start-chat {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#alie-chat-popup .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

#alie-chat-popup .header-buttons {
    display: flex;
    gap: 8px;
}

#alie-chat-popup .chat-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}


#alie-chat-popup .confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#alie-chat-popup .confirm-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#alie-chat-popup .confirm-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
}

#alie-chat-popup .confirm-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#alie-chat-popup #end-chat-yes {
    background: #d9534f;
    color: #fff;
}

#alie-chat-popup #end-chat-no {
    background: #6c757d;
    color: #fff;
}

#alie-chat-popup .reaction-footer {
    display: flex;
    align-items: center;
    justify-content: left;
    position: relative;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: #555;
    /* justify-content: flex-end; */
    width: 100%;
}

#alie-chat-popup .reaction-buttons {
    display: flex;
    /* margin-left: auto; */
    /* push buttons to the right */
}


#alie-chat-popup .reaction-buttons button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 2px;
    border-radius: 4px;
    transition: background 0.2s;
}

#alie-chat-popup .reaction-buttons button:hover {
    background: transparent;
}

#alie-chat-popup .reaction-label {
    font-size: 10px;
    color: #888;
    font-weight: 400;
}

#alie-chat-popup .reaction-buttons button svg {
    width: 15px;
    height: 15px;
    fill: #888;
    transition: fill 0.2s;
}

#alie-chat-popup .reaction-buttons svg {
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
}

#alie-chat-popup .reaction-buttons button.Good:hover svg {
    fill: #0a66c2;
    transform: scale(1.2);
}

#alie-chat-popup .reaction-buttons button.Bad:hover svg {
    fill: #cf0e0e;
    transform: scale(1.2);
}

#alie-chat-popup .reaction-buttons button.Good.selected svg {
    fill: rgb(6 181 1);
    stroke-width: 1px;
    transform: scale(1.2);
}

#alie-chat-popup .reaction-buttons button.Bad.selected svg {
    fill: #cf0e0e;
    stroke-width: 1px;
    transform: scale(1.2);
}

#alie-chat-popup #chat-menu {
    position: relative;
    display: inline-block;
}

#alie-chat-popup .menu-button {
    background: none;
    border: none;
    position: relative;
    top: 3px;
}

#alie-chat-popup .menu-button svg {
    cursor: pointer;
    fill: #fff;
}

#alie-chat-popup .menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    margin-top: 6px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 100;
}

#alie-chat-popup .menu-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    text-align: left;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s;
    border-radius: 6px;
}

#alie-chat-popup .menu-item:hover {
    background: #f5f5f5;
    opacity: 1;
}

#alie-chat-popup .menu-item svg {
    vertical-align: middle;
}

#alie-chat-popup .survey-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    border-radius: 5%;
}

#alie-chat-popup .survey-popup {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#alie-chat-popup .survey-popup p {
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 500;
    color: #333;
}

#alie-chat-popup .survey-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

#alie-chat-popup .survey-option {
    border: none;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    transition: background 0.2s, transform 0.2s;
}

#alie-chat-popup .survey-option:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

#alie-chat-popup .survey-option span {
    font-size: 12px;
    margin-top: 4px;
}

#alie-chat-popup .header-name {
    width: 100%;
    color: #fff;
    font-size: 16px;
    z-index: 11;
    display: flex;
    align-items: center;
    margin-left: 5px;
}

#alie-chat-popup .footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
    margin-bottom: 4px;
}

#alie-chat-popup .toggle-sources {
    border: none;
    background: none;
    color: #888;
    font-weight: 500;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    width: 100%;
    justify-content: flex-end;
}

#alie-chat-popup .sources-toggle {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    padding: 0;
}

#alie-chat-popup .sources-toggle:hover {
    text-decoration: underline;
}

#alie-chat-popup .sources-list {
    display: none;
    text-align: left;
}

/* Source item list */
#alie-chat-popup .source-item {
    margin-bottom: 6px;
}

#alie-chat-popup .source-item a {
    color: #007bff;
    font-weight: 500;
    text-decoration: none;
}

#alie-chat-popup .source-assessment {
    color: #555;
    font-size: 12px;
    margin: 2px 0 0 14px;
}