 /*:root {
    --primary-color: #673de6;
    --primary-color-hover: #673de6; 
    --primary-border-color: #673de6;
}*/

#chat-widget-toggle {
    position: fixed;
    white-space: nowrap;
    height: 50px;
   /* background: var(--primary-color);*/
    border: 1px solid var(--primary-border-color);
    color: #fff;
    padding: 10px 15px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Launcher positions */
.chat-launcher-bottom-right {
    right: 20px;
    bottom: 20px;
}

.chat-launcher-bottom-left {
    left: 20px;
    bottom: 20px;
}

.chat-launcher-top-right {
    right: 20px;
    top: 20px;
}

.chat-launcher-top-left {
    left: 20px;
    top: 20px;
}


 /*.user-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
    margin-bottom: 4px;
    text-align: left;
}*/

/* Mobile-specific styles */
@media screen and (max-width: 768px) {
    /* Chat toggle button */
    #chat-widget-toggle {
        background-color: var(--primary-color);
        color: #ffff; /* white text */
    }
    .bot-message {
     background-color: aliceblue;
     /*align-self: flex-start;*/
     text-align: left;
     color:var(--agent-text-color);
     border: 1px solid var(--primary-border-color);
 }
}
/* MOBILE VIEW - disable stretching */
@media (max-width: 768px) {
    #chat-box {
        width: 100vw;
        max-width: 100vw;
        min-width: auto;
        height: 80vh;
        max-height: 80vh;
        right: 2px;
        bottom: 2px;
        top: 2px;
        left: 0;
        
    }
}

 #chat-box {
     display: none !important;
     position: fixed;
     bottom: 0px;
     right: 0px;
     max-width: 99vw;
     min-width: 300px;
     height:100vh;
     border-radius: 30px;
     background: #fff;
     font-family: Arial, sans-serif;
     font-size: 14px;
     /*border-color:#CBCBCB;*/
     border:solid 1px #fff;
     box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
     z-index: 100000 !important;
     flex-direction: column;
    /* overflow: hidden;*/
     padding:10px;
    /* width: min(420px, 95vw);*/
     box-sizing: border-box;
     /* overflow: auto;    */

 }
 /* Push chat widget below WP admin bar when logged in */
body.admin-bar #chat-box {
  top: 0px ; 
  max-height: calc(100vh - 0px) ;
}

/* Mobile: admin bar is 46px */
@media screen and (max-width: 782px) {
  body.admin-bar #chat-box {
    top: 56px ;
    max-height: calc(100vh - 56px) ;
  }
}
/*#chat-box {
   display: none !important;
    position: fixed;
    bottom: 2px;
    right: 0px;
    top: 2px;
    width: 440px;
    max-width: 99vw;
    min-width: 300px;
    height: 100vh;
    max-height: 100vh;
  
    border-radius: 40px;
    background: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s ease, visibility 0.3s ease;
}*/

/* When visible class is added */
#chat-box.visible {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}
/* Make inner content flexible */
#chat-box .content {
    width: 100%;
     min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px; /* spacing between messages */
}

.chat-subheading {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
}

/* Ensure header can expand if needed */
.top-chat-header > div:nth-child(2) {
    overflow: visible !important;
    flex: 1;
    min-width: 0;
}

.text-send-button {
    flex-shrink: 0 !important;
    min-width: 42px !important;
    width: 42px !important;
    height: 42px !important;
}
#resizeHandle {
  width: 2px;
  cursor: ew-resize; /* horizontal resize */
  background: rgba(0,0,0,0.2);
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
}
/* Chat header safety */
#chat-box > div:first-child {
    position: relative;
    flex-wrap: nowrap;
    overflow: hidden;
}


#close-chat {
    flex-shrink: 0;
     color: #fff !important;
    margin-left: 4px;
}
@media (max-width: 480px) {
    #chat-box {
        width: 95vw;
        right: 2.5vw;
        bottom: 2.5vw;
    }

    #menu-toggle,
    #clear-chat,
    #close-chat {
        font-size: 14px;
        padding: 2px;
        
    }
}

 #chat-box.visible {
     display: flex;
 }


 #chat-scroll-area {
     flex: 1;
     overflow-y: auto;
     display: flex;
     flex-direction: column;
     gap: 10px;
     padding: 12px 10px 0px 12px;
    /* margin-bottom: 10px;*/
 }

 #chat-messages {
     display: flex;
     flex-direction: column;
     /*gap: 5px;*/
 }
