/* ===== CHATBOT STYLES ===== */
/* Floating chatbot widget for Parallel Sourcing website */

/* ===== CHATBOT TOGGLE BUTTON ===== */
.chatbot-toggle-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fca311, #ff7700);
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(252, 163, 17, 0.45), 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: chatbot-pulse 2.5s ease-in-out infinite;
}

.chatbot-toggle-btn:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 32px rgba(252, 163, 17, 0.55), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chatbot-toggle-btn:active {
  transform: scale(0.95);
}

.chatbot-toggle-btn.chatbot-open {
  animation: none;
  transform: rotate(0deg);
}

.chatbot-toggle-btn svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  transition: transform 0.3s ease;
}

.chatbot-toggle-btn.chatbot-open svg.chatbot-icon-chat {
  display: none;
}

.chatbot-toggle-btn.chatbot-open svg.chatbot-icon-close {
  display: block;
}

.chatbot-toggle-btn svg.chatbot-icon-close {
  display: none;
}

/* Notification badge */
.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  border: 2px solid #fff;
  animation: chatbot-badge-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Inter', system-ui, sans-serif;
}

@keyframes chatbot-pulse {
  0%, 100% {
    box-shadow: 0 6px 24px rgba(252, 163, 17, 0.45), 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow: 0 6px 24px rgba(252, 163, 17, 0.45), 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 12px rgba(252, 163, 17, 0.12);
  }
}

@keyframes chatbot-badge-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== CHATBOT WINDOW ===== */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 400px;
  max-height: 580px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ===== CHATBOT HEADER ===== */
.chatbot-header {
  background: linear-gradient(135deg, #14213d, #1a2d50);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.chatbot-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(252, 163, 17, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.chatbot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fca311, #ff7700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(252, 163, 17, 0.35);
}

.chatbot-avatar svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

.chatbot-header-info {
  flex: 1;
  min-width: 0;
}

.chatbot-header-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  font-family: 'Bodoni Moda', serif;
}

.chatbot-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.chatbot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: chatbot-status-glow 2s ease-in-out infinite;
}

@keyframes chatbot-status-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15); }
}

.chatbot-status-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-family: 'Bodoni Moda', serif;
}

.chatbot-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 1;
}

.chatbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.chatbot-close-btn svg {
  width: 16px;
  height: 16px;
  stroke: rgba(255, 255, 255, 0.8);
  fill: none;
  stroke-width: 2;
}

/* ===== CHATBOT MESSAGES AREA ===== */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #f8f9fb 0%, #ffffff 50%);
  max-height: 360px;
  min-height: 280px;
  scroll-behavior: smooth;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(20, 33, 61, 0.15);
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 33, 61, 0.3);
}

/* ===== MESSAGE BUBBLES ===== */
.chatbot-msg {
  display: flex;
  gap: 10px;
  animation: chatbot-msg-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 88%;
}

