html {
    height: 100%;
    background: rgba(0, 0, 0, 0);
}

body {
    background: rgba(0, 0, 0, 0);
    height: 100%;
    width: 100%;
    font-family: Montserrat, sans-serif;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    padding-bottom: 1px;
    min-height: 300px;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
@media only screen and (max-width: 480px) {
    #ai_text_me {
        width: 100%;
    }
}

#ai_text_me {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0);
}

#ai_text_me_form.opening {
    animation: formOpening ease-in-out .4s;
    animation-iteration-count: 1;
}

#ai_text_me_form.closing {
    animation: formClosing ease-in-out .5s;
    animation-iteration-count: 1;
}
.hide {
    display: none;
}
#ai_text_me_form {
    position: relative;
    width: 100%;
    margin: 15px 15px 80px 15px;
    outline: none;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .25);
    max-height: calc(100vh - 80px);
    overflow: auto;
    -webkit-box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .25);
    -moz-box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .25);
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

input:not([type=checkbox]),
textarea {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

#header_title {
    background-image: linear-gradient(140deg, #2d1969, #7e5588);
    cursor: pointer;
    font-size: 18px;
    font-weight: 800 !important;
    color: #fff;
    font-family: Montserrat, Helvetica, sans-serif;
    z-index: 2;
    text-align: left;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    padding: 25px 12px 0 18px;
    height: 50px;
    line-height: 1.4;
}

#header_title .inner {
    position: relative;
    z-index: 2;
}

img {
    max-height: 100%;
    margin-right: 7px;
}

#close_button {
    position: relative;
    float: right;
    padding-left: 10px;
}

#close_button span {
    font-size: 20px;
    z-index: 2;
    margin-right: 0;
}



#close_button_icon {
    padding: 5px;
    font-size: 40px !important;
    line-height: 24px;
    font-weight: 300;
    background-color: transparent;
    color: white;
    border: 0;
    cursor: pointer;
}
button:focus,
input:focus,
textarea:focus,
[tabindex]:focus {
  outline: 3px solid #cc77eb;
  outline-offset: 1px;
}

#close_button_icon:focus,
#close_button_icon:focus-visible {
  outline: 3px solid #cc77eb;   /* high-contrast blue */
  outline-offset: 3px;
  border-radius: 4px;
}

#header_title:after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 75px;
    z-index: 1;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    background: linear-gradient(155deg, rgba(19, 130, 65, 0) 0%, rgba(0, 0, 0, 0.2) 100%);
}

#ai_text_me_fields.opening {
    animation: formOpeningA ease-out .8s;
    animation-iteration-count: 1;
}

#ai_text_me_fields {
    padding: 15px;
}

input[type=text],
input[type=tel],
input[type=email],
textarea {
    display: block;
    font-family: Montserrat, Helvetica, sans-serif;
    font-size: 16px;
    background-color: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    color: #000;
    padding: 9px 13px;
    margin-bottom: 5px;
    width: 100%;
    box-sizing: border-box;
    font-weight: 800 !important;
}

#ai_text_me_fields input[type=text],
#ai_text_me_fields input[type=tel],
#ai_text_me_fields input[type=email],
#ai_text_me_fields textarea {
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600 !important;
    height: 45px;
}

#ai_text_me_fields input[type=text],
#ai_text_me_fields input[type=tel],
#ai_text_me_fields input[type=email],
#ai_text_me_fields textarea {
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600 !important;
    height: 45px;
}

#ai_text_me_fields textarea {
    height: 80px;
}

textarea {
    font-size: 16px;
    height: 65px;
    resize: none;
}

#agree_terms {
    display: flex;
    flex-direction: row;
}

#agree_terms input[type=checkbox] {
    margin-right: 5px;
}

#agree_terms_content {
    max-width: 350px;
    font-family: Montserrat, sans-serif;
    font-size: 12px;
    margin-left: 4px;
    line-height: 17px;
}

#agree_terms_content p {
    margin: 0;
    font-weight: 500;
}

