.ai-chat {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 380px;
  background: var(--glass-effect);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom right;
}

.chat-header {
  background: var(--accent);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.chat-header h3 {
  margin: 0;
  color: white;
  font-size: 1.2em;
  position: relative;
  display: inline-block;
}

.chat-header h3::before {
  content: '●';
  position: absolute;
  left: -20px;
  color: var(--highlight);
  animation: pulse 2s infinite;
}

.chat-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2em;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.chat-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(180deg);
}

.chat-messages {
  height: 350px;
  overflow-y: auto;
  padding: 20px;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.05);
}

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

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

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

.chat-messages.open {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.message {
  margin-bottom: 15px;
  max-width: 85%;
  animation: messageAppear 0.3s ease-out;
}

.message.ai {
  margin-right: auto;
  background: rgba(255, 0, 64, 0.15);
  padding: 12px 16px;
  border-radius: 18px 18px 18px 0;
  border-left: 3px solid var(--accent);
  color: rgba(255, 255, 255, 0.95);
  position: relative;
}

.message.ai::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -10px;
  width: 10px;
  height: 15px;
  background: transparent;
  border-bottom-right-radius: 10px;
  box-shadow: 3px 3px 0 0 rgba(255, 0, 64, 0.15);
}

.message.user {
  margin-left: auto;
  background: rgba(255, 215, 0, 0.15);
  padding: 12px 16px;
  border-radius: 18px 18px 0 18px;
  border-right: 3px solid var(--highlight);
  position: relative;
}

.message.user::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: -10px;
  width: 10px;
  height: 15px;
  background: transparent;
  border-bottom-left-radius: 10px;
  box-shadow: -3px 3px 0 0 rgba(255, 215, 0, 0.15);
}

.chat-input {
  padding: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

.chat-input.open {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

.chat-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 12px 18px;
  border-radius: 30px;
  color: var(--text);
  margin-right: 10px;
  outline: none;
  transition: all 0.3s ease;
}

.chat-input input:focus {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px rgba(255, 0, 64, 0.1);
}

.chat-input input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-input button {
  background: var(--accent);
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.chat-input button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
}

.chat-input button:hover {
  background: linear-gradient(to right, var(--accent), #ff3060);
  box-shadow: 0 5px 15px rgba(255, 0, 64, 0.3);
  transform: translateY(-2px);
}

.chat-input button:hover::after {
  transform: translateX(100%);
  transition: transform 0.5s ease;
}

.typing-indicator {
  display: inline-block;
}

.typing-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  animation: blink 1.4s infinite;
  animation-fill-mode: both;
  margin-right: 5px;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
  background-color: rgba(255, 0, 64, 0.8);
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
  background-color: rgba(255, 0, 64, 0.6);
}

@media (max-width: 768px) {
  .ai-chat {
    width: 300px;
    bottom: 20px;
    right: 20px;
  }
}

