/* Salem Food Digest Chatbot Styles - FIXED POSITIONING */

#sfd-chatbot-container {
    position: fixed;
    z-index: 999999;
}

#sfd-chatbot-container.sfd-chatbot-bottom-right { bottom: 20px; right: 20px; }
#sfd-chatbot-container.sfd-chatbot-bottom-left  { bottom: 20px; left: 20px; }

/* Toggle */
#sfd-chatbot-toggle{
    width:60px;height:60px;border-radius:50%;
    background:linear-gradient(135deg,#e63946 0%,#c1121f 100%);
    border:none;box-shadow:0 4px 12px rgba(230,57,70,.4);
    cursor:pointer;display:flex;align-items:center;justify-content:center;
    transition:all .3s ease;
}
#sfd-chatbot-toggle:hover{ transform:scale(1.1); box-shadow:0 6px 16px rgba(230,57,70,.6); }
#sfd-chatbot-toggle svg{ width:28px;height:28px; }

/* Window - FIXED: Increased bottom spacing and adjusted height */
#sfd-chatbot-window{
    position:fixed;
    width:380px;
    height:520px;  /* Slightly reduced to fit better */
    max-height:calc(100vh - 260px);  /* More space for URL bar at top and nav at bottom */
    background:#fff;
    border-radius:16px;
    box-shadow:0 8px 32px rgba(0,0,0,.15);
    display:flex;
    flex-direction:column;
    overflow:hidden;
    animation:slideUp .3s ease;
    top: 120px;  /* Keep away from URL bar */
}
.sfd-chatbot-bottom-right #sfd-chatbot-window{ 
    bottom: 140px;  /* INCREASED from 90px to clear bottom nav */
    right: 20px; 
}
.sfd-chatbot-bottom-left #sfd-chatbot-window{ 
    bottom: 140px;  /* INCREASED from 90px to clear bottom nav */
    left: 20px; 
}

@keyframes slideUp{ from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* Header */
.sfd-chatbot-header{
    padding:20px;color:#fff;display:flex;justify-content:space-between;align-items:center;
}
.sfd-chatbot-header h3{ margin:0;font-size:18px;font-weight:600; }
#sfd-chatbot-close{
    background:none;border:none;color:#fff;font-size:28px;cursor:pointer;padding:0;
    width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;
    transition:background .2s;
}
#sfd-chatbot-close:hover{ background:rgba(255,255,255,.2); }

/* Messages */
.sfd-chatbot-messages{
    flex:1;overflow-y:auto;padding:20px;background:#f8f9fa;
}
.sfd-chat-message{ margin-bottom:16px;display:flex;animation:fadeIn .3s ease; }
@keyframes fadeIn{ from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.sfd-chat-message.bot{ justify-content:flex-start; }
.sfd-chat-message.user{ justify-content:flex-end; }

.sfd-message-bubble{
    max-width:75%;
    padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.5;word-wrap:break-word;
}
.sfd-chat-message.bot  .sfd-message-bubble{
    background:#fff;color:#333;border-bottom-left-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.1);
}
.sfd-chat-message.user .sfd-message-bubble{
    background:#e63946;color:#fff;border-bottom-right-radius:4px;
}
.sfd-message-bubble a{ color:inherit;text-decoration:underline;font-weight:500; }
.sfd-message-bubble strong{ font-weight:600; }

/* Footer quick replies (legacy) — hidden but logic intact */
.sfd-chatbot-quick-replies{ display:none !important; }

/* Input */
.sfd-chatbot-input-area{
    padding:16px 20px;background:#fff;border-top:1px solid #e0e0e0;display:flex;gap:10px;
}
#sfd-chatbot-input{
    flex:1;padding:12px 16px;border:1px solid #ddd;border-radius:24px;font-size:14px;outline:none;transition:border-color .2s;
}
#sfd-chatbot-input:focus{ border-color:#e63946; }
/* === Send button: white pill with arrow like original === */
#sfd-chatbot-send{
  /* pill look */
  width: auto !important;
  height: auto !important;
  padding: 10px 16px !important;
  border: 1.5px solid #dedede !important;
  border-radius: 9999px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.06) !important;

  /* layout */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  
  /* text styling */
  color: #111 !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  
  cursor: pointer !important;
  transition: none !important;
  outline: none !important;
}

