/* ── Portfolio Chatbot Widget ──
   Matches Brittany Chiang dark navy/green theme
   ─────────────────────────────────────────────── */

/* Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #64ffda;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(100, 255, 218, 0.3);
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
  z-index: 9998;
}

.chatbot-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(100, 255, 218, 0.4);
}

.chatbot-toggle svg {
  width: 26px;
  height: 26px;
  fill: #0a192f;
  transition: transform 0.25s ease;
}

.chatbot-toggle.active svg {
  transform: rotate(90deg);
}

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  max-height: 520px;
  background: #112240;
  border: 1px solid #233554;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(2, 12, 27, 0.7);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  font-family: "Inter", "SF Pro Text", -apple-system, system-ui, sans-serif;
}

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

/* Header */
.chatbot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: #0a192f;
  border-bottom: 1px solid #233554;
  border-radius: 12px 12px 0 0;
}

.chatbot-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(100, 255, 218, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot-header-avatar svg {
  width: 18px;
  height: 18px;
  fill: #64ffda;
}

.chatbot-header-info {
  flex: 1;
}

.chatbot-header-name {
  font-size: 14px;
  font-weight: 600;
  color: #ccd6f6;
  margin: 0;
  line-height: 1.2;
}

.chatbot-header-status {
  font-size: 11px;
  color: #64ffda;
  margin: 0;
  font-family: "Fira Code", monospace;
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  max-height: 360px;
  scrollbar-width: thin;
  scrollbar-color: #495670 #112240;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #112240;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #495670;
  border-radius: 3px;
}

/* Message Bubbles */
.chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: msgFadeIn 0.3s ease;
}

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

.chatbot-msg.bot {
  align-self: flex-start;
  background: #233554;
  color: #a8b2d1;
  border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
  align-self: flex-end;
  background: rgba(100, 255, 218, 0.1);
  color: #ccd6f6;
  border: 1px solid rgba(100, 255, 218, 0.2);
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
  background: #233554;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #495670;
  animation: typingBounce 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    background: #495670;
  }
  30% {
    transform: translateY(-6px);
    background: #64ffda;
  }
}

/* Suggested Questions */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
}

.chatbot-suggestion-btn {
  background: rgba(100, 255, 218, 0.05);
  border: 1px solid #233554;
  color: #64ffda;
  font-size: 11px;
  font-family: "Fira Code", monospace;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chatbot-suggestion-btn:hover {
  background: rgba(100, 255, 218, 0.1);
  border-color: #64ffda;
}

/* Input Area */
.chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #233554;
  background: #0a192f;
  border-radius: 0 0 12px 12px;
}

.chatbot-input {
  flex: 1;
  background: #112240;
  border: 1px solid #233554;
  border-radius: 8px;
  padding: 10px 14px;
  color: #ccd6f6;
  font-size: 13px;
  font-family: "Inter", sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
}

.chatbot-input::placeholder {
  color: #495670;
}

.chatbot-input:focus {
  border-color: #64ffda;
}

.chatbot-send {
  background: #64ffda;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-send:hover {
  background: #7affdf;
  transform: translateY(-1px);
}

.chatbot-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.chatbot-send svg {
  width: 18px;
  height: 18px;
  fill: #0a192f;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chatbot-window {
    right: 12px;
    left: 12px;
    bottom: 90px;
    width: auto;
    max-height: 70vh;
  }

  .chatbot-toggle {
    bottom: 20px;
    right: 20px;
  }
}
