/* ==========================================================================
   ABUBAKAR'S AI PORTFOLIO ASSISTANT CHATBOT STYLES
   ========================================================================== */

/* Navbar Ask AI Button Styling */
.nav-ask-ai-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(56, 189, 248, 0.06));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc !important;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.3px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all var(--transition-normal);
}

.nav-ask-ai-btn i {
  font-size: 0.85rem;
  color: #c084fc;
  transition: transform var(--transition-fast);
}

.nav-ask-ai-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(56, 189, 248, 0.15));
  border-color: #c084fc;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.45);
  transform: translateY(-2px);
}

.nav-ask-ai-btn:hover i {
  color: #ffffff;
  transform: rotate(15deg) scale(1.15);
}

/* --------------------------------------------------------------------------
   1. FLOATING CHAT TRIGGER BUTTON
   -------------------------------------------------------------------------- */
#chatbot-trigger {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  color: #ffffff;
  cursor: pointer;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), var(--glow-cyan);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all var(--transition-normal);
}

#chatbot-trigger::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--gradient-primary);
  opacity: 0.6;
  z-index: -1;
  filter: blur(8px);
  animation: chatbotPulse 3s infinite ease-in-out;
}

@keyframes chatbotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

#chatbot-trigger:hover {
  transform: translateY(-4px) scale(1.06);
  border-color: var(--accent-cyan);
  box-shadow: 0 15px 35px -5px rgba(56, 189, 248, 0.5), var(--glow-cyan);
}

.chatbot-trigger-icon {
  font-size: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

#chatbot-trigger:hover .chatbot-trigger-icon {
  transform: scale(1.1);
}

/* Badge dot on trigger button */
.chatbot-badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  background: var(--accent-emerald);
  border: 2.5px solid var(--bg-dark);
  border-radius: 50%;
}

/* Tooltip badge for trigger */
.chatbot-trigger-tooltip {
  position: absolute;
  right: 70px;
  white-space: nowrap;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  box-shadow: var(--glow-box);
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: all var(--transition-fast);
}

#chatbot-trigger:hover .chatbot-trigger-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Active / Open state for trigger icon */
#chatbot-trigger.active {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   2. MAIN CHAT WINDOW CONTAINER
   -------------------------------------------------------------------------- */
#chatbot-window {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  width: 390px;
  max-width: calc(100vw - 2.5rem);
  height: 590px;
  max-height: calc(85vh - 3rem);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#chatbot-window.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------------------
   3. CHATBOT HEADER
   -------------------------------------------------------------------------- */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(3, 7, 18, 0.75);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chatbot-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 2px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.chatbot-avatar-inner {
  width: 100%;
  height: 100%;
  background: #0b1329;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 1.1rem;
}

.chatbot-title-container {
  display: flex;
  flex-direction: column;
}

.chatbot-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.chatbot-status {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-status-indicator {
  width: 6px;
  height: 6px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-emerald);
}

.chatbot-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.chatbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   4. MESSAGES CONTAINER & WELCOME CARD
   -------------------------------------------------------------------------- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}
.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

/* Welcome Card */
.chatbot-welcome {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  text-align: center;
  margin-bottom: 0.5rem;
  backdrop-filter: blur(10px);
}

.chatbot-welcome-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem auto;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.chatbot-welcome-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.chatbot-welcome-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.9rem;
}

.suggested-questions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.suggested-btn {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.suggested-btn i {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  opacity: 0.6;
  transition: transform var(--transition-fast);
}

.suggested-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateX(3px);
}

.suggested-btn:hover i {
  opacity: 1;
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   5. CHAT MESSAGE BUBBLES
   -------------------------------------------------------------------------- */
.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: messageFadeIn 0.3s ease forwards;
}

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

.chat-message.user {
  align-self: flex-end;
}

.chat-message.ai {
  align-self: flex-start;
}

.chat-bubble {
  padding: 0.8rem 1.1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.chat-message.user .chat-bubble {
  background: var(--gradient-primary);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
  font-weight: 500;
}

.chat-message.ai .chat-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: 18px 18px 18px 4px;
  backdrop-filter: blur(10px);
}

.chat-message.ai .chat-bubble strong {
  color: #ffffff;
  font-weight: 600;
}

.chat-message.ai .chat-bubble a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chat-message.ai .chat-bubble a:hover {
  color: #ffffff;
}

.chat-message.ai .chat-bubble ul, 
.chat-message.ai .chat-bubble ol {
  margin: 0.4rem 0 0.4rem 1.2rem;
  padding-left: 0;
}

.chat-message.ai .chat-bubble li {
  list-style-type: disc;
  margin-bottom: 0.3rem;
}

.chat-message-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  padding: 0 0.2rem;
}

.chat-message.user .chat-message-time {
  text-align: right;
}

.chat-message.ai .chat-message-time {
  text-align: left;
}

/* --------------------------------------------------------------------------
   6. TYPING INDICATOR
   -------------------------------------------------------------------------- */
.typing-indicator-container {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 0.75rem 1.1rem;
  border-radius: 18px 18px 18px 4px;
  backdrop-filter: blur(10px);
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 8px var(--accent-cyan);
  }
}

.typing-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Error message bubble */
.chat-message.error .chat-bubble {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 18px;
}

/* --------------------------------------------------------------------------
   7. INPUT FORM & FOOTER
   -------------------------------------------------------------------------- */
.chatbot-input-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  background: rgba(3, 7, 18, 0.85);
  border-top: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
}

.chatbot-input-wrapper {
  flex: 1;
  position: relative;
}

.chatbot-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.7rem 1.1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: all var(--transition-fast);
}

.chatbot-input::placeholder {
  color: var(--text-dim);
}

.chatbot-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.chatbot-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chatbot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
  transition: all var(--transition-fast);
}

.chatbot-send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

.chatbot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   8. MOBILE RESPONSIVE LAYOUT
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  #chatbot-trigger {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 54px;
    height: 54px;
  }

  .chatbot-trigger-tooltip {
    display: none;
  }

  #chatbot-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    transform: translateY(100%);
  }

  #chatbot-window.active {
    transform: translateY(0);
  }

  .chatbot-header {
    padding: 1.1rem 1.25rem;
  }
}