/* Style the arrow icon inside send button */
#sfd-chatbot-send svg{
  width: 16px !important;
  height: 16px !important;
  stroke: #111 !important;
  flex-shrink: 0 !important;
}

/* keep appearance identical on hover/focus (no color flip) */
#sfd-chatbot-send:hover,
#sfd-chatbot-send:focus,
#sfd-chatbot-send:active{
  background: #fff !important;
  color: #111 !important;
  border-color: #dedede !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.06) !important;
  outline: none !important;
}

#sfd-chatbot-send:disabled{ 
  opacity: .5 !important;
  cursor: not-allowed !important;
}

/* Typing */
.sfd-typing-indicator{ display:flex;gap:4px;padding:12px 16px; }
.sfd-typing-dot{ width:8px;height:8px;background:#999;border-radius:50%;animation:typing 1.4s infinite; }
.sfd-typing-dot:nth-child(2){ animation-delay:.2s; }
.sfd-typing-dot:nth-child(3){ animation-delay:.4s; }
@keyframes typing{ 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-10px)} }

/* Scrollbar */
.sfd-chatbot-messages::-webkit-scrollbar{ width:6px; }
.sfd-chatbot-messages::-webkit-scrollbar-track{ background:#f1f1f1; }
.sfd-chatbot-messages::-webkit-scrollbar-thumb{ background:#888;border-radius:3px; }
.sfd-chatbot-messages::-webkit-scrollbar-thumb:hover{ background:#555; }

/* Mobile - FIXED: Better spacing for mobile devices */
@media (max-width:480px){
    #sfd-chatbot-window{ 
        width:calc(100vw - 40px);
        height:calc(100vh - 280px);  /* More space for URL bar and bottom nav */
        max-height:calc(100vh - 280px);  /* Consistent with height */
        top: 110px;  /* Keep below URL bar on mobile */
    }
    .sfd-chatbot-bottom-right #sfd-chatbot-window,
    .sfd-chatbot-bottom-left #sfd-chatbot-window{ 
        left:20px;
        right:20px;
        bottom:140px;  /* INCREASED from 90px for mobile too */
    }
    .sfd-message-bubble{ max-width:85%; }
}

/* =========================
   OPTIONS = sketch-like pills
   ========================= */

/* Make the white background that contains the three pills a bit wider */
.sfd-message-bubble.sfd-options-bubble,
.sfd-chat-message.bot .sfd-message-bubble:has(.sfd-choice-list){
    max-width:96%;
}
@media (max-width:480px){
    .sfd-message-bubble.sfd-options-bubble,
    .sfd-chat-message.bot .sfd-message-bubble:has(.sfd-choice-list){ max-width:100%; }
}

/* Title above the pills */
.sfd-choice-lead{
    margin-bottom:10px;
    font-size:12px;
    line-height:1.4;
    letter-spacing:.2px;
    color:#6b7280;
    font-weight:600;
    text-transform:uppercase;
}

/* Stack the three options with good breathing room */
.sfd-choice-list{ display:flex;flex-direction:column;gap:12px; }

/* The pill itself — tuned to match your sketch:
   - full pill radius
   - comfy horizontal padding
   - natural word wrapping
   - no hover color flip
*/
.sfd-option-btn{
    display:block;width:100%;text-align:left;
    padding:10px 18px;
    border:1.5px solid #dedede;
    border-radius:9999px;
    background:#fff;color:#111;
    box-shadow:0 1px 2px rgba(0,0,0,.06);

    font-family:inherit;
    font-size:15px;
    font-weight:500;
    line-height:1.45;
    letter-spacing:0;           /* remove odd tracking */
    word-spacing:0;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;

    white-space:normal;
    overflow-wrap:anywhere;     /* avoid awkward overflow */
    word-break:normal;
    hyphens:auto;

    transition:none;
    outline:none;
}

/* Keep look identical on interaction (no red) */
.sfd-option-btn:hover,
.sfd-option-btn:focus,
.sfd-option-btn:active{
    background:#fff;color:#111;border-color:#dedede;box-shadow:0 1px 2px rgba(0,0,0,.06);
}

/* Slightly smaller on very narrow phones */
@media (max-width:380px){
    .sfd-option-btn{ font-size:14px;padding:9px 16px; }
}
/* === FINAL pill tuning — round edges + edge-to-edge text === */

/* Make the options bubble wider so pills don't wrap awkwardly */
.sfd-options-bubble { max-width: 96% !important; border-radius: 16px !important; }
@media (max-width: 480px) { .sfd-options-bubble { max-width: 100% !important; } }

/* The three options as perfect pills, with text starting at the very edge */
.sfd-option-btn{
  display: block !important;
  width: 100% !important;
  text-align: center !important;

  /* edge-to-edge feel: tiny left padding only */
  padding: 10px 12px 10px 6px !important;  /* left=6px */
  margin: 0 !important;

  /* full pill */
  border-radius: 9999px !important;
  border: 1.5px solid #dedede !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.06) !important;

  /* clean typography; kill theme overrides */
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  word-spacing: 0 !important;
  text-transform: none !important;
  text-indent: 0 !important;

  /* natural wrapping with no weird breaks */
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  hyphens: auto !important;

  /* no hover color flips */
  transition: none !important;
  outline: none !important;
}

/* remove any pseudo-element padding some themes inject on buttons */
.sfd-option-btn::before,
.sfd-option-btn::after { content: none !important; }

/* keep identical look on interaction */
.sfd-option-btn:hover,
.sfd-option-btn:focus,
.sfd-option-btn:active{
  background: #fff !important;
  color: #111 !important;
  border-color: #dedede !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.06) !important;
}


/* ===== Chat toggle: blue squircle with white chat icon (like image #1) ===== */

/* easy-to-tweak color */
:root { --sfd-toggle-bg: #3B6EF6; } /* pick any blue you like */

#sfd-chatbot-toggle{
  width: 56px !important;
  height: 56px !important;
  border-radius: 20px !important;          /* squircle/pill-square */
  background: var(--sfd-toggle-bg) !important;
  border: none !important;
  box-shadow: 0 8px 18px rgba(59, 110, 246, 0.35) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform .18s ease, box-shadow .18s ease !important;

  /* ensure we override the old red gradient */
  background-image: none !important;
}

#sfd-chatbot-toggle:hover{
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 10px 22px rgba(59, 110, 246, 0.42) !important;
}

