:root {
  --wsb-bg: #25D366;
  --wsb-icon: #fff;
  --wsb-hover: #128C7E;
  --wsb-z-index: 9999;
}

#wsb-button-root {
  position: fixed;
  z-index: var(--wsb-z-index);
  font-family: sans-serif;
  line-height: 1;
  display: none; /* Hidden initially, shown via JS after delay */
}

/* Visibility Classes */
@media (max-width: 768px) {
  .wsb-hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .wsb-hide-desktop { display: none !important; }
}

/* Button Base */
.wsb-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--wsb-bg);
  color: var(--wsb-icon);
  width: 60px;
  height: 60px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  text-decoration: none;
}
.wsb-button:hover {
  background-color: var(--wsb-hover);
  transform: scale(1.05);
}
.wsb-button svg, .wsb-button img {
  width: 32px;
  height: 32px;
  fill: var(--wsb-icon);
}

/* Shapes */
.wsb-circle .wsb-button { border-radius: 50%; }
.wsb-rounded-square .wsb-button { border-radius: 12px; }
.wsb-full-width .wsb-button { width: 100%; border-radius: 0; height: 50px; }
.wsb-full-width #wsb-button-root { width: 100%; left: 0; right: 0; }

/* Sizes */
.wsb-size-small .wsb-button { width: 45px; height: 45px; }
.wsb-size-small .wsb-button svg { width: 24px; height: 24px; }
.wsb-size-large .wsb-button { width: 75px; height: 75px; }
.wsb-size-large .wsb-button svg { width: 40px; height: 40px; }
/* Override size for full width */
.wsb-shape-full-width .wsb-button { width: 100% !important; height: 50px !important; }


/* Positions */
.wsb-bottom-right { bottom: 20px; right: 20px; }
.wsb-bottom-left { bottom: 20px; left: 20px; }
.wsb-top-right { top: 20px; right: 20px; }
.wsb-top-left { top: 20px; left: 20px; }
.wsb-top-center { top: 20px; left: 50%; transform: translateX(-50%); }
.wsb-bottom-center { bottom: 20px; left: 50%; transform: translateX(-50%); }
.wsb-center-right { top: 50%; right: 20px; transform: translateY(-50%); }
.wsb-center-left { top: 50%; left: 20px; transform: translateY(-50%); }

/* Full Width Positions */
.wsb-full-top { top: 0; left: 0; right: 0; width: 100%; }
.wsb-full-bottom { bottom: 0; left: 0; right: 0; width: 100%; }
.wsb-full-top .wsb-button, .wsb-full-bottom .wsb-button { width: 100%; border-radius: 0; }


/* Animations */
@keyframes wsb-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wsb-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes wsb-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

.wsb-anim-fade-in { animation: wsb-fade-in 0.5s ease-out forwards; }
.wsb-anim-slide-up { animation: wsb-slide-up 0.5s ease-out forwards; }
.wsb-anim-pulse .wsb-button { animation: wsb-pulse 2s infinite; }
.wsb-anim-none { }

/* Tooltip */
.wsb-tooltip {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  pointer-events: none;
}
/* Tooltip positions approximate logic */
.wsb-bottom-right .wsb-tooltip { right: 70px; top: 50%; transform: translateY(-50%); }
.wsb-bottom-left .wsb-tooltip { left: 70px; top: 50%; transform: translateY(-50%); }
.wsb-top-right .wsb-tooltip { right: 70px; top: 50%; transform: translateY(-50%); }
.wsb-top-left .wsb-tooltip { left: 70px; top: 50%; transform: translateY(-50%); }

.wsb-container:hover .wsb-tooltip { opacity: 1; visibility: visible; }

/* Mini Chat Window */
.wsb-minichat {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 300px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  overflow: hidden;
  display: none; /* Toggled via JS */
  flex-direction: column;
}
.wsb-bottom-left .wsb-minichat { left: 0; right: auto; }
.wsb-top-right .wsb-minichat { top: 80px; bottom: auto; right: 0; }
.wsb-top-left .wsb-minichat { top: 80px; bottom: auto; left: 0; }
.wsb-center-right .wsb-minichat { bottom: 70px; right: 0; } 
/* Adjust logic for other positions as needed */

.wsb-minichat-header {
  background-color: var(--wsb-bg);
  color: #fff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}
.wsb-close-chat {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.wsb-minichat-body {
  padding: 20px;
  background: #f0f0f0;
  min-height: 150px;
}
.wsb-message-bubble {
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  display: inline-block;
  max-width: 80%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  font-size: 14px;
}
.wsb-start-chat-btn {
  display: block;
  background: var(--wsb-bg);
  color: #fff;
  text-align: center;
  padding: 15px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
}
.wsb-start-chat-btn:hover {
  background: var(--wsb-hover);
}

.wsb-minichat.wsb-show {
  display: flex !important;
  animation: wsb-fade-in 0.3s;
}