/* Force your dropdown to use native styles - prevent other plugins from interfering */
.kalrav-language-select,
#language-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #f9f9ff !important;
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    padding: 0 36px 0 12px !important;
    line-height: 42px !important;

    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    color: #333 !important;
    cursor: pointer !important;
    outline: none !important;
    width: 120px !important;
    height: 42px !important;
    display: block !important;
    transition: all 0.2s ease !important;
    
    /* Prevent other plugins from transforming it */
    background-image: none !important;
    box-shadow: none !important;
    text-transform: none !important;
}
/* Language Dropdown Container */
.kalrav-language {
    position: relative;
    display: inline-block;
}

.kalrav-language-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-color: #f9f9ff;
    border: 1px solid #ccc;
    border-radius: 8px;

    padding: 8px 36px 10px 12px;
    width: 120px;
    height: 42px;

    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #333;

    cursor: pointer;
    outline: none;
    display: block !important;

    box-sizing: border-box; 
    line-height: 1.2;        
    max-width: none;
    transition: all 0.2s ease;
}
/* Row container */
.kalrav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* All buttons */
.kalrav-controls button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
/* Focus State */
.kalrav-language-select:focus {
    border-color: var(--primary-color);
}

/* Hover State */
.kalrav-language-select:hover {
    border-color: #999;
}

/* Custom Dropdown Arrow */
.kalrav-language-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    stroke: #666;
    width: 16px;
    height: 16px;
}

/* Dropdown Options Styling */
.kalrav-language-select option {
    padding: 10px;
    background-color: #fff;
    color: #333;
}

/* Ensure dropdown is always visible when open */
.kalrav-language-select:focus {
    z-index: 9999;
}
/* Prevent Select2, Chosen, or other select libraries from initializing */
.kalrav-language-select.select2-hidden-accessible,
#language-select.select2-hidden-accessible {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
}

/* Hide any wrapper divs created by other plugins */
.kalrav-language + .select2-container,
.kalrav-language + .chosen-container,
#language-select + .select2-container,
#language-select + .chosen-container {
    display: none !important;
}

/* Focus State */
.kalrav-language-select:focus,
#language-select:focus {
    border-color: #673de6 !important;
}
/*#clear-chat-dialog {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.15);
    max-width: calc(100vh - 40px);
    width: 320px;
    z-index: 100;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #222;
    transition: all 0.3s ease-in-out;
    box-sizing: border-box;
}*/

/* Adjust dialog for smaller widget widths */
@media (max-width: 480px) {
    #clear-chat-dialog {
        width: calc(100vh - 40px);
        max-width: 280px;
        padding: 18px;
    }
}

/* When chat box is at minimum width */
#chat-box[style*="width: 440px"] #clear-chat-dialog,
#chat-box[style*="width: 300px"] #clear-chat-dialog {
    width: calc(100vh - 40px);
    max-width: 90%;
    left: 50%;
    right: auto;
}
  .bot-typing {
     margin: 5px 0;
     padding: 8px;
     width: fit-content;
     border: 1px solid var(--primary-border-color);
     border-radius: 10px;
     max-width: 90%;
 }
 .chat-message {
     margin: 5px 0;
     padding: 8px;
     border-radius: 10px;
     max-width: 90%;
 }
/* Bold and italic */
.chat-message.bot-message div strong {
    font-weight: bold;
}

.chat-message.bot-message div b {
    font-weight: bold;
}

.chat-message.bot-message div em {
    font-style: italic;
}

/* Paragraph spacing */
.chat-message.bot-message div p {
    margin: 0 0 12px 0;
    font-size: 15px;
}

/* Lists */
.chat-message.bot-message div ul,
.chat-message.bot-message div ol {
    margin: 0 0 1px 20px;
    padding: 0;
}

.chat-message.bot-message div li {
    margin-bottom: 12px;
}

/* Gap between paragraph and list */
.chat-message.bot-message div p + ul,
.chat-message.bot-message div p + ol {
    margin-top: 8px;
}

/* Gap between list and next paragraph */
.chat-message.bot-message div ul + p,
.chat-message.bot-message div ol + p {
    margin-top: 8px;
}

