/* ==========================================================================
   NOVA AI STUDY BUDDY STYLESHEET
   Floating Co-Pilot Orb, Conversational Drawer, and Curiosity Chips
   ========================================================================== */

/* Top Nav Nova Co-Pilot Pill Button */
.nova-pill-btn {
  background: linear-gradient(135deg, #1e3a8a, #4338ca) !important;
  border: 1px solid #60a5fa !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.4) !important;
  animation: aiOrbPulse 3s infinite ease-in-out;
}

.nova-pill-btn:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  border-color: #93c5fd !important;
  transform: translateY(-1px) scale(1.03);
}

/* Floating AI Orb Trigger (Positioned at Top Right so it NEVER blocks bottom buttons) */
.ai-floating-trigger {
  position: fixed;
  top: 78px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1e3a8a, #4338ca);
  border: 2px solid #60a5fa;
  border-radius: 9999px;
  padding: 8px 16px;
  color: #ffffff;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4), 0 0 12px rgba(96, 165, 250, 0.3);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: aiOrbPulse 3s infinite ease-in-out;
}

@media (max-width: 768px) {
  .ai-floating-trigger {
    top: 70px;
    right: 12px;
    padding: 7px 13px;
    font-size: 12.5px;
  }
}

.ai-floating-trigger:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.6), 0 0 20px rgba(96, 165, 250, 0.5);
  border-color: #93c5fd;
}

@keyframes aiOrbPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), 0 0 12px rgba(96, 165, 250, 0.3); }
  50% { box-shadow: 0 8px 28px rgba(99, 102, 241, 0.6), 0 0 20px rgba(129, 140, 248, 0.5); }
}

.ai-orb-icon {
  font-size: 18px;
}

.ai-orb-badge {
  background: #22c55e;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

/* Chat Drawer / Modal Container */
.ai-chat-modal {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: calc(100vw - 32px);
  max-width: 420px;
  height: 600px;
  max-height: calc(100vh - 48px);
  background: #0f172a;
  border: 2px solid #3b82f6;
  border-radius: 24px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(59, 130, 246, 0.3);
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  animation: aiModalOpen 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Fullscreen Mode */
.ai-chat-modal.fullscreen {
  top: 16px;
  bottom: 16px;
  left: 16px;
  right: 16px;
  width: calc(100vw - 32px);
  max-width: 920px;
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  margin: auto;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95), 0 0 45px rgba(59, 130, 246, 0.45);
}

.ai-chat-modal.fullscreen .ai-msg-row {
  max-width: 76%;
}

.ai-chat-modal.fullscreen .ai-msg-bubble {
  font-size: 15.5px;
  line-height: 1.65;
  padding: 14px 20px;
}

@keyframes aiModalOpen {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Chat Header */
.ai-chat-header {
  padding: 16px 20px;
  background: #172033;
  border-bottom: 1px solid #243147;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar-icon {
  font-size: 28px;
  background: #1e293b;
  border: 1px solid #3b82f6;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-header-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-header-tagline {
  font-size: 11px;
  color: #38bdf8;
  font-weight: 600;
}

.ai-header-actions {
  display: flex;
  gap: 8px;
}

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

.ai-header-btn:hover {
  color: #ffffff;
  background: #1e293b;
}

/* Curiosity Starter Chips */
.ai-chips-bar {
  padding: 10px 14px;
  background: #111a2e;
  border-bottom: 1px solid #1e293b;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.ai-prompt-chip {
  background: #172033;
  border: 1px solid #334460;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.ai-prompt-chip:hover {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Chat Messages Stream */
.ai-messages-stream {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-msg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 86%;
}

.ai-msg-row.user {
  align-self: flex-end;
}

.ai-msg-row.bot {
  align-self: flex-start;
}

.ai-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 500;
  letter-spacing: -0.1px;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.ai-msg-row.user .ai-msg-bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.ai-msg-row.bot .ai-msg-bubble {
  background: #172033;
  border: 1px solid #2d3b55;
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.ai-msg-bubble strong {
  color: #38bdf8;
  font-weight: 700;
}

.ai-msg-bubble p {
  margin: 0 0 6px 0;
}

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

.ai-msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.ai-listen-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
}

.ai-listen-btn:hover {
  color: #38bdf8;
  background: #172033;
}

/* Typing Indicator */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #172033;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.ai-typing-dot {
  width: 7px;
  height: 7px;
  background: #38bdf8;
  border-radius: 50%;
  animation: aiTypingBounce 1.4s infinite ease-in-out;
}

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

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

/* Chat Input Bar */
.ai-chat-input-bar {
  padding: 12px 16px;
  background: #172033;
  border-top: 1px solid #243147;
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-input-field {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334460;
  border-radius: 12px;
  padding: 10px 14px;
  color: #ffffff;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 13.5px;
  outline: none;
  transition: all 0.15s ease;
}

.ai-input-field:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.ai-send-btn {
  background: #2563eb;
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-send-btn:hover:not(:disabled) {
  background: #1d4ed8;
  transform: scale(1.05);
}

.ai-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
