/* GoGifts Assistant - Customer Support Chatbot Styles */

.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Floating Button */
.chatbot-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(219, 39, 119, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(219, 39, 119, 0.4);
  }
  50% {
    box-shadow: 0 4px 30px rgba(219, 39, 119, 0.6);
  }
}

.chatbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(219, 39, 119, 0.5);
  animation: none;
}

.chatbot-button svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* Chat Window */
.chatbot-window {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 380px;
  height: auto;
  max-height: 80vh;
  background: var(--bg-white, #ffffff);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border-color, #e5e7eb);
}

.chatbot-window.active {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.chatbot-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chatbot-header-text p {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
  width: 32px;
  height: 32px;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.chatbot-close svg {
  width: 20px;
  height: 20px;
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-light, #f9fafb);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-message {
  display: flex;
  gap: 10px;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message.user {
  flex-direction: row-reverse;
}

.chatbot-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
}

.chatbot-message-content {
  max-width: 75%;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: #000000;
}

.chatbot-message.user .chatbot-message-content {
  background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%);
  color: white;
}

.chatbot-message-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #000000;
}

.chatbot-message.user .chatbot-message-text {
  color: white;
}

.chatbot-message-time {
  font-size: 11px;
  color: var(--text-gray, #6b7280);
  margin-top: 4px;
}

.chatbot-message.user .chatbot-message-time {
  color: rgba(255, 255, 255, 0.8);
}

/* Typing Indicator */
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.chatbot-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #db2777;
  animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Input Area */
.chatbot-input-area {
  padding: 16px;
  background: white;
  border-top: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
  font-family: inherit;
}

.chatbot-input:focus {
  border-color: #db2777;
  box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.1);
}

.chatbot-input::placeholder {
  color: var(--text-gray, #6b7280);
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(219, 39, 119, 0.3);
}

.chatbot-send:active:not(:disabled) {
  transform: scale(1.05);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot-send svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* Error Message */
.chatbot-error {
  background: #fee2e2;
  color: #dc2626;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0;
  text-align: center;
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(219, 39, 119, 0.3);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(219, 39, 119, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chatbot-window {
    width: calc(100vw - 40px);
    max-width: 380px;
  }
}

@media (max-width: 480px) {
  .chatbot-container {
    bottom: 10px;
    right: 10px;
  }

  .chatbot-button {
    width: 56px;
    height: 56px;
  }

  .chatbot-button svg {
    width: 24px;
    height: 24px;
  }

  .chatbot-window {
    bottom: 70px;
    right: -10px;
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    max-height: 600px;
    border-radius: 12px;
  }

  .chatbot-header {
    padding: 16px;
  }

  .chatbot-messages {
    padding: 16px;
  }

  .chatbot-message-content {
    max-width: 80%;
  }

  .chatbot-input-area {
    padding: 12px;
  }
}