:root {
  --bg-main: #F2EFE7;
  --bg-secondary: #9ACBD0;
  --button-color: #006A71;
  --button-hover: #00555B;
  --header-footer: #006A71;
  --white: #ffffff;
}

body {
  margin: 0;
  font-family: sans-serif;
  background-color: var(--bg-main);
  direction: rtl;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 120px; /* این مقدار باید با ارتفاع تقریبی نوار ورودی + فوتر منطبق باشد */
}

header {
  text-align: center;
  background-color: var(--header-footer);
  padding: 10px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  margin-bottom: 0;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

/* Chat-specific styles */
#chat-container {
  background-color: var(--bg-main);
  padding: 0 10px;
  margin: 0 auto;
  flex-grow: 1;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  box-sizing: border-box;
}

#messages-display {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex-grow: 1;
  box-sizing: border-box;
}

.chat-message {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 20px;
  line-height: 1.4;
  word-wrap: break-word;
  animation: fadeInSlideUp 0.3s ease-out forwards;
}

.user-message {
  background-color: var(--bg-secondary);
  color: black;
  align-self: flex-start;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 5px;
  margin-right: 20px;
}

.bot-message {
  background-color: var(--white);
  color: black;
  align-self: flex-end;
  border-bottom-right-radius: 20px;
  border-bottom-left-radius: 5px;
  margin-left: 20px;
}

/* Input Area Styles */
.chat-input-area {
  position: fixed;
  bottom: 67px;
  left: 0;
  right: 0;
  width: 100%;
  background-color: var(--bg-main);
  padding-top: 10px;
  z-index: 1001;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 10px 10px;
  max-width: 600px;
  margin: 0 auto;
}

#problemInput {
  flex-grow: 1;
  border-radius: 20px;
  padding: 10px 15px;
  border: 1px solid #ccc;
  outline: none;
  font-size: 16px;
}

button {
  background-color: var(--button-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 20px;
  width: 45px;
  height: 45px;
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

button:hover {
  background-color: var(--button-hover);
}

/* --- FOOTER CODE (EXACTLY AS PROVIDED BY YOU) --- */
footer {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  background-color: var(--header-footer);
  color: var(--white);
  text-align: center;
  padding: 1rem;
}

.bottom-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: var(--header-footer);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.7rem 0;
  z-index: 1000;
}

.bottom-footer nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.bottom-footer nav a:hover {
  color: var(--bg-secondary);
}

/* فاصله پایین صفحه اصلی برای دیده شدن محتوا زیر فوتر */

.bottom-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: var(--header-footer);
  padding: 10px 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
}

.bottom-footer nav {
  display: flex;
  gap: 40px; /* این مقدار برای دسکتاپ است */
}

.bottom-footer a {
  text-decoration: none;
  color: #006A71;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
}

.nav-item i {
  font-size: 20px;
  margin-bottom: 5px;
}

.green-nav .nav-item i,
.green-nav .nav-item span {
  color: greenyellow
}
/* --- END OF FOOTER CODE --- */


/* Animation Keyframes */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dot-typing {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Loading Animation Styles */
.loading-message {
  text-align: center;
  max-width: 80px;
  padding: 10px 15px;
  border-radius: 8px;
  background-color: var(--white);
  align-self: flex-start;
  margin-right: 20px;
}

.dot-typing {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 8px;
  background-color: #333;
  color: #333;
  animation: dot-typing 1.5s infinite ease-in-out;
}

.dot-typing::before,
.dot-typing::after {
  content: "";
  display: inline-block;
  position: absolute;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 8px;
  background-color: #333;
  color: #333;
  animation: dot-typing 1.5s infinite ease-in-out;
}

.dot-typing::before {
  left: -15px;
  animation-delay: 0.2s;
}

.dot-typing::after {
  left: 15px;
  animation-delay: 0.4s;
}

/* Media Query for smaller screens */
@media (max-width: 600px) {
  .user-message, .bot-message {
    margin-left: 5px;
    margin-right: 5px;
  }
  .input-wrapper {
    padding: 0 10px 10px 10px;
  }
  
  /* **این بخش را تغییر دهید تا فاصله بین دکمه‌ها در موبایل را تنظیم کنید** */
  .bottom-footer nav {
    gap: 10px; /* کاهش gap از 20px به 10px */
    /* یا می توانید از justify-content: space-evenly; استفاده کنید تا فاصله یکنواخت تر شود */
    /* justify-content: space-evenly; */
  }

  #messages-display {
    padding-bottom: 120px;
  }
}

