/* --- Live Chat Widget --- */
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.chat-button {
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, #ff4da6, #ff6b9d);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 77, 166, 0.3);
  transition: all 0.3s ease;
  color: white;
  font-size: 1.5rem;
}

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 77, 166, 0.4);
}

.chat-modal {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: #1a1a2e;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 77, 166, 0.3);
}

.chat-header {
  background: linear-gradient(45deg, #ff4da6, #ff6b9d);
  color: white;
  padding: 15px 20px;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.close-chat {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.close-chat:hover {
  opacity: 0.8;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #0f0f1e;
  border-radius: 0 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 75%;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 0.9rem;
  width: fit-content;
  display: inline-block;
}

.chat-message.user {
  background: #667eea;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message.bot {
  background: #2a2a3e;
  color: #e6eef8;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message.bot strong,
.chat-message.bot b {
  color: #ff6b9d;
  font-weight: 700;
}

.chat-message.bot a {
  color: #60a5fa;
  text-decoration: underline;
}

.chat-message.bot a:hover {
  color: #93c5fd;
}

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

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

/* Typing indicator */
.typing-indicator {
  padding: 10px 14px;
  border-radius: 18px;
  background: #2a2a3e;
  width: fit-content;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.chat-input {
  display: flex;
  padding: 15px;
  background: #1a1a2e;
  border-top: 1px solid rgba(255, 77, 166, 0.2);
  border-radius: 0 0 20px 20px;
}

#message-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid rgba(255, 77, 166, 0.3);
  border-radius: 20px;
  outline: none;
  font-size: 0.9rem;
  background: #2a2a3e;
  color: #e6eef8;
}

#message-input::placeholder {
  color: #94a3b8;
}

#message-input:focus {
  border-color: #ff4da6;
  box-shadow: 0 0 0 2px rgba(255, 77, 166, 0.1);
}

#send-button {
  margin-left: 10px;
  padding: 10px 20px;
  background: linear-gradient(45deg, #ff4da6, #ff6b9d);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

#send-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 77, 166, 0.3);
}

@media (max-width: 768px) {
  .chat-modal {
    position: fixed;
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    max-height: 600px;
    left: 50%;
    right: auto;
    bottom: 50%;
    transform: translate(-50%, 50%);
  }
  
  .chat-button {
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
    bottom: 15px;
    right: 15px;
  }
  
  .chat-widget {
    bottom: 15px;
    right: 15px;
  }
  
  .chat-messages {
    font-size: 0.9rem;
    padding: 12px;
  }
  
  .chat-message {
    font-size: 0.85rem;
    max-width: 85%;
  }
  
  #message-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .chat-input {
    padding: 12px;
  }
  
  #send-button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}