.text_me_button {
    background-color: #cc77eb;
    background-image: linear-gradient(150deg, #6323c6, #0000);
    font-family: Montserrat, sans-serif;
    cursor: pointer;
    border: none;
    height: 42px;
    width: 100%;
    font-size: 18px;
    color: #fff;
    border-radius: 100px;
    margin: 10px 0 0;
    font-weight: 600 !important;
}

.text_me_button[disabled] {
    opacity: .5;
}

#powered_by {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3px 0 10px 0;
    color: #452c6a;
    font-size: 15px;
    font-weight: bold;
}

#powered_by a {
    text-decoration: none;
    color: #452c6a;
    font-size: 15px;
    font-weight: bold;
}

#powered_by img {
    margin-right: 5px;
}

#logo-img {
    width: 125px;
}

#popout-section {
    width: 100%;
    height: 64px;
    position: absolute;
    right: 0;
    bottom: 0px;
}

#popout-section.opened #popout {
    display: none;
}

#revealer {
    background: transparent;
    border: none;
    overflow: hidden;
    position: absolute;
    right: 6px;
    top: 0px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60px;
    width: 60px;
    padding: 5px;
    animation: 1.2s buttonRender ease-in-out;
}

#revealer.circle {
    border-radius: 500px;
}

#revealer .main-btn {
    /* max-width: 50px; */
    animation: .4s revealerIn ease-in;
    position: absolute;
    margin: auto;
}

#revealer.opened {
    background: #2d1969;
}

#revealer.opened:hover {
    background: #2d1969d9;
}

#revealer.opened .main-btn {
    max-width: 50px;
    animation: .4s revealerOut ease-in;
    opacity: 0;
}

#revealer .close-btn {
    max-width: 55px;
    animation: .4s revealerOut ease-in;
    opacity: 0;
    color: #fff;
    font-size: 40px;
    padding-bottom: 0px;
}

#revealer.opened .close-btn {
    max-width: 50px;
    animation: .4s revealerIn ease-in;
    opacity: 1;
}

#revealer .close-btn {
    opacity: 0;
}

#revealer.circle:after {
    border-radius: 500px;
}

#revealer:after {
    content: " ";
    display: inline-block;
    background: #000;
    position: absolute;
    opacity: 0;
    z-index: 1;
    height: 66px;
    width: 66px;
    padding: 5px;
    right: 1px;
}

.form-group {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-left: -15px;
    margin-right: -15px;
    margin-bottom: 15px;
}

.form-group>label {
    width: 32%;
}

.form-group>input {
    width: 60%;
}

#popout.opening {
    animation: openingPopout linear .1s;
    animation-iteration-count: 1;
    -moz-animation: openingPopout linear .1s;
    -moz-animation-iteration-count: 1;
    -webkit-animation: openingPopout linear .1s;
    -webkit-animation-iteration-count: 1;
    -o-animation: openingPopout linear .1s;
    -o-animation-iteration-count: 1;
    -ms-animation: openingPopout linear .1s;
    -ms-animation-iteration-count: 1;
}
#popout {
    position: absolute;
    right: 95px;
    font-family: Montserrat, Helvetica, sans-serif;
}

.arrow-box {
    cursor: pointer;
    position: relative;
    padding: 10px 10px 8px;
    font-size: 15px;
    color: #000;
    background: #fff;
    text-align: center;
    line-height: 1.25;
    margin-left: 5px;
    border-radius: 500px;
    animation: showArrowBox 1s ease-in-out;
    transform-origin: bottom right;
    box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, .3);
    -webkit-box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, .3);
    -moz-box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, .3);
}
#tooltip_box{
    background: transparent;
    border: none;
    cursor: pointer;
}

#close-popout {
    display: block;
    position: absolute;
    top: -5px;
    right: -3px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 500px;
    color: #fff;
    background-color: rgba(0, 0, 0, 1);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.has-error{
    border-color: #c12327 !important;
}

@keyframes revealerIn {
  from {
    opacity: 0;
    transform: rotate(270deg) scale(0.5);
  }

  to {
    opacity: 1;
    transform: rotate(0deg);
  }
}

