/* ═══════════════════════════════════════════════
   ACStudioX AI Chatbot - Futuristic Design
   ═══════════════════════════════════════════════ */

.chatbot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(5, 5, 10, 0.95);
  border: 2px solid #0df2c4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(13, 242, 196, 0.4), 0 0 0 0 rgba(13, 242, 196, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: chatbotPulse 2s ease-in-out infinite;
  padding: 8px;
}

@keyframes chatbotPulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(13, 242, 196, 0.3), 0 0 0 0 rgba(13, 242, 196, 0.4);
  }
  50% {
    box-shadow: 0 8px 32px rgba(13, 242, 196, 0.4), 0 0 0 12px rgba(13, 242, 196, 0);
  }
}

.chatbot-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(13, 242, 196, 0.6);
  border-color: #8b5cf6;
}

.chatbot-toggle.active {
  background: #0df2c4;
  border-color: #0df2c4;
}

.chatbot-icon,
.chatbot-close {
  width: 28px;
  height: 28px;
  color: #fff;
  transition: all 0.3s;
}

.chatbot-toggle img.chatbot-icon {
  width: 70px !important;
  height: 70px !important;
  object-fit: contain;
}

.chatbot-toggle.active .chatbot-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}

.chatbot-close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

.chatbot-toggle.active .chatbot-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}

.chatbot-toggle.active .chatbot-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.chatbot-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #ec4899;
  border-radius: 50%;
  border: 3px solid #05050a;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Chat Window */
.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 400px;
  height: 600px;
  background: #0c0c18;
  border: 1px solid rgba(13, 242, 196, 0.2);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(13, 242, 196, 0.1);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

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

/* Header */
.chatbot-header {
  padding: 20px;
  background: linear-gradient(135deg, rgba(13, 242, 196, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-bottom: 1px solid rgba(13, 242, 196, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.chatbot-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(13, 242, 196, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(13, 242, 196, 0.1);
  border: 2px solid rgba(13, 242, 196, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.chatbot-avatar svg {
  width: 24px;
  height: 24px;
}

.chatbot-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #eeeef8;
  letter-spacing: -0.01em;
}

.chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8888aa;
  font-family: 'Space Mono', monospace;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #0df2c4;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.chatbot-minimize {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chatbot-minimize:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(13, 242, 196, 0.3);
}

.chatbot-minimize svg {
  width: 18px;
  height: 18px;
  color: #8888aa;
}

/* Messages */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #05050a;
  position: relative;
}

.chatbot-messages::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(13, 242, 196, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 242, 196, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.5;
}

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

.chatbot-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(13, 242, 196, 0.3);
  border-radius: 99px;
}

.chatbot-message {
  display: flex;
  gap: 10px;
  animation: messageSlide 0.3s ease-out;
  position: relative;
  z-index: 1;
}

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

.bot-message {
  align-items: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 242, 196, 0.1);
  border: 1px solid rgba(13, 242, 196, 0.2);
}

.message-avatar svg {
  width: 20px;
  height: 20px;
}

.message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
}

.bot-message .message-content {
  background: rgba(13, 242, 196, 0.08);
  border: 1px solid rgba(13, 242, 196, 0.2);
  color: #eeeef8;
  border-radius: 16px 16px 16px 4px;
}

.user-message .message-content {
  background: linear-gradient(135deg, #0df2c4 0%, #8b5cf6 100%);
  color: #000;
  font-weight: 500;
  border-radius: 16px 16px 4px 16px;
}

/* Typing Indicator */
.typing-indicator .message-content {
  padding: 16px;
}

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

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #0df2c4;
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

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

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

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Suggestions */
.chatbot-suggestions {
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(13, 242, 196, 0.1);
  background: rgba(13, 242, 196, 0.02);
}

.suggestion-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(13, 242, 196, 0.08);
  border: 1px solid rgba(13, 242, 196, 0.2);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: #0df2c4;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Space Mono', monospace;
}

.suggestion-chip:hover {
  background: rgba(13, 242, 196, 0.15);
  border-color: rgba(13, 242, 196, 0.4);
  transform: translateY(-2px);
}

.suggestion-chip svg {
  width: 14px;
  height: 14px;
}

