/* Floating Chat Icon */
#chat-icon {
  position: fixed;
  bottom: 15px;
  right: 20px;
  background: linear-gradient(135deg, #ff7e5f, #feb47b);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: transform 0.2s ease;
}

#chat-icon:hover {
  transform: scale(1.1);
}

#chat-icon img {
  width: 30px;
  height: 30px;
}

/* Chatbot Window */
#chatbot-container {
  position: fixed;
  bottom: 80px;
  right: 50px;
  width: 350px;
  height: 450px;
  border-radius: 15px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
  background: #ffffff;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
  border: 1px solid #ddd;
}
/* Mobile View Adjustments */
@media screen and (max-width: 768px) {
  /* Floating Chat Icon */
  #chat-icon {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 20px;
  }

  #chat-icon img {
    width: 25px;
    height: 25px;
  }

  /* Chatbot Window */
  #chatbot-container {
    bottom: 70px; /* Reduced space for mobile */
    right: 40px; /* Adjusted to center on smaller screens */
    width: 300px; /* Smaller width for mobile */
    height: 350px; /* Adjusted height */
  }

  #chat-header {
    font-size: 14px; /* Smaller font size for mobile */
    padding: 10px;
  }

  #query {
    font-size: 12px; /* Smaller input field font */
    padding: 8px;
  }

  #send-btn {
    font-size: 12px; /* Smaller button size */
    padding: 8px 14px;
  }

  /* Messages */
  .message {
    font-size: 12px; /* Smaller message text */
    padding: 8px 12px;
  }

  .user-message,
  .bot-message {
    max-width: 70%; /* Allow more space for text */
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#chat-header {
  background: linear-gradient(135deg, #007bff, #00bfff);
  color: white;
  padding: 12px;
  font-weight: bold;
  text-align: center;
  position: relative;
  font-size: 16px;
  letter-spacing: 0.5px;
}

#close-btn {
  position: absolute;
  top: 6px;
  right: 12px;
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s ease;
}

#close-btn:hover {
  color: #ffdddd;
}

#chat-history {
  flex-grow: 1;
  padding: 12px;
  overflow-y: auto;
  background: #f0f4f8;
}

/* Messages */
.message {
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: 20px;
  max-width: 80%;
  clear: both;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.user-message {
  background-color: #d1ffe0;
  align-self: flex-end;
  margin-left: auto;
}

.bot-message {
  background-color: #e4e6eb;
  align-self: flex-start;
  margin-right: auto;
}

/* Chat Input */
#chat-input {
  display: flex;
  padding: 8px;
  border-top: 1px solid #ccc;
  background-color: #fff;
}

#query {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
}

#send-btn {
  margin-left: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #007bff, #00bfff);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#send-btn:hover {
  background: linear-gradient(135deg, #0056b3, #009ac9);
}
#chat-input button i.fa-microphone {
  color: black; /* Default color */
  font-size: 20px; /* Slightly larger for visibility */
  transition: color 0.3s ease; /* Smooth color transition */
  cursor: pointer;
}

#chat-input button.recording i.fa-microphone {
  color: lightgreen; /* Color while recording */
}
.spikes {
  display: flex;
  gap: 3px;
  margin-left: 10px;
  align-items: center;
  height: 24px;
}

.spikes.hidden {
  display: none;
}

.bar {
  width: 3px;
  height: 10px;
  background-color: green;
  animation: spike 0.7s infinite;
}

.bar:nth-child(1) {
  animation-delay: 0s;
}
.bar:nth-child(2) {
  animation-delay: 0.1s;
}
.bar:nth-child(3) {
  animation-delay: 0.2s;
}
.bar:nth-child(4) {
  animation-delay: 0.3s;
}
.bar:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes spike {
  0%,
  100% {
    height: 10px;
  }
  50% {
    height: 24px;
  }
}
@media (max-width: 768px) {
  #chat-input {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
    background: #fff;
    border-top: 1px solid #ccc;
  }

  #query {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }

  #send-btn {
    flex-shrink: 0;
    font-size: 13px;
    padding: 8px 12px;
    margin-left: 6px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
  }
}
/* Existing styles here ... */

/* Responsive adjustments for mobile view */
@media (max-width: 480px) {
  #chat-input button i.fa-microphone {
    font-size: 18px; /* Slightly smaller for small screens */
  }

  .spikes {
    height: 18px; /* Slightly smaller spikes container */
    gap: 2px; /* Less gap on mobile */
    margin-left: 6px; /* Smaller margin for space */
  }

  .bar {
    width: 2px; /* Thinner bars on mobile */
    height: 8px; /* Smaller default height */
  }

  @keyframes spike {
    0%,
    100% {
      height: 8px; /* Adjust animation height for mobile */
    }
    50% {
      height: 18px; /* Peak height for spikes on mobile */
    }
  }
}
#user-details-form {
  display: none;
  padding: 16px;
  background: #fff;
  border-top: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.4s ease-in-out;
  font-family: "Segoe UI", sans-serif;
}

#user-details-form h4 {
  font-size: 16px;
  color: #333;
  margin-bottom: 14px;
  text-align: center;
}

/* Input Styling */
#user-details-form input[type="text"],
#user-details-form input[type="email"],
#user-details-form input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 14px;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
}

#user-details-form input:focus {
  border-color: #3a86ff;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.15);
  outline: none;
}

/* Button Styling */
#submit-details-btn {
  padding: 12px;
  background: linear-gradient(to right, #3a86ff, #00b4d8);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#submit-details-btn:hover {
  background: linear-gradient(to right, #0059ff, #0077b6);
}

/* Smooth Appearance Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsiveness */
@media screen and (max-width: 480px) {
  /* Chatbot outer wrapper fix (you might need to update your specific class or ID) */
  #user-details-form {
    max-height: 80vh; /* ensures it never exceeds viewport */
    overflow-y: auto;
    padding-bottom: 20px; /* space for the button */
    box-sizing: border-box;
  }

  /* Optional: Prevent body scrolling behind chatbot */
  body.modal-open {
    overflow: hidden;
  }

  #user-details-form input,
  #submit-details-btn {
    font-size: 13px;
  }

  #user-details-form h4 {
    font-size: 14px;
  }
}