@keyframes formClosing{
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  75% {
    opacity: 0;
    transform: translate3d(0, 10%, 0);
  }

  100% {
    opacity: 0;
  }
}

@keyframes formOpening {
  from {
    opacity: 0;
    transform: translate3d(0, 10%, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes openingPopout {
  0% {
    opacity: 0;
    transform: translate(50px, 0px) scale(0.5);
  }

  100% {
    opacity: 1;
    transform: translate(0px, 0px);
  }
}

@-moz-keyframes openingPopout {
  0% {
    opacity: 0;
    -moz-transform: translate(50px, 0px) scale(0.5);
  }

  100% {
    opacity: 1;
    -moz-transform: translate(0px, 0px);
  }
}

@-webkit-keyframes openingPopout {
  0% {
    opacity: 0;
    -webkit-transform: translate(50px, 0px) scaleX(0.5);
  }

  100% {
    opacity: 1;
    -webkit-transform: translate(0px, 0px);
  }
}

@-o-keyframes openingPopout {
  0% {
    opacity: 0;
    -o-transform: translate(50px, 0px) scaleX(0.5);
  }

  100% {
    opacity: 1;
    -o-transform: translate(0px, 0px);
  }
}

@-ms-keyframes openingPopout {
  0% {
    opacity: 0;
    -ms-transform: translate(50px, 0px) scaleX(0.5);
  }

  100% {
    opacity: 1;
    -ms-transform: translate(0px, 0px);
  }
}

/* =========================
   Live Chat Styles
========================= */

.chat-header {
    background: linear-gradient(135deg, #f8f8f8, #ffffff);
    border-bottom: 1px solid #e0e0e0;
}

#exit-chat-button {
    transition: all 0.3s ease;
}

#exit-chat-button:hover {
    background-color: #6323c6 !important;
    color: white !important;
}

#exit-chat-button:focus {
    outline: 3px solid #cc77eb;
    outline-offset: 2px;
}

#live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #fafafa;
    min-height: 300px;
    max-height: 350px;
    display: flex;
    flex-direction: column;
}

/* Message wrapper for consistent layout */
.message-wrapper {
    display: flex;
    margin-bottom: 16px;
    width: 100%;
}

/* User message wrapper - aligns to the right */
.user-message-wrapper {
    justify-content: flex-end;
}

/* Bot message wrapper - aligns to the left */
.bot-message-wrapper {
    justify-content: flex-start;
}

/* Message content container */
.message-content {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

/* Message bubble styling */
.message-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 4px;
}

.user-msg {    
    background: #e9e9eb;
    color: #000;
    border-bottom-right-radius: 5px;
}

.ai-msg {
    background: linear-gradient(135deg, #6323c6, #7e5588);
    color: #fff;
    border-bottom-left-radius: 5px;
}

/* Timestamp styling */
.message-timestamp {
    font-size: 10px;
    color: #999;
    text-align: right;
    padding: 0 5px;
    opacity: 0.8;
}

.bot-message-wrapper .message-timestamp {
    text-align: left;
}

/* Bot avatar styling */
.bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
    border: 2px solid #6323c6;
    background: white;
    align-self: flex-end;
}

/* Empty avatar placeholder for user messages (for spacing) */
.avatar-placeholder {
    width: 32px;
    height: 32px;
    margin-left: 8px;
}

/* System messages */
.system-msg {
    text-align: center;
    font-size: 12px;
    margin: 8px 0;
    font-style: italic;
    align-self: center;
    background: transparent;
    box-shadow: none;
    padding: 4px 10px;
    border-radius: 20px;
}

.system-msg.info {
    color: #666;
    background: #f0f0f0;
}

.system-msg.success {
    color: #2d1969;
    background: #e6e0f5;
}

.system-msg.error {
    color: #c12327;
    background: #ffe6e6;
}

.live-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e5e5e5;
    background: #fff;
}

#live-chat-message {
    flex: 1;
    min-height: 20px;
    max-height: 80px;
    resize: none;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #d4d4d4;
    font-family: Montserrat, sans-serif;
    font-weight: normal !important; 
    transition: all 0.3s ease;
    line-height: 1.4;
}