/* Input */
.chatbot-input-wrapper {
  padding: 16px 20px;
  background: #0c0c18;
  border-top: 1px solid rgba(13, 242, 196, 0.2);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(13, 242, 196, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: #eeeef8;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.2s;
}

.chatbot-input:focus {
  border-color: rgba(13, 242, 196, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(13, 242, 196, 0.1);
}

.chatbot-input::placeholder {
  color: #44445a;
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0df2c4 0%, #8b5cf6 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(13, 242, 196, 0.3);
}

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

.chatbot-send svg {
  width: 20px;
  height: 20px;
  color: #000;
}

/* Tablet Responsive (1024px and below) */
@media (max-width: 1024px) {
  .chatbot-window {
    width: 380px;
    height: 550px;
  }
}

/* Mobile Responsive (768px and below) */
@media (max-width: 768px) {
  .chatbot-container {
    bottom: 16px;
    right: 16px;
  }

  .chatbot-toggle {
    width: 64px;
    height: 64px;
  }

  .chatbot-toggle img {
    width: 56px !important;
    height: 56px !important;
  }

  .chatbot-icon,
  .chatbot-close {
    width: 28px;
    height: 28px;
  }

  .chatbot-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    bottom: 88px;
    right: 0;
    max-width: 420px;
  }

  .chatbot-header {
    padding: 14px 16px;
  }

  .chatbot-avatar {
    width: 36px;
    height: 36px;
  }

  .chatbot-title {
    font-size: 15px;
  }

  .chatbot-status {
    font-size: 11px;
  }

  .chatbot-messages {
    padding: 14px;
    gap: 14px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
  }

  .message-content {
    max-width: 80%;
    font-size: 13px;
    padding: 10px 14px;
    line-height: 1.5;
  }

  .chatbot-suggestions {
    padding: 10px 14px;
    gap: 6px;
  }

  .suggestion-chip {
    font-size: 11px;
    padding: 7px 12px;
  }

  .chatbot-input-wrapper {
    padding: 12px 14px;
    gap: 8px;
  }

  .chatbot-input {
    font-size: 14px;
    padding: 10px 14px;
  }

  .chatbot-send {
    width: 40px;
    height: 40px;
  }

  .chatbot-send svg {
    width: 18px;
    height: 18px;
  }
}

/* Small Mobile (540px and below) */
@media (max-width: 540px) {
  .chatbot-toggle {
    width: 60px;
    height: 60px;
  }

  .chatbot-toggle img {
    width: 52px !important;
    height: 52px !important;
  }

  .chatbot-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 80px);
    bottom: 76px;
    right: 0;
  }

  .message-content {
    max-width: 85%;
    font-size: 13px;
  }

  .chatbot-suggestions {
    flex-wrap: wrap;
  }

  .suggestion-chip {
    flex: 0 0 calc(50% - 4px);
    justify-content: center;
    font-size: 10px;
    padding: 6px 10px;
  }
}

/* Extra Small Mobile (480px and below) */
@media (max-width: 480px) {
  .chatbot-container {
    bottom: 12px;
    right: 12px;
  }

  .chatbot-toggle {
    width: 56px;
    height: 56px;
  }

  .chatbot-toggle img {
    width: 48px !important;
    height: 48px !important;
  }

  .chatbot-window {
    width: 100vw;
    height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
    border: none;
  }

  .chatbot-header {
    padding: 12px 14px;
  }

  .chatbot-avatar {
    width: 32px;
    height: 32px;
  }

  .chatbot-title {
    font-size: 14px;
  }

  .chatbot-status {
    font-size: 10px;
  }

  .chatbot-messages {
    padding: 12px;
  }

  .message-avatar {
    width: 26px;
    height: 26px;
  }

  .message-content {
    font-size: 13px;
    padding: 9px 12px;
  }

  .chatbot-input {
    font-size: 14px;
  }
}

/* Extra Small Devices (375px and below) */
@media (max-width: 375px) {
  .chatbot-toggle {
    width: 52px;
    height: 52px;
  }

  .chatbot-toggle img {
    width: 44px !important;
    height: 44px !important;
  }

  .chatbot-header {
    padding: 10px 12px;
  }

  .chatbot-title {
    font-size: 13px;
  }

  .chatbot-messages {
    padding: 10px;
    gap: 12px;
  }

  .message-content {
    font-size: 12px;
    padding: 8px 11px;
  }

  .suggestion-chip {
    font-size: 10px;
    padding: 5px 8px;
  }

  .chatbot-input-wrapper {
    padding: 10px 12px;
  }

  .chatbot-send {
    width: 38px;
    height: 38px;
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .chatbot-window {
    height: calc(100vh - 60px);
    bottom: 70px;
  }

  .chatbot-messages {
    padding: 10px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .chatbot-toggle,
  .chatbot-window,
  .chatbot-message,
  .suggestion-chip {
    animation: none;
    transition: none;
  }
}