ul li br:first-child {
  display: none; /* remove the first <br> before text */
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-message.bot-message div a {
    color: #0073aa;
    text-decoration: underline;
}
.chat-message.bot-message div {
    color: var(--agent-text-color);
}
/* Header icon SVG strokes - respect layout_text_color */
#menu-toggle svg path,
#clear-chat svg path,
#close-chat svg path {
    stroke: var(--layout-text-color, #818181);
}

.chat-message.user-message {
    color: var(--user-text-color);
}
 .user-message {
     background-color: #24a7eb;
     align-self: flex-end;
     text-align: left;
     color:var(--user-text-color);
     border: 1px solid var(--primary-border-color); 
     /*box-shadow: 0 2px 6px rgba(0, 115, 170, 0.1);*/
 }

 .bot-message {
     background-color: #fff;
    min-width: fit-content;
     text-align: left;
     color:var(--agent-text-color);
     border: 1px solid var(--primary-border-color);
    /* width: 360;
        height: 248;*/
        opacity: 1;
        border-width: 0.5px;
        padding: 10px;
        gap: 10px;
        border-top-left-radius: 4px;
        border-top-right-radius: 12px;
        border-bottom-right-radius: 12px;
        border-bottom-left-radius: 12px;

 }

 #chat-input {
     width: 100%;
     padding: 8px;
     border: 1px solid #ccc;
     border-radius: 5px;
 }


/* Agent avatar */
.chat-agent-avatar img {
  width: 25px;
  height: 25px !important;
  background:var(--primary-color); 
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 0 3px #ffffff;
}


/* Optional subtle fade-in animation */
/*.chat-intro {
  animation: fadeInIntro 0.5s ease-in-out;
}*/

.confirm-clear-btn:hover {
    background: var(--primary-color);
}
@keyframes fadeInIntro {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/*.chat-time {
    font-size: 11px;
    color: gray;
    margin-bottom: 2px;
    text-align: right; 
}*/
.chat-time {
    font-size: 12px;
    color: #888;
    margin:0;
    margin-top: 4px;
    margin-bottom: 10px;
    text-align: right; 
}
.chat-time-res {
    font-size: 11px;
    color: gray;
    margin-bottom: 2px;
    text-align: left; /* aligns time to right */
}

/*.user-header-response {
    display: flex;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 4px;
    text-align: right;
}*/
.chat-time {
    font-size: 11px;
    color: #888;
}

.chat-message.user-message {
   /* background: #673de6;*/
    color: var(--user-text-color);
    display: inline-block;
    max-width: 90%;
    align-self: flex-end;
    /*width: 63px;
    height: 50px;*/
    margin:0;
    opacity: 1;
    padding:10px;
   /* padding-top: 16px;
    padding-right: 24px;
    padding-bottom: 16px;
    padding-left: 24px;*/
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 12px;

}

 .text-send-button {
    
     border: none;
     height: 40px;
     border-radius: 30px;
     padding: 10px;
     cursor: pointer;
     display: flex;
     background-color: var(--primary-color)!important;
     align-items: center;
     justify-content: center;
     transition: background 0.2s;
 }
.text-send-button{
   
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    background-color: var(--primary-color)!important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
 .text-send-button:hover {
    /* background-color: #20bd5f;*/
     background-color: var(--primary-color-hover)!important;
 }

 #chat-widget-toggle:hover {
     background-color: var(--primary-color-hover);
 }

 .chat-toggle-logo {
     max-width: 30px;
     max-height: 30px;
     border-radius: 50%;
 }
 .bubble-icon-text {
     border-radius: 100px;
     font-size: 14px;
     font-style: normal;
     font-weight: 700;
     justify-content: center;
 }
#voice-output-btn{
    background: transparent; 
    border: none; 
    width: 32px; 
    height: 32px; 
    display: flex;
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    padding: 8px;
    border: 1px solid #CBCBCB;
    border-width: 1px;
    border-radius: 6px;
}
.attachment-btn{
   background: transparent;
    width: 32px;
    height: 32px; 
    border: 1px solid #CBCBCB;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px;
}
.attachment-btn.disabled {
  opacity: 0.5;       /* make it look faded */
  pointer-events: none; /* disable clicks */
  cursor: not-allowed; /* show not-allowed cursor */
  filter: grayscale(100%); /* optional: make it look inactive */
}
.category-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.category-item {
  width: 140px;
  height: 140px;
  border: 1px solid #e0e0e0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.category-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 8px;
}

