/* =======================================================
 * SDH AI Assistant Chatbot Popup Styles (Linear SaaS Theme)
 * Developed by Siddique Tech Solution for Shahbaz Digital Hub
 * ======================================================= */

.sdh-ai-widget-wrap {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
}

/* Floating AI Button */
.sdh-ai-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #0e111a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sdh-ai-fab:hover {
  transform: scale(1.08);
  border-color: #38bdf8;
  box-shadow: 0 6px 25px rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

.sdh-ai-glow-orbit {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  animation: sdh-spin 12s linear infinite;
}

@keyframes sdh-spin {
  100% { transform: rotate(360deg); }
}

.sdh-ai-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--sdh-primary-gradient);
  color: #08090d;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 9999px;
  border: 2px solid #08090d;
}

/* Chat Box Window */
.sdh-ai-box {
  position: absolute;
  bottom: 68px;
  left: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  background: #0d0f17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sdh-chat-open 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sdh-chat-open {
  from { opacity: 0; transform: translateY(15px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.sdh-ai-box-header {
  background: #121522;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sdh-ai-bot-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  font-size: 16px;
}

.sdh-ai-bot-avatar .online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: #10b981;
  border: 2px solid #121522;
  border-radius: 50%;
}

.sdh-ai-header-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1px;
}

.sdh-ai-header-info p {
  font-size: 11px;
  color: #94a3b8;
}

.sdh-ai-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  margin-left: auto;
  transition: color 0.2s;
}

.sdh-ai-close-btn:hover {
  color: #ffffff;
}

/* Messages Area */
/* Messages Area with Custom Sleek Scrollbar */
.sdh-ai-messages-wrap {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 210, 255, 0.25) transparent;
}

.sdh-ai-messages-wrap::-webkit-scrollbar {
  width: 5px;
}

.sdh-ai-messages-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.sdh-ai-messages-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 210, 255, 0.25);
  border-radius: 10px;
}

.sdh-ai-messages-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 210, 255, 0.55);
}

/* Quick Questions Chips - No Ugly Scrollbar */
.sdh-ai-chips-wrap {
  padding: 8px 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 12, 28, 0.95);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  -webkit-overflow-scrolling: touch;
}

.sdh-ai-chips-wrap::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Edge - hides horizontal scrollbar! */
  width: 0 !important;
  height: 0 !important;
}

.sdh-ai-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sdh-ai-chip:hover {
  background: rgba(0, 210, 255, 0.15);
  border-color: #00d2ff;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

/* Input Form */
.sdh-ai-input-form {
  padding: 12px 14px;
  background: #121522;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
}

.sdh-ai-input-form input {
  flex-grow: 1;
  background: #08090d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 9px 12px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12.5px;
}

.sdh-ai-input-form input:focus {
  outline: none;
  border-color: #38bdf8;
}

.sdh-ai-send-btn {
  background: var(--sdh-primary-gradient);
  border: none;
  color: #08090d;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.sdh-ai-send-btn:hover {
  filter: brightness(1.1);
}

.sdh-ai-footer-note {
  text-align: center;
  padding: 5px;
  font-size: 10.5px;
  color: #64748b;
  background: #0d0f17;
}

.sdh-ai-footer-note strong {
  color: #94a3b8;
}

/* Chat Messages & Bubbles */
.sdh-ai-msg,
.sdh-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: sdh-msg-fade 0.2s ease-out;
}

@keyframes sdh-msg-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sdh-ai-msg.user,
.sdh-chat-msg.user {
  align-self: flex-end;
}

.sdh-ai-msg.bot,
.sdh-chat-msg.bot {
  align-self: flex-start;
}

.sdh-ai-msg-content,
.sdh-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.sdh-ai-msg.user .sdh-ai-msg-content,
.sdh-chat-msg.user .sdh-msg-bubble {
  background: linear-gradient(135deg, #00d2ff 0%, #0066ff 100%);
  color: #040714;
  font-weight: 600;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.25);
}

.sdh-ai-msg.bot .sdh-ai-msg-content,
.sdh-chat-msg.bot .sdh-msg-bubble {
  background: #151a2e;
  color: #e2e8f0;
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.sdh-ai-msg.bot .sdh-ai-msg-content strong,
.sdh-chat-msg.bot .sdh-msg-bubble strong {
  color: #00d2ff;
}

/* Typing indicator */
.sdh-typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
}

.sdh-typing-indicator span {
  width: 7px;
  height: 7px;
  background: #00d2ff;
  border-radius: 50%;
  animation: sdh-blink 1.2s infinite ease-in-out;
}

.sdh-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.sdh-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sdh-blink {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* Chatbot Mobile Responsiveness */
@media (max-width: 600px) {
  .sdh-ai-widget-wrap {
    bottom: 16px;
    left: 12px;
  }
  .sdh-ai-fab {
    width: 46px;
    height: 46px;
    font-size: 19px;
  }
  .sdh-ai-box {
    position: fixed;
    bottom: 70px;
    left: 10px;
    right: 10px;
    width: auto !important;
    max-width: none !important;
    height: min(480px, 78vh);
    border-radius: 16px;
  }
  .sdh-ai-box-header {
    padding: 10px 12px;
  }
  .sdh-ai-bot-avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .sdh-ai-header-info h4 {
    font-size: 13px;
  }
  .sdh-ai-header-info p {
    font-size: 10.5px;
  }
  .sdh-ai-chips-wrap {
    padding: 6px 10px;
    gap: 6px;
  }
  .sdh-ai-chip {
    padding: 5px 10px;
    font-size: 11px;
  }
  .sdh-ai-input-form {
    padding: 8px 10px;
  }
  .sdh-ai-input-form input {
    padding: 8px 10px;
    font-size: 12px;
  }
  .sdh-ai-send-btn {
    width: 34px;
    height: 34px;
  }
}
