/* ==========================================================================
   SIDHABILL AI CHATBOT STYLES
   ========================================================================== */

/* Floating Toggle Button */
.sb-chatbot-trigger {
  position: fixed;
  bottom: 105px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 25px rgba(249, 115, 22, 0.45);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.sb-chatbot-trigger:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.6);
}

.sb-chatbot-trigger .sb-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

/* Chat Window Modal */
.sb-chatbot-window {
  position: fixed;
  bottom: 133px;
  right: 30px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 130px);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 15px 45px rgba(14, 34, 64, 0.18);
  border: 1px solid #e2e8f0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Poppins', sans-serif;
}

.sb-chatbot-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.sb-chat-header {
  background: linear-gradient(135deg, #0e2240 0%, #1f4268 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sb-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sb-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ff9800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.sb-chat-title-box h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.sb-chat-status {
  font-size: 12px;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sb-chat-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
}

.sb-chat-close {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.sb-chat-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Chat Body & Messages */
.sb-chat-body {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}

.sb-msg {
  max-width: 85%;
  font-size: 14px;
  line-height: 1.55;
  border-radius: 18px;
  padding: 12px 16px;
  word-wrap: break-word;
  animation: fadeInMsg 0.3s ease;
}

@keyframes fadeInMsg {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sb-msg.sb-bot {
  align-self: flex-start;
  background: #ffffff;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
}

.sb-msg.sb-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #2f8de0 0%, #1f6fc2 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(31, 111, 194, 0.25);
}

.sb-msg p {
  margin: 0 0 8px 0;
}

.sb-msg p:last-child {
  margin-bottom: 0;
}

.sb-msg ul,
.sb-msg ol {
  margin: 6px 0 6px 18px;
  padding: 0;
}

.sb-msg li {
  margin-bottom: 4px;
}

/* Quick Suggestion Chips */
.sb-chips-wrapper {
  padding: 8px 14px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  /* Firefox */
}

.sb-chips-wrapper::-webkit-scrollbar {
  display: none;
}

/* Chrome/Safari */

.sb-chip {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sb-chip:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Typing Indicator */
.sb-typing {
  align-self: flex-start;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.sb-typing span {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: sbBounce 1.4s infinite ease-in-out both;
}

.sb-typing span:nth-child(1) {
  animation-delay: -0.32s;
}

.sb-typing span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes sbBounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* Input Area */
.sb-chat-footer {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-chat-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #f8fafc;
  color: #0f172a;
}

.sb-chat-input:focus {
  border-color: #2563eb;
  background: #ffffff;
}

.sb-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}

.sb-send-btn:hover {
  transform: scale(1.05);
}

/* Dark Mode Overrides */
body.dark-mode .sb-chatbot-window {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
}

body.dark-mode .sb-chat-body {
  background: #0f172a;
}

body.dark-mode .sb-msg.sb-bot {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

body.dark-mode .sb-chips-wrapper,
body.dark-mode .sb-chat-footer {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .sb-chip {
  background: #334155;
  color: #93c5fd;
  border-color: #475569;
}

body.dark-mode .sb-chip:hover {
  background: #2563eb;
  color: #ffffff;
}

body.dark-mode .sb-chat-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-mode .sb-typing {
  background: #1e293b;
  border-color: #334155;
}