#live-chat-message:focus {
    border-color: #cc77eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(204, 119, 235, 0.2);
}

#live-chat-message::placeholder {
    color: #999;
    /* font-style: italic; */
}

#live-chat-send {
    height: 40px;
    padding: 0 25px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #6323c6, #7e5588);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
    font-size: 14px;
    letter-spacing: 0.5px;
}

#live-chat-send:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 35, 198, 0.3);
}

#live-chat-send:active {
    transform: translateY(0);
}

#live-chat-send:focus {
    outline: 3px solid #cc77eb;
    outline-offset: 2px;
}

#live-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Typing Animation - FIXED FOR 3 DOTS */
.typing-animation {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px !important;
    background: #e9e9eb !important;
    min-width: 40px;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-animation span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-animation span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-animation span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingBounce {
    0%, 80%, 100% { 
        transform: scale(0.6);
        opacity: 0.6;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Message appear animation */
@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-wrapper {
    animation: messageAppear 0.3s ease-out;
}

/* Scrollbar styling */
#live-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#live-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#live-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

#live-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Make message text selectable */
.selectable-text {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.chat-link {
    color: #40a0ff;
    text-decoration: underline;
    word-break: break-all;
}

.chat-link:hover {
    color: #004499;
}

.chat-phone {
    color: #40a0ff;
    text-decoration: underline;
    cursor: pointer;
}

.chat-phone:hover {
    color: #004499;
}

/* Ensure links in user messages are visible */
.user-msg .chat-link,
.user-msg .chat-phone {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.7);
}

.user-msg .chat-link:hover,
.user-msg .chat-phone:hover {
    color: #ffffff;
    text-decoration-color: #ffffff;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.copy-message-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.copy-message-btn:hover {
    background: #f0f0f0;
    color: #6323c6;
}

.bot-message-wrapper .copy-message-btn:hover {
    background: #d0d0d0;
}

/* =========================
   Resizable Chat Styles
========================= */

#live-chat-container {
    display: none;
    position: relative;
    width: 360px;
    min-width: 300px;
    max-width: 1200px;
    max-height: 500px;
    border-radius: 10px;
    background: #fff;
    flex-direction: column;
    overflow: hidden;
    font-family: Montserrat, sans-serif;
}

/* Resize Zone */
.resize-zone {
    position: absolute;
    left: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    z-index: 1000;
    background: transparent;
}

.resize-zone:hover {
    background: rgba(99, 35, 198, 0.05);
}

/* Body class during resize */
body.resizing-chat {
    cursor: ew-resize !important;
}

body.resizing-chat * {
    cursor: ew-resize !important;
    user-select: none !important;
}

/* Responsive design */
@media (max-width: 600px) {
    .resize-zone {
        display: none;
    }
    
    #live-chat-container {
        width: calc(100% - 40px) !important;
        min-width: 280px;
        max-width: 100%;
        margin: 0 20px;
    }
}

@media (max-width: 480px) {
    #live-chat-container {
        max-height: 400px;
    }
    
    #live-chat-messages {
        max-height: 280px;
    }
    
    #live-chat-send {
        padding: 0 15px;
    }
}

.has-error {
    border-color: #d32f2f !important;
    background-color: #fff8f8 !important;
}

.has-error:focus {
    border-color: #d32f2f !important;
    outline: 2px solid #ffcdd2 !important;
    outline-offset: 2px;
}

.error-panel {
    margin-bottom: 15px;
    border-radius: 4px;
}

.error-label {
    display: none;
    padding: 12px 15px;
    background-color: #ffebee;
    border-left: 4px solid #d32f2f;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #d32f2f;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    word-break: break-word;
    width: 100%;
    max-width: 380px;
}

.error-label:not(:empty) {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.success-panel {
    margin-bottom: 15px;
    border-radius: 4px;
}

.success-label {
    display: none;
    padding: 12px 15px;
    background-color: #e8f5e9;
    border-left: 4px solid #388e3c;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #388e3c;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    word-break: break-word;
    width: 100%;
    max-width: 380px;
}

.success-label:not(:empty) {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.phone-format-helper {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}