/* ══════════════════════════════════════════
   ISMARED CHATBOX — IsmaBot
══════════════════════════════════════════ */

.sb-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #2dd4bf);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9997;
  transition: transform .25s, box-shadow .25s;
  border: none;
  outline: none;
}
.sb-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.6);
}
.sb-btn svg { width: 26px; height: 26px; }

.sb-popup {
  position: fixed;
  bottom: 90px;
  right: 28px;
  width: 340px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 56px rgba(124, 58, 237, 0.18);
  z-index: 9996;
  overflow: hidden;
  transform: scale(.85) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
  display: flex;
  flex-direction: column;
  max-height: 500px;
}
.sb-popup.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.sb-header {
  background: linear-gradient(135deg, #7c3aed, #2dd4bf);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.sb-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.sb-header-info h3 {
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  margin: 0;
}
.sb-header-info span {
  color: rgba(255,255,255,.75);
  font-size: .75rem;
  display: flex; align-items: center; gap: 5px;
}
.sb-online-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  animation: sb-blink 1.6s ease-in-out infinite;
}
@keyframes sb-blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.sb-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: background .2s;
  line-height: 1;
}
.sb-close:hover { background: rgba(255,255,255,.2); color: #fff; }

.sb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f7ff;
  scroll-behavior: smooth;
}
.sb-messages::-webkit-scrollbar { width: 4px; }
.sb-messages::-webkit-scrollbar-track { background: transparent; }
.sb-messages::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 4px; }

.sb-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}
.sb-msg.bot  { align-self: flex-start; }
.sb-msg.user { align-self: flex-end; }

.sb-msg .bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .85rem;
  line-height: 1.55;
  word-break: break-word;
}
.sb-msg.bot .bubble {
  background: #ffffff;
  color: #1a0a2e;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(124,58,237,.1);
}
.sb-msg.user .bubble {
  background: linear-gradient(135deg, #7c3aed, #2dd4bf);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.sb-msg .time {
  font-size: .7rem;
  color: #94a3b8;
  margin-top: 3px;
  padding: 0 4px;
}
.sb-msg.user .time { text-align: right; }

.sb-typing .bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}
.sb-typing .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  animation: sb-bounce .9s ease-in-out infinite;
}
.sb-typing .dot:nth-child(2) { animation-delay: .15s; }
.sb-typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes sb-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}

.sb-footer {
  background: #ffffff;
  padding: 12px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #ede9fe;
  flex-shrink: 0;
}
.sb-input {
  flex: 1;
  border: 1.5px solid #ede9fe;
  background: #f8f7ff;
  border-radius: 24px;
  padding: 9px 16px;
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  color: #1a0a2e;
  transition: border-color .2s;
}
.sb-input:focus { border-color: #7c3aed; background: #fff; }
.sb-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #2dd4bf);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .15s, opacity .2s;
}
.sb-send:hover { transform: scale(1.08); }
.sb-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.sb-send svg { width: 16px; height: 16px; fill: white; }

@media (max-width: 768px) {
  .sb-btn { bottom: 20px; right: 16px; width: 50px; height: 50px; }
  .sb-popup { bottom: 80px; right: 16px; left: 16px; width: auto; max-height: 70vh; }
}

.sb-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}
.sb-option-btn {
  background: white;
  border: 1px solid #ede9fe;
  color: #1a0a2e;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(124,58,237,0.05);
}
.sb-option-btn:hover {
  background: #f8f7ff;
  border-color: #a78bfa;
  transform: translateY(-1px);
}
.sb-lead-form {
  background: white;
  border: 1px solid #ede9fe;
  padding: 15px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 85%;
  margin-top: 5px;
  box-shadow: 0 2px 4px rgba(124,58,237,0.05);
}
.sb-lead-form input {
  padding: 10px;
  border: 1px solid #ede9fe;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  color: #1a0a2e;
}
.sb-lead-form input:focus { border-color: #7c3aed; }
.sb-submit-btn {
  background: linear-gradient(135deg, #7c3aed, #2dd4bf);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.sb-submit-btn:hover { opacity: 0.9; }
.sb-submit-btn:disabled { background: #94a3b8; cursor: not-allowed; }
