/* RISKOS Institutional Quant Copilot (quantCopilot.css)
 * Terminal-integrated AI Analyst slide-out drawer
 */

.copilot-drawer {
  position: fixed;
  top: 0;
  right: -460px;
  width: 440px;
  max-width: 95vw;
  height: 100vh;
  background: rgba(10, 14, 23, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
  z-index: 26000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: #e2e8f0;
}

.copilot-drawer.open {
  right: 0;
}

.copilot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.copilot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.copilot-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.copilot-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #f8fafc;
}

.copilot-status {
  font-size: 10px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.copilot-pulse {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: copilot-pulse-anim 1.8s infinite;
}

@keyframes copilot-pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.copilot-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.copilot-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.copilot-chips-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 12, 20, 0.6);
  scrollbar-width: none;
}

.copilot-chips-bar::-webkit-scrollbar {
  display: none;
}

.copilot-chip {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #93c5fd;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.copilot-chip:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #fff;
}

.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.copilot-msg {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.copilot-msg.bot {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-left: 3px solid #3b82f6;
}

.copilot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(30, 64, 175, 0.9));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.copilot-msg pre {
  margin: 8px 0 0 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.copilot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.9);
}

.copilot-input {
  flex: 1;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.copilot-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.copilot-send-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copilot-send-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Floating Trigger Button */
.copilot-float-trigger,
.copilot-floating-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', 'Inter', monospace;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 15px rgba(56, 189, 248, 0.25);
  cursor: pointer;
  z-index: 24000;
  border: 1px solid rgba(56, 189, 248, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.copilot-float-trigger:hover,
.copilot-floating-pill:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 24px rgba(56, 189, 248, 0.45);
}

.copilot-floating-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: copilot-pulse-anim 1.8s infinite;
}

.copilot-kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .copilot-float-trigger,
  .copilot-floating-pill {
    bottom: 74px; /* Lift above mobile navigation bar */
    right: 14px;
    height: 36px;
    padding: 0 12px;
    font-size: 10px;
  }
}