#sfd-chatbot-toggle:active{
  transform: translateY(0) scale(0.99) !important;
  box-shadow: 0 6px 14px rgba(59, 110, 246, 0.28) !important;
}

#sfd-chatbot-toggle:focus{
  outline: none !important;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.9),
    0 0 0 6px rgba(59,110,246,.4),
    0 8px 18px rgba(59,110,246,.35) !important;
}

/* Make the icon smaller and white, like the sample */
#sfd-chatbot-toggle svg{
  width: 24px !important;
  height: 24px !important;
}
#sfd-chatbot-toggle svg path{
  fill: #fff !important;       /* white outline icon */
}

/* Optional: when the window is open, keep the launcher hidden (just in case) */
#sfd-chatbot-window[style*="display: block"] ~ #sfd-chatbot-toggle { display: none !important; }
/* === Force white chat icon inside the blue launcher === */
#sfd-chatbot-toggle{
  position: relative !important;
}

/* Hide whatever inline SVG the theme/plugin had */
#sfd-chatbot-toggle svg{ display: none !important; }

/* Draw our own white chat icon centered in the button */
#sfd-chatbot-toggle::before{
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 24px; height: 24px;
  transform: translate(-50%, -50%);
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E");
}
/* ===== Neighborhood chips ===== */

/* ===== Neighborhood chip grid (2 per row) — match main pill style ===== */

