/* ==========================================================================
   DIGITAL HIVE - COPILOT DRAWER CHATBOT (1:1 WITH KB EDUCATION ARCHITECTURE)
   Right-Edge Docked Drawer + Backdrop Blur + 2-Column Prompt Cards Grid
   ========================================================================== */

/* 1. Backdrop Overlay */
.dh-copilot-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.45) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 999990 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease !important;
}

.dh-copilot-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* 2. Right-Edge Dock Trigger (Vertical Tab on Right Screen Border) */
.dh-dock-trigger {
  position: fixed !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 9999 !important;
  background: #17012C !important;
  color: #ffffff !important;
  padding: 16px 10px !important;
  border-radius: 16px 0 0 16px !important;
  box-shadow: -6px 8px 30px rgba(23, 1, 44, 0.35) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-right: none !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease !important;
  outline: none !important;
}

.dh-dock-trigger:hover {
  transform: translateY(-50%) translateX(-5px) !important;
  background: #2D0854 !important;
}

.dh-dock-ping {
  position: relative !important;
  display: flex !important;
  width: 12px !important;
  height: 12px !important;
}

.dh-dock-ping .ping-ring {
  position: absolute !important;
  display: inline-flex !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  background-color: #efb10e !important;
  opacity: 0.75 !important;
  animation: pingPulse 1.5s cubic-bezier(0, 0, 0.2, 1) infinite !important;
}

.dh-dock-ping .ping-dot {
  position: relative !important;
  display: inline-flex !important;
  width: 12px !important;
  height: 12px !important;
  border-radius: 50% !important;
  background-color: #efb10e !important;
}

@keyframes pingPulse {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.dh-dock-sparkles {
  font-size: 16px !important;
  color: #efb10e !important;
  transition: transform 0.25s ease !important;
}

.dh-dock-trigger:hover .dh-dock-sparkles {
  transform: rotate(15deg) scale(1.15) !important;
}

.dh-dock-text {
  writing-mode: vertical-rl !important;
  -webkit-writing-mode: vertical-rl !important;
  -ms-writing-mode: tb-rl !important;
  transform: rotate(180deg) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  user-select: none !important;
}

/* 3. Floating Bottom-Right Launcher (Synchronized) */
.dh-bottom-launcher {
  position: fixed !important;
  bottom: 25px !important;
  right: 25px !important;
  z-index: 9998 !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #6a47ed 0%, #17012C 100%) !important;
  color: #ffffff !important;
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 8px 26px rgba(106, 71, 237, 0.45) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 22px !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  outline: none !important;
}

.dh-bottom-launcher:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 12px 32px rgba(106, 71, 237, 0.6) !important;
}

.dh-bottom-launcher.active {
  background: #17012C !important;
  transform: rotate(90deg) !important;
}

.dh-launcher-unread {
  position: absolute !important;
  top: 1px !important;
  right: 1px !important;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  background: #10B981 !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 8px #10B981 !important;
}

/* 4. Full-Height Slide-Over Copilot Drawer */
.dh-copilot-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  height: 100% !important;
  width: 100% !important;
  max-width: 580px !important;
  z-index: 999999 !important;
  background: #ffffff !important;
  box-shadow: -15px 0 50px rgba(23, 1, 44, 0.25) !important;
  border-left: 1px solid #E2E8F0 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.dh-copilot-drawer.open {
  transform: translateX(0) !important;
}

/* 5. Header Component */
.dh-copilot-header {
  background: #17012C !important;
  padding: 16px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  flex-shrink: 0 !important;
}

