/* Chatbot Styles */
.chatbot-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(15, 139, 141, 0.3);
}

.chatbot-toggle.open {
  transform: rotate(90deg);
  background: #ef4444;
}

.chatbot-icon,
.chatbot-close-icon {
  width: 28px;
  height: 28px;
  position: absolute;
  transition: all 0.3s ease;
}

.chatbot-close-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

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

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

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 380px;
  height: 600px;
  max-height: 80vh;
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.chatbot-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.chatbot-header p {
  margin: 0.2rem 0 0 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

.chatbot-minimize {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 0.5rem;
}

.chatbot-minimize:hover {
  opacity: 1;
}

.chatbot-minimize svg {
  width: 20px;
  height: 20px;
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f9fafb;
}

.chatbot-message {
  display: flex;
  gap: 0.8rem;
  max-width: 85%;
  animation: messageSlide 0.3s ease forwards;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.message-avatar {
  width: 32px;
  height: 32px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.message-content {
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.bot-message .message-content {
  background: white;
  border-bottom-left-radius: 0.2rem;
  color: var(--text-main);
}

.user-message .message-content {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 0.2rem;
}

/* Input Area */
.chatbot-input-wrapper {
  padding: 1rem;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  color: #1f2937;
  /* Ciemny tekst */
  background: #ffffff;
  /* Białe tło */
}

.chatbot-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.1);
}

.chatbot-send,
.chatbot-mic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-send {
  background: var(--primary);
  color: white;
}

.chatbot-send:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

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

/* Typing Indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 1rem 1.2rem !important;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

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

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

@keyframes typing {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chatbot-window {
    width: 100%;
    height: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

  .chatbot-toggle {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}