/* ==========================================================================
   ASISTEN T2T - Side Dock Drawer (Anti-Icon / Clean Professional Theme)
   Samakan dengan dock drawer lain (signalsDrawer, aiChatDrawer, broksumDrawer)
   ========================================================================== */

/* 1. Backdrop */
.asisten-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 12, 0.72);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.asisten-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* 2. Side Drawer Container */
.asisten-drawer {
  --asisten-panel: #10151b;
  --asisten-surface: #151b22;
  --asisten-inset: #0d1217;
  --asisten-line: #29313b;
  --asisten-line-soft: #1e262e;
  --asisten-line-strong: #39424d;
  --asisten-ink: #e8edf2;
  --asisten-ink-strong: #f4f6f8;
  --asisten-dim: #8e9aa7;
  --asisten-accent: #d6a84b;
  --asisten-accent-soft: rgba(214, 168, 75, 0.15);

  position: fixed;
  top: 0;
  right: 44px;
  bottom: 0;
  width: 500px;
  max-width: calc(100vw - 44px);
  z-index: 9999;
  background: var(--asisten-panel);
  border-left: 1px solid var(--asisten-line);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  color: var(--asisten-ink);
}

.asisten-drawer.open {
  transform: translateX(0);
}

/* Header */
.asisten-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--asisten-surface);
  border-bottom: 1px solid var(--asisten-line);
  flex-shrink: 0;
}

.asisten-drawer-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asisten-drawer-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--asisten-ink-strong);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.asisten-drawer-sub {
  font-size: 11px;
  color: var(--asisten-dim);
}

.asisten-drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.asisten-drawer-btn {
  background: transparent;
  border: 1px solid var(--asisten-line);
  border-radius: 4px;
  padding: 5px 10px;
  color: var(--asisten-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.asisten-drawer-btn:hover {
  background: var(--asisten-line-soft);
  color: var(--asisten-ink-strong);
  border-color: var(--asisten-line-strong);
}

.asisten-drawer-btn.close:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
}

/* Quick Chips Container */
.asisten-drawer-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 14px;
  background: var(--asisten-inset);
  border-bottom: 1px solid var(--asisten-line-soft);
  scrollbar-width: none;
  flex-shrink: 0;
}

.asisten-drawer-chips::-webkit-scrollbar {
  display: none;
}

.asisten-chip-item {
  flex-shrink: 0;
  background: var(--asisten-surface);
  border: 1px solid var(--asisten-line);
  border-radius: 4px;
  padding: 5px 10px;
  color: var(--asisten-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: inherit;
}

.asisten-chip-item:hover {
  background: var(--asisten-accent-soft);
  border-color: var(--asisten-accent);
  color: #fff;
}

/* Messages Area */
.asisten-drawer-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--asisten-line) transparent;
}

.asisten-drawer-messages::-webkit-scrollbar {
  width: 5px;
}

.asisten-drawer-messages::-webkit-scrollbar-thumb {
  background: var(--asisten-line);
  border-radius: 3px;
}

/* Bubbles */
.asisten-bubble {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 6px;
  word-break: break-word;
  animation: asistenFade 0.15s ease-out;
}

@keyframes asistenFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.asisten-bubble-bot {
  align-self: flex-start;
  background: var(--asisten-surface);
  border: 1px solid var(--asisten-line);
  color: var(--asisten-ink);
}

.asisten-bubble-user {
  align-self: flex-end;
  background: var(--asisten-accent-soft);
  border: 1px solid rgba(214, 168, 75, 0.4);
  color: #fff;
}

.asisten-bubble h3 {
  margin: 0 0 6px 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--asisten-accent);
  letter-spacing: 0.2px;
}

.asisten-bubble p {
  margin: 4px 0;
}

.asisten-bubble ul, .asisten-bubble ol {
  margin: 4px 0 6px 18px;
  padding: 0;
}

.asisten-bubble li {
  margin-bottom: 3px;
}

.asisten-bubble strong {
  color: #fff;
  font-weight: 700;
}

.asisten-bubble code {
  background: var(--asisten-inset);
  border: 1px solid var(--asisten-line);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 11px;
  color: #93c5fd;
}

/* Thinking Indicator */
.asisten-loading {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--asisten-surface);
  border: 1px solid var(--asisten-line);
  border-radius: 6px;
  font-size: 11px;
  color: var(--asisten-dim);
}

.asisten-loading-dot {
  width: 5px;
  height: 5px;
  background: var(--asisten-accent);
  border-radius: 50%;
  animation: asistenDotPulse 1.2s infinite ease-in-out;
}

.asisten-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.asisten-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes asistenDotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Footer & Input */
.asisten-drawer-footer {
  padding: 10px 14px;
  background: var(--asisten-surface);
  border-top: 1px solid var(--asisten-line);
  flex-shrink: 0;
}

.asisten-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asisten-input-field {
  flex: 1;
  background: var(--asisten-inset);
  border: 1px solid var(--asisten-line);
  border-radius: 4px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12px;
  color: var(--asisten-ink-strong);
  outline: none;
  transition: border-color 0.15s ease;
}

.asisten-input-field:focus {
  border-color: var(--asisten-accent);
}

.asisten-input-field::placeholder {
  color: #556270;
}

.asisten-submit-btn {
  background: var(--asisten-accent-soft);
  border: 1px solid var(--asisten-accent);
  border-radius: 4px;
  padding: 7px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.asisten-submit-btn:hover {
  background: var(--asisten-accent);
  color: #0f172a;
}

.asisten-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .asisten-drawer {
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
}
