:root {
  --primary-color: #5a2d82;
  --secondary-color: #4a1e6a;
  --background-color: #f7f7f7;
  --text-color: #333;
  --font-family: "Poppins", sans-serif;
  --gradient-bg: linear-gradient(135deg, #5a2d82 0%, #4a1e6a 100%);
  --card-shadow: 0 8px 16px rgba(90, 45, 130, 0.1);
}

/* Base Styles */
body {
  font-family: var(--font-family);
  background: linear-gradient(to right, #fff7f2, #fdf7f2);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  color: var(--text-color);
  font-size: 16px;
}

header {
  width: 100%;
  background-color: #ffffff;
  padding: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* Side Menu Styles */
.side-menu {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: rgba(255, 255, 255, 0.9);
  overflow-x: hidden;
  transition: width 0.3s ease;
  padding-top: 60px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.side-menu nav ul {
  list-style-type: none;
  padding: 0;
  margin: 40px 0 0 0;
}

.side-menu nav ul li {
  padding: 15px 20px;
  font-size: 14px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  transition: background-color 0.3s;
}

.side-menu nav ul li:hover {
  background-color: rgba(90, 45, 130, 0.1);
  color: var(--primary-color);
}

.side-menu nav ul li a {
  text-decoration: none;
  color: inherit;
}

.side-menu nav ul li i {
  margin-right: 10px;
}

/* Intro Section Styles */
.intro-section {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: #fff7f2;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.intro-logo {
  max-width: 100px;
  height: auto;
  margin-bottom: 15px;
}

.intro-title {
  font-family: var(--font-family);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 10px;
}

.intro-description {
  font-family: var(--font-family);
  font-size: 16px;
  color: #666;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
}

/* Sample Questions Styles */
.sample-questions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.sample-question-btn {
  background: white;
  border: 2px solid rgba(90, 45, 130, 0.2);
  border-radius: 10px;
  padding: 10px 15px;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 1 1 auto;
  min-width: 150px;
  max-width: 200px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sample-question-btn:hover {
  background: var(--gradient-bg);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
}

/* Toggle Menu Button */
.toggle-menu-btn {
  font-size: 30px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-color);
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
}

.toggle-menu-btn img {
  width: 100%;
  height: auto;
}

/* Main Content Shift when Menu is Open */
body.menu-open main,
body.menu-open header,
body.menu-open footer {
  margin-left: 250px;
  transition: margin-left 0.5s;
}

/* Chat Section */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  position: relative;
  background: linear-gradient(to bottom, #ffffff, #f0f0f0);
}

.chat-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  padding-bottom: 100px;
}

.chat-section {
  flex: 1;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}
.message-container {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  animation: fadeIn 0.5s;
  margin: 10px 0;
  width: 100%;
}
.bot-icon {
  font-size: 24px;
  margin-right: 10px;
  display: inline-block;
  vertical-align: top;
}

.message {
  max-width: 100%;
  word-wrap: break-word;
  box-sizing: border-box;
  font-size: 16px;
  margin-bottom: 10px;
}

.user-message-container {
  display: flex;
  justify-content: flex-end;
}

.user-message {
  background: var(--gradient-bg);
  color: white;
  padding: 12px 20px;
  border-radius: 20px 20px 5px 20px;
  box-shadow: var(--card-shadow);
  align-self: flex-end;
}

.bot-message {
  background: none;
  color: var(--text-color);
  padding: 0;
  border: none;
  box-shadow: none;
  align-self: flex-start;
  margin: 5px 0;
}

footer.chat-box {
  width: 100%;
  max-width: 800px;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  flex-wrap: nowrap;
  background: none;
  box-shadow: none;
  z-index: 1000;
}

footer.chat-box .input-container {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: #f1f1f1;
  border-radius: 25px;
  padding: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s ease;
}

footer.chat-box .input-container:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

footer.chat-box textarea {
  flex: 1;
  border: none;
  border-radius: 25px;
  padding: 10px;
  font-size: 16px;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
  min-height: 40px;
  max-height: 150px;
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: #f1f1f1;
}

footer.chat-box textarea:focus {
  outline: none;
}

footer.chat-box button {
  background: var(--primary-color);
  color: #efeaea;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  margin-left: 10px;
}

footer.chat-box button:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

.scroll-to-bottom-btn {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.scroll-to-bottom-btn.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-bottom-btn:hover {
  background-color: var(--secondary-color);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive adjustments for screens less than 600px wide */
@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  .chat-container {
    padding: 10px;
    max-width: 100%;
  }

  .chat-section {
    padding: 10px;
  }

  footer.chat-box {
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  footer.chat-box .input-container {
    flex-direction: column;
    align-items: stretch;
  }

  footer.chat-box button {
    margin-left: 0;
    margin-top: 10px;
    align-self: flex-end;
  }

  .scroll-to-bottom-btn {
    bottom: 100px;
  }

  .toggle-menu-btn {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

/* Adjustments for larger touch targets */
footer.chat-box button {
  width: 50px;
  height: 50px;
  font-size: 20px;
}

.toggle-menu-btn img {
  width: 40px;
  height: 40px;
}

/* Styles for Thumbs Up, Thumbs Down, and Copy Button */
.thumbs-up,
.thumbs-down,
.copy-button {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid rgba(90, 45, 130, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: "Poppins", sans-serif;
}

.thumbs-up:hover,
.thumbs-down:hover,
.copy-button:hover {
  background: rgba(90, 45, 130, 0.1);
  transform: scale(1.05);
}

.thumbs-up.selected,
.thumbs-down.selected {
  background: rgba(90, 45, 130, 0.1);
  border-color: var(--primary-color);
}

/* Tooltip and Copy Indicator Styles */
.tooltip {
  position: fixed;
  padding: 5px 10px;
  color: #fff;
  background: var(--primary-color);
  border-radius: 5px;
  font-size: 14px;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: fadeIn 0.2s ease-in-out;
}

#copyIndicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color);
  color: white;
  padding: 10px;
  border-radius: 10px;
  visibility: hidden;
  animation: fadeIn 0.2s ease-in-out;
}

/* Add/modify these styles */
.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

.logo img {
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

.logo img[alt] {
  font-size: 0;
  color: transparent;
}

.intro-section::before {
  display: none;
  content: none;
}

.intro-section > *:first-child:not(h1) {
  display: none;
}

/* Updated styles for intro section */
.intro-section {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(90, 45, 130, 0.1);
  border-radius: 20px;
  padding: 30px;
  margin: 20px;
  box-shadow: var(--card-shadow);
}

.intro-title {
  background: var(--gradient-bg);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 32px;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

/* Enhanced sample questions */
.sample-question-btn {
  background: white;
  border: 2px solid rgba(90, 45, 130, 0.2);
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.sample-question-btn:hover {
  background: var(--gradient-bg);
  color: white;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--card-shadow);
}

/* Improved message styling */
.user-message {
  background: var(--gradient-bg);
  color: white;
  padding: 12px 20px;
  border-radius: 20px 20px 5px 20px;
  box-shadow: var(--card-shadow);
  align-self: flex-end;
}

.bot-message {
  background: none;
  color: var(--text-color);
  padding: 0;
  border: none;
  box-shadow: none;
  align-self: flex-start;
  margin: 5px 0;
}

/* Enhanced input container */
footer.chat-box .input-container {
  background: white;
  border: 2px solid rgba(90, 45, 130, 0.1);
  padding: 15px;
  border-radius: 30px;
  box-shadow: var(--card-shadow);
}

footer.chat-box button {
  background: var(--gradient-bg);
  box-shadow: 0 4px 15px rgba(90, 45, 130, 0.3);
}

/* Improved scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(90, 45, 130, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-bg);
  border-radius: 4px;
}

/* Enhanced feedback buttons */
.feedback-container {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.thumbs-up,
.thumbs-down,
.copy-button {
  background: white;
  color: var(--primary-color);
  border: 2px solid rgba(90, 45, 130, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.thumbs-up:hover,
.thumbs-down:hover,
.copy-button:hover {
  background: var(--gradient-bg);
  color: white;
  transform: scale(1.1);
}

/* Add subtle animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-container {
  animation: fadeInUp 0.3s ease-out;
}

/* Style for the input container */
.input-container {
  display: flex;
  align-items: center;
}

/* Style for the attachment button */
#attachmentButton {
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 10px;
}

/* Style for the textarea */
#userInput {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 10px;
  resize: none; /* Prevent manual resizing */
  min-height: 40px; /* Minimum height */
  max-height: 150px; /* Maximum height */
}

/* Style for the loading indicator */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  font-size: 16px;
  color: #007bff;
}

/* Add this to your existing CSS */

.tooltip {
  position: absolute;
  padding: 5px 10px;
  color: #fff;
  background: var(--primary-color);
  border-radius: 5px;
  font-size: 14px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-in-out;
  white-space: nowrap; /* Prevent text wrapping */
}

/* Adjust tooltip position */
.feedback-container {
  position: relative; /* Ensure tooltips are positioned relative to the container */
}

.copy-button {
  background: white; /* Ensure the copy button has a background */
  color: var(--primary-color);
  border: 2px solid rgba(90, 45, 130, 0.2);
}

/* General Button Styles */
button {
  font-family: var(--font-family);
  font-weight: 500; /* Consistent font weight */
  border-radius: 10px; /* Consistent border radius */
  padding: 10px 20px; /* Consistent padding */
  transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth transitions */
}

/* Sample Question Button */
.sample-question-btn {
  background: white;
  border: 2px solid rgba(90, 45, 130, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sample-question-btn:hover {
  background: var(--gradient-bg);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
}

/* Feedback Button Styles */
.thumbs-up,
.thumbs-down,
.copy-button {
  background: white;
  border: 2px solid rgba(90, 45, 130, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: var(--font-family); /* Ensure consistent font */
}

.thumbs-up:hover,
.thumbs-down:hover,
.copy-button:hover {
  background: var(--gradient-bg);
  color: white;
  transform: scale(1.1);
}

/* Input Field Styles */
footer.chat-box textarea {
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 10px;
  font-family: var(--font-family);
  resize: none; /* Prevent manual resizing */
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  body {
    font-size: 14px; /* Adjust font size for smaller screens */
  }

  .sample-question-btn,
  .thumbs-up,
  .thumbs-down,
  .copy-button {
    min-width: 120px; /* Adjust button sizes for smaller screens */
  }
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #90caf9;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.3s linear infinite;
}

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

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

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

.bot-message-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bot-icon {
    margin-top: 8px;
    font-size: 1.2em;
}

.message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.bot-message {
    background-color: #f0f2f5;
}

.user-message {
    background-color: #0084ff;
    color: white;
    margin-left: auto;
}

.user-message-container {
    display: flex;
    justify-content: flex-end;
}

/* Add or update these media queries */
@media screen and (max-width: 768px) {
  /* Adjust main container for mobile */
  main {
    padding: 10px;
    margin-bottom: 60px; /* Space for chat input */
  }

  /* Adjust message containers */
  .message-container {
    max-width: 100%;
    margin: 8px 0;
  }

  .message {
    padding: 10px;
    font-size: 14px;
    max-width: 85%;
  }

  /* Adjust chat input area */
  .chat-box {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }

  .input-container {
    max-width: 100%;
  }

  textarea {
    padding: 8px;
    font-size: 14px;
    max-height: 100px;
  }

  /* Adjust feedback buttons */
  .feedback-container {
    flex-wrap: wrap;
    gap: 5px;
  }

  .feedback-container button {
    padding: 5px 10px;
    font-size: 16px;
  }

  /* Adjust side menu */
  .side-menu {
    width: 0;
    max-width: 80%;
  }

  /* Adjust tooltips */
  .tooltip {
    font-size: 12px;
    padding: 4px 8px;
  }

  /* Adjust intro section */
  .intro-section {
    padding: 15px;
  }

  .intro-title {
    font-size: 24px;
  }

  .intro-description {
    font-size: 14px;
  }

  /* Adjust sample questions */
  .sample-questions {
    padding: 10px;
    gap: 8px;
  }

  .sample-question-btn {
    font-size: 13px;
    padding: 8px 12px;
  }

  /* Adjust scroll to bottom button */
  .scroll-to-bottom-btn {
    right: 10px;
    bottom: 70px;
    padding: 8px;
    font-size: 14px;
  }
}

/* Add specific adjustments for very small screens */
@media screen and (max-width: 320px) {
  .message {
    font-size: 13px;
    padding: 8px;
  }

  .input-container textarea {
    font-size: 13px;
  }

  .sample-question-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}
