
.bcw-container {
  --bcw-primary: #4a90e2;
  --bcw-secondary: #f4f7f9;
  --bcw-user-msg: #3498db;
  --bcw-button: rgb(149 100 26);
  --bcw-option-bg: #ffffff;
  --bcw-option-hover: #eef4ff;
  --bcw-option-text: #4a90e2;
  --bcw-bot-msg: #ffffff;
  --bcw-text-dark: #333333;
  --bcw-text-light: #ffffff;
  --bcw-border-color: #e0e0e0;
  --bcw-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --bcw-z-index: 9999;
  position: fixed;
  z-index: var(--bcw-z-index);
  font-family: var(--bcw-font);
}

.bcw-widget {
  position: relative;
}

.bcw-toggle-btn {
  background-color: var(--bcw-button);
  color: var(--bcw-text-light);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: unset;
}

.bcw-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.bcw-toggle-btn:focus {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}
.bcw-toggle-btn.bcw-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.bcw-toggle-btn .bcw-icon-open,
.bcw-toggle-btn.bcw-active .bcw-icon-close {
  display: block;
}

.bcw-toggle-btn .bcw-icon-close,
.bcw-toggle-btn.bcw-active .bcw-icon-open {
  display: none;
}

.bcw-icon-open, .bcw-icon-close {
  width: 28px;
  height: 28px;
}

.bcw-notification {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #bf1212;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.bcw-window {
  position: absolute;
  width: 440px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 100px);
  background-color: var(--bcw-secondary);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  z-index: 1;
  bottom: 30px !important;
}

.bcw-window.bcw-show {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.bcw-header {
  background-color: var(--bcw-primary);
  color: var(--bcw-text-light);
  padding: 15px 20px;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-image: linear-gradient(43deg, rgba(7, 7, 9, 1) 6.5%, rgb(149 100 26) 93.2%);
}

.bcw-header-content {
  flex: 1;
}

.bcw-title {
  margin: 0;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  color: white;
}

.bcw-subtitle {
  margin: 5px 0 0 0 !important;
  font-size: 12px;
  opacity: 0.9;
  line-height: 1.2;
}

.bcw-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
  margin-left: 10px;
}

.bcw-close-btn:hover {
  background: rgba(255,255,255,0.3);
}

.bcw-live-badge {
  display: none; /* Hidden by default */
  background: #00d26a;
  color: white;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  text-transform: uppercase;
  animation: bcw-pulse 2s infinite;
}

.bcw-live-badge.bcw-active {
  display: inline-block; /* Show when active */
}

@keyframes bcw-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.bcw-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: block;
}

.bcw-messages a:link:hover {
    text-decoration-line: underline;}
	
.bcw-messages :is(ol, ul, li) {
    list-style: revert;
    list-style-type: revert;
    padding: revert;
    margin: revert;
}

.bcw-messages ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.bcw-messages ol {
    list-style-type: decimal;
    padding-left: 20px;
    margin: 10px 0;
}

.bcw-messages li {
    margin: 5px 0;
    line-height: 1.6;
}

.bcw-messages ul li {
    list-style-type: disc;
}

.bcw-messages ol li {
    list-style-type: decimal;
}
	
.bcw-message {
  padding: 10px 15px;
  border-radius: 20px;
  margin-bottom: 10px;
  max-width: 80%;
  line-height: 1.4;
  word-wrap: break-word;
  animation: bcwSlideIn 0.3s ease;
  clear: both;
  width: fit-content;  /* ← ADD THIS */
  display: inline-block;  /* ← ADD THIS */
}

@keyframes bcwSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bcw-bot-message {
  background-color: var(--bcw-bot-msg);
  color: var(--bcw-text-dark);
  border: 1px solid var(--bcw-border-color);
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  float: left;  /* ← ADD THIS */
  clear: both;  /* ← ADD THIS */
}

.bcw-user-message {
  background-color: var(--bcw-user-msg);
  color: var(--bcw-text-light);
  align-self: flex-end;
  margin-left: auto;
  border-bottom-right-radius: 5px;
  float: right;  
  clear: both; 
}

.bcw-admin-message {
  background-color: #e8f5e9;
  color: #2e7d32;
  border-left: 3px solid #4caf50;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  float: left;  
  clear: both; 
}

.bcw-admin-badge {
  display: inline-block;
  background: #4caf50;
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  margin-right: 5px;
  text-transform: uppercase;
}

.bcw-status-message {
  text-align: center;
  padding: 8px;
  background: rgb(240 255 235);
  border-left: 3px solid #03a84e;
  margin-bottom: 10px;
  font-size: 12px;
  color: #03a84e;
  border-radius: 4px;
  line-height: 1.5;
  clear: both;  
  float: none;  
  width: 100%;  
  display: block;
}

.bcw-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border-radius: 18px;
  width: fit-content;
  border: 1px solid var(--bcw-border-color);
}

.bcw-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  animation: bcwTyping 1.4s infinite;
}

.bcw-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.bcw-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bcwTyping {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}


.bcw-inline-options {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2px;
  padding: 10px 0;
  animation: bcwSlideIn 0.3s ease;
  clear: both;
  width: 100%;
}

.bcw-inline-options button {
  padding: 6px 6px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  text-align: center;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--bcw-option-bg);
  color: var(--bcw-option-text);
  border: 1px solid var(--bcw-option-text);
  box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  width: auto;
}

.bcw-inline-options button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background-color: var(--bcw-option-hover);
}

.bcw-inline-options button:active {
  transform: translateY(0);
}