/* Media Query for smaller screens */
@media (max-width: 600px) {
  .user-message, .bot-message {
    margin-left: 10px;
    margin-right: 10px;
  }
  .input-wrapper {
    padding: 0 10px 10px 10px;
  }
  
  /* **این بخش را تغییر دهید تا فاصله بین دکمه‌ها در موبایل را تنظیم کنید** */
  .bottom-footer nav {
    gap: 40px; /* مقدار gap را از 10px به 25px افزایش دادیم تا بازتر شوند */
    /* اگر می خواهید خیلی بازتر شوند، می توانید این مقدار را بیشتر کنید.
       همچنین می توانید justify-content: space-evenly; را نیز امتحان کنید
       و gap را حذف کنید تا فاصله یکنواخت تر شود. */
  }

  #messages-display {
    padding-bottom: 120px;
  }
}

/* Styles for Quick Questions */
/* Styles for Quick Questions */
.quick-questions-container {
    display: flex; /* اضافه کنید */
    flex-direction: column; /* برای چیدمان عمودی */
    align-items: flex-end; /* برای تراز به راست */
    gap: 5px; /* فاصله بین دکمه‌های اصلی */ /* این مقدار را تنظیم کنید */
    margin-top: 10px; /* فاصله از پیام قبلی */
    margin-bottom: 0; /* چسباندن به پیام */
    width: 100%; /* اشغال عرض موجود */
    max-width: 80%; /* هم اندازه با پیام‌های چت */
    align-self: flex-end; /* هم تراز با پیام‌های ربات */
    padding-left: 20px; /* برای هم تراز شدن با پیام‌های ربات */
    padding-right: 0; /* اطمینان از حذف padding-right قبلی */
    box-sizing: border-box;
}

.quick-question-btn {
    background-color: var(--button-color);
    color: var(--white);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    width: 100%;
    min-height: 40px;
    /* تغییرات در اینجا */
    text-align: center; /* از right به center تغییر یافت*/
    display: flex;
    align-items: center;
    justify-content: center; /* از flex-end به center تغییر یافت*/
}

.quick-question-btn:hover {
    background-color: var(--button-hover);
}

.quick-questions-list {
    display: flex;
    flex-direction: column; /* برای اینکه دکمه‌ها زیر هم قرار بگیرند */
    gap: 8px;
    margin-top: 10px; /* کاهش فاصله */
    margin-bottom: 0; /* چسباندن به پیام */
    align-items: flex-end; /* برای تراز کردن دکمه‌ها به راست مانند پیام‌های ربات */
    width: 100%;
    max-width: 80%; /* هم اندازه با پیام‌های چت */
    align-self: flex-end; /* هم اندازه با پیام‌های ربات */
    padding-left: 20px; /* برای هم تراز شدن با پیام‌های ربات */
    padding-right: 0; /* اطمینان از حذف padding-right قبلی */
    box-sizing: border-box;
}

.quick-questions-list .question-item-btn {
    background-color: var(--white);
    color: #333;
    border: 1px solid #ccc;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    min-height: 40px;
    /* تغییرات در اینجا */
    text-align: center; /* از right به center تغییر یافت*/
    display: flex;
    align-items: center;
    justify-content: center; /* از flex-end به center تغییر یافت*/
    transition: background-color 0.2s, border-color 0.2s;
}

.quick-questions-list .question-item-btn:hover {
    background-color: #e0e0e0;
    border-color: #999;
}