/* =============================================
   Variables
   Define theme colors in one place
   ============================================= */
   :root {
    --feature-color: #0073e6;  /* Header & client message background */
    --text-color: white;       /* Primary text color */
    --neutral-color: #F0EDE5;  /* Secondary background */
  }
  
  /* =============================================
     Widget Bar Styles
     Base, horizontal & vertical layouts
     ============================================= */
  #widget-bar {
    background: var(--feature-color);
    border-radius: 5px;
    position: fixed;
    padding: 0;
    margin: 0;
    z-index: 10000;
  }
  
  /* Remove focus outline & set pointer */
  #widget-bar .widget-button,
  #widget-bar .widget-button:focus {
    outline: none !important;
    cursor: pointer;
  }
  
  /* Hide default label (used only in special cases) */
  .acai-widget-label {
    display: none;
  }
  
  /* Common button layout */
  #widget-bar .widget-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  /* Horizontal mode */
  #widget-bar.horizontal {
    bottom: 5px;
    right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
    height: 63px;
    width: auto;
  }
  
  /* Horizontal buttons */
  #widget-bar.horizontal .widget-button {
    flex: 1;
    min-width: 80px;
    max-width: 100px;
    padding: 5px 10px;
    border-left: 1px solid #ccc;
  }
  
  /* Remove left border on the first visible button */
  #widget-bar.horizontal > .widget-button:first-child,
  #widget-bar.horizontal > .widget-button:not([style*="display: none"]):first-child {
    border-left: none !important;
  }
  
  /* If you have a .widget-logo, keep its neighbor’s border */
  #widget-bar.horizontal > .widget-logo + .widget-button {
    border-left: 1px solid #ccc !important;
  }
  
  /* Vertical mode */
  #widget-bar.vertical {
    top: 50%;
    right: 5px !important;
    transform: translateY(-50%);
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0;
  }
  
  /* Vertical buttons */
  #widget-bar.vertical .widget-button {
    width: 100%;
    padding: 4px 0;
    border-top: 1px solid #ccc;
  }
  
  /* (Optional) remove top border on first vertical button */
  /* #widget-bar.vertical .widget-button:first-of-type {
    border-top: none;
  } */
  
  /* Text & icon color in buttons */
  #widget-bar .widget-button .text {
    font-size: 10px;
    font-family: sans-serif;
    font-weight: bold;
    margin-top: -5px;
    color: var(--text-color);
  }
  #widget-bar .icon {
    color: var(--text-color) !important;
  }
  
  /* =============================================
     Chat Window & Wrapper
     Positioning, animation, header
     ============================================= */
  #rasaWebchatWrapper {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100vh;
    background: var(--feature-color);
    overflow: hidden;
    z-index: 100000 !important;
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%);
    border-radius: 0;
    margin: 0;
    padding: 0;
  }
  
  /* Slide‑in variants */
  #rasaWebchatWrapper.open {
    transform: translateX(0);
  }
  #rasaWebchatWrapper.left-slide {
    left: 0;
    right: auto;
    transform: translateX(-100%);
  }
  #rasaWebchatWrapper.left-slide.open {
    transform: translateX(0);
  }
  
  /* Header */
  #chat-header {
    background: var(--feature-color);
    color: var(--text-color);
    padding: 20px 10px 10px;
    font-size: 18px;
    text-align: center;
    font-family: sans-serif;
    position: relative;
  }
  
  /* Content area */
  #rasaWebchatWrapper > #rasaWebchatPro {
    height: calc(100% - 50px);
  }
  #rasaWebchatPro {
    background-color: #fff !important;
  }
  
  /* Hide thumbs feedback */
  .rw-reaction,
  .rw-feedback {
    display: none !important;
  }
  
  /* Ensure messages stack above overlays */
  .rw-messages-container {
    z-index: 3 !important;
    position: relative !important;
  }
  .rw-sender,
  .rw-sender > * {
    position: relative !important;
    z-index: 2;
  }
  
  /* =============================================
     Input & Send Button
     Textarea & circular button
     ============================================= */
  .rw-new-message {
    background-color: var(--neutral-color) !important;
    margin-right: 5px !important;
    flex-grow: 1 !important;
    resize: vertical !important;
    min-height: 60px !important;
    max-height: 200px !important;
    overflow: auto !important;
  }
  
  .rw-send {
    width: 70px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background-color: var(--neutral-color) !important;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  
  /* Icon positioning */
  .rw-conversation-container .rw-send svg {
    margin-left: 5px;
  }
  .rw-conversation-container .rw-send .rw-send-icon,
  .rw-conversation-container .rw-send .rw-send-icon-ready {
    fill: var(--feature-color) !important;
    stroke: var(--feature-color) !important;
  }

  .rw-conversation-container .rw-sender {
    background-color: #ffffff !important;
  }
  
  /* =============================================
     Message Coloring
     Client vs. response bubbles
     ============================================= */
  .rw-conversation-container .rw-message.rw-response,
  .rw-conversation-container .rw-response {
    background-color: var(--neutral-color) !important;
    color: #333 !important;
  }
  .rw-conversation-container .rw-message.rw-client,
  .rw-conversation-container .rw-client {
    background-color: var(--feature-color) !important;
    color: var(--text-color) !important;
  }
  
  /* =============================================
     Email Modal
     Centered popup form
     ============================================= */
  #email-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border: 1px solid #ccc;
    z-index: 10002;
  }
  #email-modal input,
  #email-modal textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
  }
  #email-modal button {
    padding: 8px 12px;
  }
  
  /* =============================================
     Engagement Bubble
     Tooltip‑style helper
     ============================================= */
  .engagement-bubble {
    position: fixed;
    bottom: auto;
    background: var(--feature-color);
    color: var(--text-color);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    width: 280px;
    z-index: 10000;
  }
  .engagement-bubble.hidden {
    display: none;
  }
  .engagement-bubble .bubble-text {
    font-size: 13px;
    font-family: sans-serif;
    margin: 0;
  }
  .engagement-bubble::after {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: var(--feature-color);
    transform: rotate(45deg);
    border-radius: 4px;
  }
  #popup-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 18px;
    color: var(--text-color);
    cursor: pointer;
    z-index: 100000;
  }
  
  /* =============================================
     End‑Chat / New‑Chat Buttons
     Disclaimer & alerts
     ============================================= */
  #legal-disclaimer {
    text-align: center;
    font-size: 11px;
    color: #666;
    padding: 0 10px 10px;
    background: #fff;
  }
  #alert-yes-btn,
  #alert-cancel-btn {
    background-color: var(--feature-color);
    color: var(--text-color);
  }
  
  /* =============================================
     Floating Chat Button
     Always‑visible trigger
     ============================================= */
  /* =============================================
   Floating Chat Button
   Hover brightness effect
   ============================================= */
  #floating-chat-button {
    position: fixed;
    bottom: 5px;
    right: 5px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--feature-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: filter 0.2s ease;
  }

  #floating-chat-button:hover {
    filter: brightness(0.85);
  }

  #floating-chat-button svg {
    width: 28px;
    height: 28px;
    color: var(--text-color);
  }
  
  /* =============================================
     Mobile Overrides (≤768px)
     Full‑width bars & chat
     ============================================= */
  @media only screen and (max-width: 768px) {
    #widget-bar.horizontal {
      bottom: 0;
      left: 0 !important;
      right: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      border-radius: 0 !important;
      justify-content: center !important;
      padding: 0 !important;
    }

    #widget-bar.horizontal .widget-button {
      flex: 1 1 0;
      max-width: 100%;
      min-width: 0;
      padding: 6px 0 !important;
      display: flex !important;
      flex-direction: column;
      align-items: center !important;
      justify-content: center !important;
      border-left: 1px solid #ccc;
    }

    #widget-bar.horizontal .widget-button .icon {
      margin: 0 auto !important;
    }

    #widget-bar.horizontal .widget-button .text {
      font-size: 10px !important;
      text-align: center !important;
      margin-top: -5px;
    }

    /* Optional: kill the logo if you want it to stack better */
    #widget-bar.horizontal .widget-logo {
      display: none;
    }

    #rasaWebchatWrapper {
      width: 100% !important;
      padding-bottom: 50px !important;
    }
  
    /* 2. Center & size the End-Chat alert, and force its buttons into a row with spacing */
    #end-chat-alert {
      width: 90% !important;
      max-width: 360px !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
    }
    #end-chat-alert div:last-child {
      display: flex !important;
      justify-content: center !important;
      gap: 10px !important;
      flex-wrap: wrap;
    }
}