.bcw-input-area {
  display: flex;
  padding: 5px 20px;
  border-top: 1px solid var(--bcw-border-color);
  background-color: #fff;
  gap: 10px;
  align-items: center;
}

@media (max-width: 768px) {
  .bcw-input-area {
    padding: 12px 15px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 20px));
  }
}

.bcw-input {
  flex-grow: 1;
  border: 1px solid var(--bcw-border-color);
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 1rem;
  font-family: var(--bcw-font);
  outline: none;
  transition: border-color 0.2s;
  box-shadow: rgba(0, 0, 0, 0.25) 0px 0.0625em 0.0625em, rgba(0, 0, 0, 0.25) 0px 0.125em 0.5em, rgba(255, 255, 255, 0.1) 0px 0px 0px 1px inset;
}

@media (max-width: 768px) {
  .bcw-input {
    font-size: 16px;
    padding: 12px 15px;
  }
}

.bcw-input:focus {
  border-color: var(--bcw-primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.bcw-send-btn {
  background: var(--bcw-button);
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  color: var(--bcw-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, opacity 0.2s;
  flex-shrink: 0;
  padding: unset;
  transform: rotate(45deg);
}

.bcw-send-btn polygon, .bcw-send-btn line, .bcw-icon-open path{stroke: #fff}

@media (max-width: 768px) {
  .bcw-send-btn {
    width: 44px;
    height: 44px;
  }
}

.bcw-send-btn:hover {
  filter: brightness(1.1);
}

.bcw-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.bcw-branding {
  text-align: center;
  padding: 0px 8px 6px;
  font-size: 11px;
  color: #999;
  background: #fff;
}

.bcw-branding a {
  color: var(--bcw-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.bcw-branding a:hover {
  color: var(--bcw-user-msg);
  text-decoration: underline;
}
.bcw-popup-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
}

.bcw-popup-item {
  display: block;
  position: relative;
  width: max-content;
  background-color: white;
  border-radius: 10px;
  padding: 10px;
  box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
  pointer-events: all;
  animation: bcw-fade-in 0.5s forwards;
}
.bcw-popup-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.bcw-popup-item:active {
  transform: translateY(0);
}

.bcw-popup-item p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #000;
  padding-right: 0;
}
.bcw-popup-action {
  position: relative;
  display: block;
  pointer-events: all;
  z-index: 1;
  animation: bcw-fade-in 0.5s forwards;
}

.bcw-popup-action button {
  padding: 6px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--bcw-option-bg);
  color: var(--bcw-option-text);
  border: 1px solid var(--bcw-option-text);
  box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.bcw-popup-action button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
  background-color: var(--bcw-option-hover);
}

.bcw-popup-action button:active {
  transform: translateY(-1px);
}
.bcw-popup-close-all {
  position: relative;
  display: none;
  padding: 1px 6px;
  background: #70757ab5;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.2s;
  pointer-events: all;
  margin-bottom: 10px; 
  order: -1;          
  width: fit-content; 
}

.bcw-popup-close-all:hover {
  background: #70757a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.bcw-popup-close-all:active {
  transform: translateY(0);
}

.bcw-popup-close-all.bcw-show {
  display: block;
}

.bcw-history-btn {
  width: 100%;
  padding: 15px;
  margin-bottom: 10px;
  background: rgb(149 100 26 / 22%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  font-size: 14px;
  color: #000;
  transition: all 0.2s;
  box-shadow: rgba(0, 0, 0, 0.25) 0px 0.0625em 0.0625em, rgba(0, 0, 0, 0.25) 0px 0.125em 0.5em, rgba(255, 255, 255, 0.1) 0px 0px 0px 1px inset;
}

.bcw-history-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.bcw-history-btn.bcw-secondary {
  background: #fff;
}

@keyframes bcw-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bcw-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

@media (max-width: 480px) {
  .bcw-window {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    position: fixed;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  
  .bcw-header {
    border-radius: 0;
    padding-top: max(15px, env(safe-area-inset-top));
  }
}

.bcw-messages::-webkit-scrollbar,
.bcw-options::-webkit-scrollbar {
  width: 6px;
}

.bcw-messages::-webkit-scrollbar-track,
.bcw-options::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.bcw-messages::-webkit-scrollbar-thumb,
.bcw-options::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.bcw-messages::-webkit-scrollbar-thumb:hover,
.bcw-options::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ===========================================
   LINK CARD PREVIEW STYLES
   ============================================ */

.bcw-link-card {
  display: block;
  margin: 10px 0; /* Changed from margin-top only */
  background: white;
  border: 1px solid var(--bcw-border-color);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 100%; /* Ensure it fits container */
}
.bcw-messages a.bcw-link-card {
    text-decoration: none;}
	
.bcw-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.bcw-link-card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
}

.bcw-link-card-content {
  padding: 10px;
}

.bcw-link-card-title {
  margin: 0 0 8px 0;
  font-size: 14px !important;
  font-weight: 600;
  color: var(--bcw-text-dark);
  line-height: 1.4 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bcw-link-card-url {
  margin: 0 0 8px 0;
  font-size: 11px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: unset !important;
}

.bcw-link-card-button {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bcw-primary);
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.bcw-link-card-loading {
  padding: 12px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

.bcw-image-preview {
  display: block;
  margin: 10px 0; /* Changed from margin-top only */
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Add new placeholder style */
.bcw-link-card-placeholder {
  display: block;
  margin: 10px 0;
  min-height: 50px;
}