/* Chip container as a flexible grid */
.sfd-chip-wrap{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;                 /* same gap as option pills */
  padding: 10px 12px;
  max-width: 96%;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* Each chip looks like the main white pill buttons */
.sfd-chip{
  flex: 1 1 calc(50% - 12px);     /* two per row (subtract gap) */
  max-width: calc(50% - 12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 10px 14px;
  border: 1.5px solid #dedede;
  border-radius: 9999px;          /* full pill */
  background: #fff;
  color: #111;

  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: normal;            /* allow wrapping on long names */
  overflow-wrap: anywhere;

  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  cursor: pointer;
  transition: none;               /* keep calm */
}

/* keep the same look on hover/focus/active — no color flip */
.sfd-chip:hover,
.sfd-chip:focus,
.sfd-chip:active{
  background:#fff;
  color:#111;
  border-color:#dedede;
  box-shadow:0 1px 2px rgba(0,0,0,.08);
  outline: none;
}

/* Tiny screens: fall back to one per row for readability */
@media (max-width: 420px){
  .sfd-chip{
    flex: 1 1 100%;
    max-width: 100%;
    padding: 9px 12px;
    font-size: 13.5px;
  }
}
/* ===== Neighborhood chips ===== */

/* The bubble that holds the chips */
.sfd-chip-wrap{
  max-width: 96%;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* Make the chips wrap onto multiple lines neatly */
.sfd-chip-wrap{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
}

/* The chip itself: small pill button */
.sfd-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #dedede;
  border-radius: 9999px;                 /* full pill */
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: none;                      /* no color flip */
}

/* Keep appearance calm on interactions */
.sfd-chip:hover,
.sfd-chip:focus,
.sfd-chip:active{
  background: #fff;
  color: #111;
  border-color: #dedede;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  outline: none;
}

/* Compact on very small screens */
@media (max-width: 380px){
  .sfd-chip{ font-size: 12.5px; padding: 5px 10px; }
}
/* === CHIPS: match .sfd-option-btn look & feel + 2 per row === */

/* chip container */
.sfd-chip-wrap{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:12px !important;
  padding:10px 12px !important;
  max-width:96% !important;
  background:#fff !important;
  border:1px solid #eee !important;
  border-radius:16px !important;
  box-shadow:0 1px 2px rgba(0,0,0,.06) !important;
}

/* chips themselves — clone of .sfd-option-btn with grid sizing */
.sfd-chip{
  flex:1 1 calc(50% - 12px) !important;   /* 2 per row */
  max-width:calc(50% - 12px) !important;
  display:block !important;
  text-align:center !important;

  /* edge-to-edge feel */
  padding:10px 12px 10px 6px !important;  /* left=6px */
  margin:0 !important;

  /* full pill */
  border-radius:9999px !important;
  border:1.5px solid #dedede !important;
  background:#fff !important;
  box-shadow:0 1px 2px rgba(0,0,0,.06) !important;

  /* same type as option buttons */
  color:#111 !important;
  font-family:inherit !important;
  font-size:15px !important;
  font-weight:500 !important;
  line-height:1.4 !important;
  letter-spacing:0 !important;
  word-spacing:0 !important;
  text-transform:none !important;
  text-indent:0 !important;

  /* natural wrapping */
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  hyphens:auto !important;

  cursor:pointer !important;
  transition:none !important;
  outline:none !important;
}

/* identical look on interaction */
.sfd-chip:hover,
.sfd-chip:focus,
.sfd-chip:active{
  background:#fff !important;
  color:#111 !important;
  border-color:#dedede !important;
  box-shadow:0 1px 2px rgba(0,0,0,.06) !important;
}

/* tiny screens = 1 per row for readability */
@media (max-width:420px){
  .sfd-chip{
    flex:1 1 100% !important;
    max-width:100% !important;
    font-size:13.5px !important;
    padding:9px 12px 9px 6px !important;
  }
}