
/* AI Чатбот стилове */
#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: 'Inter', sans-serif;
}

/* Чат бутон */
.chat-toggle {
  width: 60px;
  height: 60px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
  transition: all 0.3s ease;
  position: relative;
  animation: chatBounce 2s ease-in-out infinite;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
}

.chat-toggle.active {
  background: #dc3545;
  animation: none;
}

.chat-icon {
  position: relative;
  font-size: 1.5rem;
  color: white;
}

.chat-icon-open {
  display: none;
}

.chat-toggle.active .chat-icon-closed {
  display: none;
}

.chat-toggle.active .chat-icon-open {
  display: inline;
}

.chat-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.3);
  animation: chatPulse 2s ease-in-out infinite;
  pointer-events: none;
}

.chat-toggle.active .chat-pulse {
  display: none;
}

/* Чат прозорец */
.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;
}

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

/* Хедър на чата */
.chat-header {
  background: var(--primary-color);
  color: white;
  padding: 15px 20px;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chat-logo {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header-info h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.chat-status {
  font-size: 0.8rem;
  color: #4CAF50;
  font-weight: 500;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Съобщения */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #f8f9fa;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 2px;
}

.message {
  display: flex;
  gap: 10px;
  max-width: 100%;
  animation: messageSlideIn 0.3s ease;
}

.bot-message {
  justify-content: flex-start;
}

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

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-message .message-avatar {
  background: var(--primary-color);
  color: white;
}

.message-content {
  max-width: 75%;
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
}

.user-message .message-content {
  background: var(--accent-color);
  color: white;
}

.message-content p {
  margin: 0;
  line-height: 1.4;
  font-size: 0.9rem;
  white-space: pre-line;
}

/* Бързи въпроси */
.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.quick-btn:hover {
  background: white;
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Индикатор за писане */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-light);
  font-size: 0.9rem;
  background: white;
  border-top: 1px solid #e0e0e0;
}

.typing-indicator {
  display: flex;
  gap: 3px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--accent-color);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite both;
}

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

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

/* Поле за въвеждане */
.chat-input-container {
  border-top: 1px solid #e0e0e0;
  background: white;
  border-radius: 0 0 20px 20px;
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  gap: 12px;
}

#chat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 25px;
  padding: 10px 15px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

#chat-input:focus {
  border-color: var(--accent-color);
}

#chat-send {
  background: var(--accent-color);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

#chat-send:hover {
  background: #e55a2b;
  transform: scale(1.05);
}

.send-icon {
  font-size: 1rem;
}

/* Анимации */
@keyframes chatBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes chatPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

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

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Responsive дизайн */
@media (max-width: 768px) {
  /* По-малок чатбот в долния десен ъгъл */
  #chatbot-container {
    bottom: 15px;
    right: 15px;
  }
  
  .chat-window {
    width: 300px;
    height: 420px;
    bottom: 60px;
    right: -5px;
  }
  
  .chat-toggle {
    width: 50px;
    height: 50px;
  }
  
  .chat-icon {
    font-size: 1.2rem;
  }
  
  /* По-голям бутон за затваряне */
  .chat-close {
    font-size: 1.5rem;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Намаляване на хедъра */
  .chat-header {
    padding: 12px 15px;
  }
  
  .chat-logo {
    width: 30px;
    height: 30px;
  }
  
  .chat-header-info h4 {
    font-size: 0.95rem;
  }
  
  /* Оптимизиране на съобщенията */
  .chat-messages {
    padding: 15px;
  }
  
  .message-content {
    font-size: 0.85rem;
    padding: 10px 14px;
  }
  
  /* Намаляване на полето за въвеждане */
  .chat-input-wrapper {
    padding: 12px 15px;
  }
  
  #chat-input {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
  
  #chat-send {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  /* Още по-малък чатбот на малки екрани */
  #chatbot-container {
    bottom: 10px;
    right: 10px;
  }
  
  .chat-toggle {
    width: 45px;
    height: 45px;
  }
  
  .chat-icon {
    font-size: 1.1rem;
  }
  
  .chat-window {
    width: calc(100vw - 20px);
    max-width: 350px;
    right: 10px;
    left: auto;
    height: calc(100vh - 150px);
    max-height: 450px;
    bottom: 55px;
  }
  
  /* Още по-голям бутон за затваряне на мобилни устройства */
  .chat-close {
    font-size: 1.8rem;
    min-width: 48px;
    min-height: 48px;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  /* По-малки шрифтове */
  .chat-status {
    font-size: 0.75rem;
  }
  
  .quick-btn {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
  
  /* Предотвратяване на припокриване с навигацията */
  .chat-window {
    z-index: 9999;
  }
  
  #chatbot-container {
    z-index: 9998;
  }
}

/* Skip link стилове */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: 6px;
}
