.ai-chat-btn {
  position: fixed;
  bottom: 25px;
  left: 270px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  overflow: hidden;
  z-index: 99999;
  background: linear-gradient(135deg, #151936, #1e1b4b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(76, 70, 229, 0.55), 0 0 40px rgba(0, 194, 255, 0.18);
  animation: aiFloat 3s ease-in-out infinite;
}
.ai-chat-btn:before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  animation: rotateRing 5s linear infinite;
}
.ai-chat-btn:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 194, 255, 0.35), transparent 70%);
  animation: aiThinking 2.5s ease-in-out infinite;
  z-index: -1;
}
.ai-chat-btn i {
  font-size: 30px;
  color: #fff;
  z-index: 2;
}
.ai-chat-btn:hover {
  transform: scale(1.08);
  transition: .3s;
}
.ai-chat-btn .ai-chat-btn__image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  z-index: 2;
  animation: aiBreathAnimation 2.5s ease-in-out infinite;
}
@keyframes aiFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes rotateRing {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes pulseGlow {
  0% {
    transform: scale(1);
    opacity: .8;
  }
  70% {
    transform: scale(1.4);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes bounceDot {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
@keyframes aiBreathAnimation {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(0, 194, 255, 0.5));
  }
  50% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 20px rgba(108, 99, 255, 0.9));
  }
}
@keyframes aiThinking {
  0% {
    transform: scale(1);
    opacity: .3;
  }
  50% {
    transform: scale(1.5);
    opacity: .8;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
.carbonate-ai-box {
  position: fixed;
  bottom: 20px;
  left: 280px;
  right: 30px;
  max-width: 950px;
  margin: 0 auto;
}
.carbonate-ai-input {
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dbe3ef;
  border-radius: 28px;
  padding: 15px 18px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  transition: all .3s ease;
}
.carbonate-ai-input:focus-within {
  border-color: #6C63FF;
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1), 0 10px 40px rgba(15, 23, 42, 0.12);
}
.ai-logo {
  margin-right: 12px;
}
.ai-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.carbonate-ai-input textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  min-height: 30px;
  max-height: 180px;
  font-size: 16px;
  padding-top: 8px;
}
.send-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 8px;
  background: linear-gradient(135deg, #6c63ff, #8b5cf6);
  transition: .3s;
}
.send-btn img {
  width: 20px;
  height: 20px;
}
.send-btn:hover {
  transform: scale(1.08);
}
.ai-chat-messages {
  position: fixed;
  top: 80px;
  left: 280px;
  right: 0;
  bottom: 140px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ai-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.ai-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(108, 99, 255, 0.4);
  border-radius: 999px;
}
.message {
  display: flex;
  gap: 12px;
  animation: fadeIn .25s ease;
}
.message-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.message-content {
  max-width: 65%;
}
.message-name {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 5px;
}
.message-text {
  background: #ffffff;
  padding: 14px 18px;
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  color: #1e293b;
  line-height: 1.6;
}
.message-user {
  justify-content: flex-end;
}
.message-user .message-content {
  max-width: 55%;
}
.message-user .message-text {
  background: linear-gradient(135deg, #6c63ff, #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.message-ai {
  align-items: flex-start;
}
.message-ai .message-text {
  border-bottom-left-radius: 6px;
}
.message-ai .message-avatar {
  flex-shrink: 0;
}
.typing-loader {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
}
.typing-loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #888;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-loader span:nth-child(1) {
  animation-delay: 0s;
}
.typing-loader span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-loader span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}
#sendAibtn:disabled,
#aiPrompt:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.scroll-bottom-btn {
  position: fixed;
  left: 55%;
  transform: translateX(-50%);
  bottom: 150px;
  width: 35px;
  height: 35px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
  display: none;
  background: rgba(241, 245, 249, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transition: all .3s ease;
}
.scroll-bottom-btn img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}
.scroll-bottom-btn:hover {
  transform: translateX(-50%) translateY(-3px);
}
.download-flow {
  margin-top: 16px;
}
.download-status {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.download-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #8a8f98;
  line-height: 1.5;
}
.download-step.active {
  color: #2f3542;
  font-weight: 500;
}
.download-step.active .step-dot {
  background: #5b7cff;
  animation: pulseDot 1.2s infinite;
}
.download-step.completed {
  color: #5b6575;
}
.download-step.completed .step-dot {
  background: #5b7cff;
  animation: none;
}
.download-step.active-final {
  color: #111827;
  font-weight: 600;
}
.download-step.active-final .step-dot {
  background: #5b7cff;
  animation: pulseDot 1.2s infinite;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8dee9;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.8);
    opacity: .45;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.ai-chat-header {
  position: relative;
}
.token-badge {
  min-width: 50px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