/* Examples of explicit widths */
#widget-bar.horizontal.layout-withlogo-3btn {
  width: 320px;
}
#widget-bar.horizontal.layout-nologo-3btn {
  width: 260px;
}
#widget-bar.horizontal.layout-nologo-2btn {
  width: 190px;
}
#widget-bar.horizontal.layout-nologo-1btn {
  width: 100px;
}

/* WITH LOGO: 3 buttons */
#widget-bar.horizontal.layout-withlogo-3btn {
  width: 420px;
}

/* WITH LOGO: 2 buttons */
#widget-bar.horizontal.layout-withlogo-2btn {
  width: 345px;
}

/* WITH LOGO: 1 button */
#widget-bar.horizontal.layout-withlogo-1btn {
  width: 260px;
}

/* Remove left border only if logo is NOT present */
#widget-bar.horizontal.layout-nologo-3btn .widget-button.first-visible,
#widget-bar.horizontal.layout-nologo-2btn .widget-button.first-visible,
#widget-bar.horizontal.layout-nologo-1btn .widget-button.first-visible {
  border-left: none !important;
}

#logo-attorney {
  font-size: 16px;
}

#logo-connect {
  font-size: 16px;
}

#widget-bar.vertical .widget-logo .logo-attorney {
  padding-top: 4px;
  font-size: 12px;
  line-height: 1.4;
}