.dh-header-identity {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.dh-brand-badge {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #6a47ed 0%, #efb10e 100%) !important;
  padding: 1.5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.dh-brand-badge-inner {
  width: 100% !important;
  height: 100% !important;
  border-radius: 10.5px !important;
  background: #17012C !important;
  color: #efb10e !important;
  -webkit-text-fill-color: #efb10e !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 900 !important;
  font-size: 13.5px !important;
  letter-spacing: 0.5px !important;
}

.dh-header-title-box h3 {
  margin: 0 !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 15.5px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  line-height: 1.2 !important;
  letter-spacing: -0.3px !important;
}

.dh-header-online-status {
  font-size: 11.5px !important;
  color: #10B981 !important;
  -webkit-text-fill-color: #10B981 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 3px !important;
  font-weight: 600 !important;
}

.dh-pulse-dot-green {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background-color: #10B981 !important;
  display: inline-block !important;
  box-shadow: 0 0 6px #10B981 !important;
  animation: pulseDot 2s infinite !important;
}

.dh-header-controls {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.dh-control-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: none !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  outline: none !important;
}

.dh-control-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* 6. Human WhatsApp Direct Bar */
.dh-direct-whatsapp-bar {
  background: #F8FAFC !important;
  border-bottom: 1px solid #E2E8F0 !important;
  padding: 10px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 12px !important;
  color: #64748B !important;
  flex-shrink: 0 !important;
}

.dh-direct-whatsapp-bar a {
  color: #1877F2 !important;
  -webkit-text-fill-color: #1877F2 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: color 0.2s ease !important;
}

.dh-direct-whatsapp-bar a:hover {
  color: #0c63d4 !important;
  -webkit-text-fill-color: #0c63d4 !important;
}

/* 7. Messages Scroll Area */
.dh-copilot-messages-feed {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  background: #F8FAFC !important;
  scroll-behavior: smooth !important;
}

/* Row Layout */
.dh-chat-row-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  width: 100% !important;
}

.dh-chat-row-item.user {
  justify-content: flex-end !important;
}

.dh-chat-avatar-mini {
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
  background: #17012C !important;
  color: #efb10e !important;
  -webkit-text-fill-color: #efb10e !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  flex-shrink: 0 !important;
  margin-top: 3px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}

.dh-chat-bubble-container {
  max-width: 90% !important;
  display: flex !important;
  flex-direction: column !important;
}

.dh-chat-row-item.user .dh-chat-bubble-container {
  align-items: flex-end !important;
}

/* Message Bubble */
.dh-chat-bubble-card {
  padding: 14px 18px !important;
  font-size: 13.5px !important;
  line-height: 1.65 !important;
  border-radius: 18px !important;
  word-break: break-word !important;
}

.dh-chat-bubble-card.bot {
  background: #ffffff !important;
  color: #1E293B !important;
  -webkit-text-fill-color: #1E293B !important;
  border: 1px solid #E2E8F0 !important;
  border-top-left-radius: 4px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

.dh-chat-bubble-card.user {
  background: linear-gradient(135deg, #6a47ed 0%, #17012C 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-bottom-right-radius: 4px !important;
  box-shadow: 0 4px 14px rgba(106, 71, 237, 0.25) !important;
}

.dh-chat-bubble-card p {
  margin: 0 0 10px 0 !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

.dh-chat-bubble-card p:last-child {
  margin-bottom: 0 !important;
}

.dh-chat-bubble-card strong {
  font-weight: 800 !important;
  color: #0F172A !important;
  -webkit-text-fill-color: #0F172A !important;
}

.dh-chat-bubble-card.user strong {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.dh-chat-bubble-card ul {
  margin: 6px 0 10px 18px !important;
  padding: 0 !important;
  list-style-type: disc !important;
}

.dh-chat-bubble-card li {
  margin-bottom: 4px !important;
}

.dh-chat-bubble-card a {
  color: #6a47ed !important;
  -webkit-text-fill-color: #6a47ed !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
}

.dh-msg-timestamp {
  font-size: 10px !important;
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
  margin-top: 4px !important;
  padding: 0 4px !important;
}

/* 8. 2-COLUMN PROMPT CARDS GRID (KB EDUCATION PATTERN) */
.dh-prompt-cards-section {
  padding-top: 6px !important;
}

.dh-prompt-cards-label {
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
  margin-bottom: 10px !important;
  padding-left: 2px !important;
}

.dh-prompt-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
}

.dh-prompt-card-item {
  background: #ffffff !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 16px !important;
  padding: 12px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-align: left !important;
  outline: none !important;
  position: relative !important;
}

.dh-prompt-card-item:hover {
  border-color: #6a47ed !important;
  background: #FAF8FE !important;
  box-shadow: 0 4px 14px rgba(106, 71, 237, 0.1) !important;
  transform: translateY(-2px) !important;
}

.dh-prompt-icon-box {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 15px !important;
  flex-shrink: 0 !important;
}

.dh-prompt-text-group {
  flex: 1 !important;
  min-width: 0 !important;
}

.dh-prompt-card-title {
  display: block !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  -webkit-text-fill-color: #0F172A !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.25 !important;
}

.dh-prompt-card-desc {
  display: block !important;
  font-size: 10.5px !important;
  color: #64748B !important;
  -webkit-text-fill-color: #64748B !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-top: 2px !important;
}

.dh-prompt-arrow {
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
  font-size: 11px !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s ease, color 0.2s ease !important;
}

.dh-prompt-card-item:hover .dh-prompt-arrow {
  color: #6a47ed !important;
  -webkit-text-fill-color: #6a47ed !important;
  transform: translateX(3px) !important;
}

/* 9. Typing Indicator (KB Education Style) */
.dh-typing-indicator-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.dh-typing-indicator-card {
  background: #ffffff !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px !important;
  border-top-left-radius: 4px !important;
  padding: 10px 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 12.5px !important;
  color: #64748B !important;
  -webkit-text-fill-color: #64748B !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

.dh-spinner-svg {
  width: 16px !important;
  height: 16px !important;
  animation: dhSpin 1s linear infinite !important;
  color: #6a47ed !important;
}

@keyframes dhSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 10. Input Bar */
.dh-copilot-input-area {
  padding: 14px 18px !important;
  background: #ffffff !important;
  border-top: 1px solid #E2E8F0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
}

.dh-input-form-control {
  position: relative !important;
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
}

.dh-copilot-text-input {
  width: 100% !important;
  border: 1.5px solid #CBD5E1 !important;
  background: #F8FAFC !important;
  border-radius: 12px !important;
  padding: 12px 50px 12px 16px !important;
  font-size: 13.5px !important;
  color: #0F172A !important;
  -webkit-text-fill-color: #0F172A !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
}

.dh-copilot-text-input:focus {
  border-color: #6a47ed !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(106, 71, 237, 0.15) !important;
}

.dh-copilot-send-button {
  position: absolute !important;
  right: 6px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
  background: #17012C !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
  outline: none !important;
}

.dh-copilot-send-button:hover:not(:disabled) {
  background: #6a47ed !important;
  transform: scale(1.05) !important;
}

.dh-copilot-send-button:disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
}

/* 11. Mobile Responsiveness */
@media (max-width: 640px) {
  .dh-copilot-drawer {
    max-width: 100% !important;
  }
  .dh-prompt-cards-grid {
    grid-template-columns: 1fr !important;
  }
  .dh-dock-trigger {
    display: flex !important;
    padding: 12px 7px !important;
  }
  .dh-dock-text {
    font-size: 9.5px !important;
  }
}
