/* Chatbot Widget Styles */

/* Chat Toggle Button */
.chat-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4FC3F7 0%, #9C27B0 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(79, 195, 247, 0.4);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(79, 195, 247, 0.5);
}

.chat-toggle-btn svg {
  width: 28px;
  height: 28px;
  fill: white;
}

.chat-toggle-btn .chat-icon-close {
  display: none;
}

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

.chat-toggle-btn.active .chat-icon-close {
  display: block;
}

/* Chat Widget Container */
.chat-widget {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 500px;
  max-height: calc(100vh - 140px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 9997;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
}

.chat-widget.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #4FC3F7 0%, #9C27B0 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-avatar svg {
  width: 24px;
  height: 24px;
  fill: white;
}

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

.chat-header-info p {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.9;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fa;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.bot {
  background: #ffffff;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.user {
  background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Bot message formatting */
.chat-message.bot p {
  margin: 0 0 10px 0;
}

.chat-message.bot p:last-child {
  margin-bottom: 0;
}

.chat-message.bot ul {
  margin: 8px 0;
  padding-left: 20px;
}

.chat-message.bot li {
  margin: 4px 0;
  line-height: 1.4;
}

.chat-message.bot strong {
  font-weight: 600;
  color: #1a1a2e;
}

.chat-message.bot em {
  font-style: italic;
}

.chat-message.bot .chat-link {
  color: #4FC3F7;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.chat-message.bot .chat-link:hover {
  color: #29B6F6;
  text-decoration: underline;
}

.chat-message.typing {
  display: flex;
  gap: 4px;
  padding: 16px 20px;
}

.chat-message.typing span {
  width: 8px;
  height: 8px;
  background: #4FC3F7;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.chat-message.typing span:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

/* Chat Input */
.chat-input-container {
  padding: 16px;
  background: #ffffff;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.chat-input:focus {
  border-color: #4FC3F7;
}

.chat-input::placeholder {
  color: #999;
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .chat-widget {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 80px);
    max-height: none;
    border-radius: 16px 16px 0 0;
  }
  
  .chat-toggle-btn {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}