#widget-bar.vertical .widget-logo .logo-connect {
  margin-top: -5px;
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.4;
}


#widget-bar.vertical.layout-nologo-3btn .widget-button.first-visible,
#widget-bar.vertical.layout-nologo-2btn .widget-button.first-visible,
#widget-bar.vertical.layout-nologo-1btn .widget-button.first-visible {
  border-top: none !important;
}



.chat-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-bubble-dots {
  position: absolute;
  bottom: 13px;
  display: flex;
  gap: 2px;
}

.chat-bubble-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--feature-color);
  opacity: 0;
  animation: fadeInOut 2.5s infinite ease-in-out;
}

.chat-bubble-dots span:nth-child(1) {
  animation-delay: 0s;
}
.chat-bubble-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.chat-bubble-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  60% { opacity: 1; }
  70% { opacity: 0; }
  100% { opacity: 0; }
}

#widget-bar .widget-logo .logo-attorney,
#widget-bar .widget-logo .logo-connect {
  font-weight: bold !important;
}


/* 1) Make each button carry the bg */
#widget-bar .widget-button {
  background-color: inherit;  /* pulls in var(--feature-color) */
  border-radius: 0;           /* reset any default radius */
  transition: filter 0.2s ease;
  height: 100%;
}

/* 2) Remove extra padding on the bar (if any) so buttons truly hug the edges */
#widget-bar.horizontal {
  padding: 0 !important;
}

/* 3) Add the corner‐radius to the first & last buttons */
#widget-bar.horizontal .widget-button:first-child {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

#widget-bar.horizontal .widget-button:last-child {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* 4) Your existing hover filter still works on the button itself */
#widget-bar .widget-button:hover {
  filter: brightness(0.85);
}


/* Remove extra padding on the bar so buttons hug top/bottom edges */
#widget-bar.vertical {
  padding: 0 !important;
}

/* Inherit bg on each button & reset any radius */
#widget-bar.vertical .widget-button {
  background-color: inherit;
  border-radius: 0;
  transition: filter 0.2s ease;
}

#widget-bar.vertical .widget-button:last-child {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* Hover shade-shift stays the same */
#widget-bar.vertical .widget-button:hover {
  filter: brightness(0.85);
}

/* Remove any padding & gap, and stretch buttons to the very ends */
#widget-bar.vertical {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;  /* pushes first to top, last to bottom */
  gap: 0 !important;
}

/* Make sure buttons themselves don’t have margins */
#widget-bar.vertical .widget-button {
  margin: 0 !important;
}

/* Re-apply corner rounding on first/last buttons */
#widget-bar.vertical .widget-button:first-child {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}
#widget-bar.vertical .widget-button:last-child {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* Close “×” in top-right corner */
.engagement-bubble .bubble-close {
  position: absolute;
  top: -2px;
  right: 5px;
  bottom: auto !important;
  left: auto !important;
  cursor: pointer;
}

#widget-bar.horizontal[class*="layout-nologo"] .widget-button.first-visible {
  border-top-left-radius: 5px !important;
  border-bottom-left-radius: 5px !important;
}

/* Default: Bottom-centered pointer (horizontal mode) */
.engagement-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: var(--pointer-left, 50%);
  transform: translateX(-50%) rotate(45deg);
  width: 20px;
  height: 20px;
  background: var(--feature-color);
  border-radius: 2px;
}

/* In vertical mode: Right-centered pointer (vertical mode) */
.engagement-bubble.vertical::after {
  top: var(--pointer-top, 50%);
  left: auto;
  right: -7px;
  bottom: auto;
  transform: translateY(-50%) rotate(45deg);
}


/* ── Fix vertical corner rounding when no logo & only 1 or 2 buttons ── */

/* 1 button, no logo: round all corners */
#widget-bar.vertical.layout-nologo-1btn .widget-button {
  border-radius: 5px !important;
}

/* 2 buttons, no logo: round top of the first visible */
#widget-bar.vertical.layout-nologo-2btn .widget-button.first-visible {
  border-top-left-radius: 5px !important;
  border-top-right-radius: 5px !important;
}

/* 2 buttons, no logo: round bottom of the last button */
#widget-bar.vertical.layout-nologo-2btn .widget-button:last-child {
  border-bottom-left-radius: 5px !important;
  border-bottom-right-radius: 5px !important;
}
