/* General Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-image: url('ai.jpg'); /* Add your image path here */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #333;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  background: #ffffff80;
  width: 100%;
  max-width: 600px;
  height: 90vh;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.header {
  background: linear-gradient(135deg, #53a3ff, #004891); /* Gradient background */
  padding: 0.3rem;
  text-align: center;
  color: #ffffff;
  display: flex;
  
  align-items: center;
  justify-content: center;
 }

.logo {
  width: 40px;
  height: 40px;
  
}

.header h1 {
  font-size: 1.5rem;
  margin: 0;
}

/* Chat Container */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f9f900;
}

/* Messages */
.message {
  max-width: 70%;
  padding: 10px 15px;
  border-radius: 15px;
  font-size: 0.9rem;
  line-height: 1.4;
  position: relative;
  animation: slideIn 0.3s ease-out;
}

.user-message {
  background: #0077ff62;
  color: #000000;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.ai-message {
  background: #e5e5ea;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: pre-wrap; /* Preserve formatting in AI's response */
}

/* Input Area */
.input-group {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 1rem;
  background: #ffffff00;
  border-top: 1px solid #ddd;
}

textarea {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.9rem;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  background: #f9f9f9;
  outline: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

button {
  padding: 10px 20px;
  background: #0077ff;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #005bb5;
}

/* Loading Animation */
#loading {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  display: none;
}

.loading-message {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-style: italic;
}

.loading-dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #666;
  margin: 0 2px;
  animation: bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}
@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar Styling */
.chat-container::-webkit-scrollbar {
  width: 8px;
}

.chat-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .container {
    width: 95%;
    height: 90vh;
    padding: 0.5rem;
  }
  h1 {
    font-size: 1.5rem;
  }

  p {
    font-size: 0.9rem;
  }

  .message {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  textarea {
    font-size: 0.8rem;
    min-height: 35px;
  }

  button {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .chat-container {
    height: 70vh;
  }

  .header{
    padding: 0.5rem; /* Reduce padding for smaller screens */
    border-radius: 15px; /* Add border radius */
    gap: 5px; /* Reduce gap between items */
   }

   .header h1 {
    font-size: 1.5rem; /* Reduce font size for smaller screens */
  }
}
.send-button {
  padding: 10px;
  background: #0077ff;
  color: #fff;
  border: none;
  border-radius: 50%; /* Makes the button circular */
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.3s ease;
  width: 40px; /* Fixed width */
  height: 40px; /* Fixed height */
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button:hover {
  background: #005bb5;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .send-button {
    padding: 8px;
    font-size: 1rem;
    width: 36px; /* Slightly smaller for mobile */
    height: 36px;
  }
}

/* Make the container wider on desktop */
@media (min-width: 768px) {
  .container {
    max-width: 80vw; /* Adjusts width to 80% of the viewport */
    height: 90vh; /* Stretches the height */
  }
}

/* Ensure chat container fills space */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f9f900;
  height: calc(100% - 80px); /* Adjust based on header & input */
}

/* Mobile styles remain unchanged */
@media (max-width: 600px) {
  .container {
    width: 95%;
    height: 90vh;
  }
}
