/* LedcraftBot Chatbot Styles */
.ledcraftbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: "DM Sans", sans-serif;
}

/* Floating Chat Button */
.ledcraftbot-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fe5b2c 0%, #e14a1f 100%);
  border: none;
  box-shadow: 0 4px 20px rgba(254, 91, 44, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.ledcraftbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(254, 91, 44, 0.6);
}

/* Speech Balloon */
.ledcraftbot-balloon {
  position: absolute;
  bottom: 80px;
  right: 0;
  background: white;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 300px;
  animation: balloonBounce 0.5s ease;
  display: none;
  font-family: "DM Sans", sans-serif;
}

.ledcraftbot-balloon.show {
  display: block;
}

.ledcraftbot-balloon::after {
  content: "";
  position: absolute;
  bottom: -10px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid white;
}

.ledcraftbot-balloon-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ledcraftbot-balloon-text {
  flex: 1;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.ledcraftbot-balloon-close {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.ledcraftbot-balloon-close:hover {
  color: #333;
}

@keyframes balloonBounce {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ledcraftbot-button svg {
  width: 30px;
  height: 30px;
  fill: white;
}

.ledcraftbot-button .close-icon {
  display: none;
}

.ledcraftbot-button.active .chat-icon {
  display: none;
}

.ledcraftbot-button.active .close-icon {
  display: block;
}

/* Notification Badge */
.ledcraftbot-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4444;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Chat Window */
.ledcraftbot-chat {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 550px;
  max-height: calc(100vh - 140px);
  background: white;
  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 ease;
}

.ledcraftbot-chat.active {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.ledcraftbot-header {
  background: linear-gradient(135deg, #fe5b2c 0%, #e14a1f 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ledcraftbot-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.ledcraftbot-header-info h4 {
  margin: 0;
  font-size: 16px;
  color: white;
  font-weight: 600;
}

.ledcraftbot-header-info p {
  margin: 0;
  font-size: 12px;
  opacity: 0.9;
}

/* Chat Messages */
.ledcraftbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ledcraftbot-messages::-webkit-scrollbar {
  width: 6px;
}

.ledcraftbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.ledcraftbot-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Message Bubble */
.ledcraftbot-message {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ledcraftbot-message.bot {
  align-items: flex-start;
}

.ledcraftbot-message.user {
  justify-content: flex-end;
}

.ledcraftbot-message-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fe5b2c 0%, #e14a1f 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ledcraftbot-message-content {
  max-width: 75%;
}

.ledcraftbot-message.bot .ledcraftbot-message-bubble {
  background: white;
  color: #333;
  border-radius: 0 12px 12px 12px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ledcraftbot-message.user .ledcraftbot-message-bubble {
  background: linear-gradient(135deg, #fe5b2c 0%, #e14a1f 100%);
  color: white;
  border-radius: 12px 0 12px 12px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(254, 91, 44, 0.3);
}

.ledcraftbot-message-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Typing Indicator */
.ledcraftbot-typing {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ledcraftbot-typing.active {
  display: flex;
}

.ledcraftbot-typing-dots {
  display: flex;
  gap: 4px;
}

.ledcraftbot-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fe5b2c;
  animation: typing 1.4s infinite;
}

.ledcraftbot-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ledcraftbot-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Options Buttons */
.ledcraftbot-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.ledcraftbot-option-btn {
  background: white;
  border: 2px solid #fe5b2c;
  color: #fe5b2c;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: left;
  font-family: "DM Sans", sans-serif;
}

.ledcraftbot-option-btn:hover {
  background: #fe5b2c;
  color: white;
  transform: translateX(5px);
}

.ledcraftbot-option-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Product Card in Chat */
.ledcraftbot-product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  margin-top: 10px;
}

.ledcraftbot-product-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.ledcraftbot-product-info {
  padding: 15px;
}

.ledcraftbot-product-info h5 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.ledcraftbot-product-info p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.ledcraftbot-product-info .btn {
  display: inline-block;
  padding: 8px 16px;
  background: #fe5b2c;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s ease;
  font-family: "DM Sans", sans-serif;
}

.ledcraftbot-product-info .btn:hover {
  background: #e14a1f;
}

/* Chat Footer */
.ledcraftbot-footer {
  padding: 15px 20px;
  background: white;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ledcraftbot-restart {
  background: transparent;
  border: 1px solid #ddd;
  color: #666;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: "DM Sans", sans-serif;
}

.ledcraftbot-restart:hover {
  background: #f8f9fa;
  border-color: #fe5b2c;
  color: #fe5b2c;
}

.ledcraftbot-powered {
  font-size: 11px;
  color: #999;
  text-align: center;
  flex: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ledcraftbot-container {
    bottom: 20px;
    right: 20px;
  }

  .ledcraftbot-chat {
    width: calc(100vw - 40px);
    height: calc(100vh - 140px);
    bottom: 90px;
  }

  .ledcraftbot-button {
    width: 55px;
    height: 55px;
  }

  .ledcraftbot-button svg {
    width: 26px;
    height: 26px;
  }

  .ledcraftbot-balloon {
    max-width: 240px;
    bottom: 85px;
    font-size: 13px;
  }

  .ledcraftbot-balloon-text {
    font-size: 13px;
  }
}
