/* Chat Section */
.chat-section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 90vw;
  height: 80vh;
  margin: 2rem auto;
  background: linear-gradient(
    145deg,
    rgba(30, 30, 30, 1) 0%,
    rgba(15, 15, 15, 1) 50%,
    rgb(1, 1, 1) 100%
  );
  border-radius: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-screen {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  border-radius: 1rem;
  padding: 1rem;
  background-color: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  margin-bottom: 1rem;
}

.chat-header {
  text-align: center;
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  position: relative;
}

.chat-header::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 25%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #5B78F6, transparent);
}

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem;
}

.message {
  max-width: 85%;
  padding: 0.8rem 1.2rem;
  border-radius: 1.2rem;
  font-size: 0.95rem;
  word-wrap: break-word;
  line-height: 1.5;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bot-message {
  align-self: flex-start;
  background: rgba(42, 42, 42, 0.8);
  color: #f1f1f1;
  border-bottom-left-radius: 0.3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-message {
  align-self: flex-end;
  background: linear-gradient(135deg, #5B78F6 0%, #3A56C9 100%);
  color: white;
  border-bottom-right-radius: 0.3rem;
  box-shadow: 0 2px 8px rgba(91, 120, 246, 0.3);
}

.input-container {
  display: flex;
  width: 100%;
  margin-top: 1rem;
  background: rgba(26, 26, 26, 0.7);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#user-input {
  flex: 1;
  padding: 1rem;
  border: none;
  font-size: 1rem;
  background: transparent;
  color: #fff;
  outline: none;
}

#user-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#send-btn {
  padding: 0 1.5rem;
  border: none;
  background: transparent;
  color: #5B78F6;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#send-btn:hover {
  color: #fff;
  background: rgba(91, 120, 246, 0.2);
}

#send-btn i {
  font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .chat-section {
    width: 85vw;
  }
}

@media (max-width: 992px) {
  .chat-section {
    height: 75vh;
    padding: 1.2rem;
  }
  
  .message {
    max-width: 90%;
    padding: 0.7rem 1rem;
  }
}

@media (max-width: 768px) {
  .chat-section {
    width: 95vw;
    height: 70vh;
    margin: 1rem auto;
    border-radius: 1.5rem;
  }
  
  .chat-header {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  .message {
    font-size: 0.9rem;
  }
  
  #user-input {
    padding: 0.8rem;
  }
}

@media (max-width: 576px) {
  .chat-section {
    width: 100vw;
    height: 80vh;
    margin: 0;
    border-radius: 0;
    padding: 1rem;
  }
  
  .chat-screen {
    padding: 0.8rem;
    border-radius: 0.8rem;
  }
  
  .message {
    max-width: 95%;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
  }
  
  .input-container {
    border-radius: 1.2rem;
  }
  
  #user-input {
    font-size: 0.9rem;
  }
  
  #send-btn {
    padding: 0 1rem;
  }
}

/* Animation for typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 0.8rem 1.2rem;
  background: rgba(42, 42, 42, 0.8);
  border-radius: 1.2rem;
  width: fit-content;
  margin-bottom: 1rem;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  margin: 0 2px;
  background-color: #5B78F6;
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.5s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}