@keyframes chatbot-msg-in {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.chatbot-msg.chatbot-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chatbot-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.chatbot-msg-bot .chatbot-msg-avatar {
  background: linear-gradient(135deg, #14213d, #1a2d50);
}

.chatbot-msg-bot .chatbot-msg-avatar svg {
  width: 14px;
  height: 14px;
  fill: #fca311;
}

.chatbot-msg-user .chatbot-msg-avatar {
  background: linear-gradient(135deg, #fca311, #ff7700);
}

.chatbot-msg-user .chatbot-msg-avatar svg {
  width: 14px;
  height: 14px;
  fill: #ffffff;
}

.chatbot-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  font-family: 'Bodoni Moda', serif;
  word-break: break-word;
}

.chatbot-msg-bot .chatbot-msg-bubble {
  background: #f1f3f7;
  color: #1a1a2e;
  border-bottom-left-radius: 6px;
}

.chatbot-msg-user .chatbot-msg-bubble {
  background: linear-gradient(135deg, #14213d, #1a2d50);
  color: #ffffff;
  border-bottom-right-radius: 6px;
}

/* Links inside bot messages */
.chatbot-msg-bubble a {
  color: #fca311;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(252, 163, 17, 0.3);
  transition: all 0.2s ease;
}

.chatbot-msg-bubble a:hover {
  color: #ff7700;
  border-bottom-color: #ff7700;
}

.chatbot-msg-user .chatbot-msg-bubble a {
  color: #fca311;
  border-bottom-color: rgba(252, 163, 17, 0.4);
}

/* Steps list inside messages */
.chatbot-steps {
  margin: 8px 0 4px;
  padding-left: 0;
  list-style: none;
  counter-reset: chatbot-steps;
}

.chatbot-steps li {
  counter-increment: chatbot-steps;
  padding: 6px 0 6px 28px;
  position: relative;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
  margin-bottom: 2px;
}

.chatbot-steps li::before {
  content: counter(chatbot-steps);
  position: absolute;
  left: 0;
  top: 6px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #fca311, #ff7700);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ===== TYPING INDICATOR ===== */
.chatbot-typing {
  display: flex;
  gap: 10px;
  align-self: flex-start;
  max-width: 88%;
  animation: chatbot-msg-in 0.3s ease;
}

.chatbot-typing-bubble {
  background: #f1f3f7;
  padding: 14px 20px;
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chatbot-typing-dot {
  width: 7px;
  height: 7px;
  background: #a0a8b8;
  border-radius: 50%;
  animation: chatbot-typing-anim 1.4s ease-in-out infinite;
}

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

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

@keyframes chatbot-typing-anim {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ===== QUICK REPLIES ===== */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
  animation: chatbot-msg-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-quick-reply-btn {
  background: #ffffff;
  border: 1.5px solid #e2e5ea;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: #14213d;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Bodoni Moda', serif;
  white-space: nowrap;
}

.chatbot-quick-reply-btn:hover {
  background: linear-gradient(135deg, #14213d, #1a2d50);
  color: #ffffff;
  border-color: #14213d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20, 33, 61, 0.2);
}

.chatbot-quick-reply-btn:active {
  transform: translateY(0);
}

/* ===== CHATBOT INPUT AREA ===== */
.chatbot-input-area {
  padding: 14px 16px;
  background: #ffffff;
  border-top: 1px solid #eef0f4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-input-field {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid #e2e5ea;
  border-radius: 24px;
  font-size: 13.5px;
  font-family: 'Bodoni Moda', serif;
  color: #1a1a2e;
  background: #f8f9fb;
  outline: none;
  transition: all 0.25s ease;
}

.chatbot-input-field::placeholder {
  color: #9ca3af;
}

.chatbot-input-field:focus {
  border-color: #fca311;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.1);
}

.chatbot-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fca311, #ff7700);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(252, 163, 17, 0.3);
}

.chatbot-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 16px rgba(252, 163, 17, 0.4);
}

.chatbot-send-btn:active {
  transform: scale(0.95);
}

.chatbot-send-btn svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
  transform: rotate(-45deg);
  margin-left: 2px;
}

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

/* ===== POWERED BY FOOTER ===== */
.chatbot-footer {
  text-align: center;
  padding: 8px;
  background: #f8f9fb;
  border-top: 1px solid #eef0f4;
}

.chatbot-footer-text {
  font-size: 10.5px;
  color: #9ca3af;
  margin: 0;
  font-family: 'Bodoni Moda', serif;
}

.chatbot-footer-text strong {
  color: #14213d;
  font-weight: 700;
}

/* ===== WELCOME TOOLTIP ===== */
.chatbot-tooltip {
  position: fixed;
  bottom: 100px;
  right: 28px;
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 9997;
  max-width: 260px;
  animation: chatbot-tooltip-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-tooltip:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}

.chatbot-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 26px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.05);
}

.chatbot-tooltip-text {
  font-size: 13.5px;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.5;
  font-family: 'Bodoni Moda', serif;
}

.chatbot-tooltip-text strong {
  color: #fca311;
}

.chatbot-tooltip-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #9ca3af;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.chatbot-tooltip-close:hover {
  background: #f1f3f7;
  color: #333;
}

@keyframes chatbot-tooltip-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 480px) {
  .chatbot-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .chatbot-messages {
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
    min-height: 300px;
  }

  .chatbot-toggle-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }

  .chatbot-tooltip {
    right: 20px;
    bottom: 85px;
    max-width: 220px;
  }

  .chatbot-quick-reply-btn {
    font-size: 12px;
    padding: 7px 14px;
  }
}

@media (max-width: 768px) and (min-width: 481px) {
  .chatbot-window {
    width: 370px;
    right: 16px;
    bottom: 90px;
  }

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

  .chatbot-tooltip {
    right: 16px;
    bottom: 85px;
  }
}