.category-item div {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Hover effect */
/*.chat-suggestion-btn:hover {
    background-color: #0073aa;
    color: #fff;
    transform: scale(1.05);
}*/
.thumbs-container span {
    font-size: 10px;
    transition: transform 0.1s;
}

.thumbs-container span:hover {
    transform: scale(1.2);
}
.thumbs-container {
    pointer-events: auto;
    display: flex;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 10px;
    align-items: center;
}

 .typing-dots {
  display: inline-flex;
  align-items: center;
  font-style: italic;
  color: #555;
  font-size: 14px;
  gap: 2px;
}

.typing-dots span:nth-child(n+2) {
  opacity: 0;
  animation: blink 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(4) {
  animation-delay: 0.4s;
}
/*#clear-chat.chat-header-icon:focus,
#clear-chat.chat-header-icon:focus-visible {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #fff;
}
#menu-toggle.chat-header-icon:focus,
#menu-toggle.chat-header-icon:focus-visible {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #fff;
}*/
@keyframes blink {
  0%, 20%, 100% { opacity: 0; }
  50% { opacity: 1; }
}


 

 .kalravai-logo-wrapper {
     display: flex;
     align-items: center;
     gap: 10px;
     margin-top: 13px;
 }

 .kalravai-logo-preview {
     width: 30px;
     height: 30px;
     margin-top: 8px;
     border-radius: 50%;
     object-fit: cover;
     vertical-align: middle;
 }

 .custom-logo-upload-icon {
     width: 30px;
     height: 30px;
     background-color: #f0f0f0;
     border: 2px dashed #999;
     border-radius: 50%;
     position: relative;
     cursor: pointer;
     display: inline-block;
     margin-top: 8px;
     vertical-align: middle;
 }

 .custom-logo-upload-icon::before,
 .custom-logo-upload-icon::after {
     content: '';
     position: absolute;
     background-color: #666;
 }

 .custom-logo-upload-icon::before {
     width: 2px;
     height: 16px;
     top: 7px;
     left: 14px;
 }

 .custom-logo-upload-icon::after {
     width: 16px;
     height: 2px;
     top: 14px;
     left: 7px;
 }

 .custom-logo-upload-icon:hover {
     background-color: #e0e0e0;
 }

 .kalravai-logo-wrapper {
     display: flex;
     align-items: center;
     gap: 10px;
     margin-top: 13px;
 }

 .kalravai-logo-preview {
     width: 30px;
     height: 30px;
     margin-top: 8px;
     border-radius: 50%;
     object-fit: cover;
     vertical-align: middle;
 }

 .custom-logo-upload-icon {
     width: 30px;
     height: 30px;
     background-color: #f0f0f0 !important;
     ;
     border: 2px dashed #999 !important;
     ;
     border-radius: 50%;
     position: relative;
     cursor: pointer;
     display: inline-block;
     margin-top: 8px;
     vertical-align: middle;
 }

 .custom-logo-upload-icon::before,
 .custom-logo-upload-icon::after {
     content: '';
     position: absolute;
     background-color: #666;
 }

 .custom-logo-upload-icon::before {
     width: 2px;
     height: 16px;
     top: 7px;
     left: 14px;
 }

 .custom-logo-upload-icon::after {
     width: 16px;
     height: 2px;
     top: 14px;
     left: 7px;
 }

 .custom-logo-upload-icon:hover {
     background-color: #e0e0e0;
 }
 /*theme color selection*/
  .kalravai-color-picker-wrapper {
            max-width: 600px;
        }
        
        .kalravai-color-field {
            width: 200px;
            padding: 5px 10px;
            font-size: 14px;
            border: 1px solid #8c8f94;
            border-radius: 3px;
        }
        
        .kalravai-color-palette {
            margin-top: 20px;
            padding: 15px;
            background: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        
        .kalravai-color-list {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-top: 10px;
        }
        
        .kalravai-color-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }
        
        .kalravai-color-label {
            display: none; /* hide color names */
        }
        
        .kalravai-color-swatch {
            width: 50px;
            height: 50px;
            border: 2px solid #ddd;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .kalravai-color-swatch:hover {
            transform: scale(1.1);
            border-color: #0073aa;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }
        
        .kalravai-color-swatch:active {
            transform: scale(0.95);
        }