/* ✅ Base & Layout */
body {
  font-family: 'Inter', sans-serif;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

/* ✅ Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ✅ Logo */
.logo-img {
  width: 340px;
  max-width: 95%;
  margin-bottom: 0.2rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.logo-img:hover {
  opacity: 0.85;
}

/* ✅ Ayah Section */
.ayah {
  text-align: center;
  font-family: 'Noto Naskh Arabic', serif;
  color: #333;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-top: 0rem;
  margin-bottom: 2rem;
}

.reference {
  font-size: 0.85rem;
  color: #777;
}

/* ✅ Language Dropdown */
.lang-topbar {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 1rem 1rem 0.5rem;
}

.lang-topbar select {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #C8DCD2;
  background-color: #F7FBF9;
  font-family: inherit;
  color: #2C6E49;
  cursor: pointer;
}

/* ✅ Prompt Buttons */
.prompt-buttons {
  margin-bottom: 2rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90%;
}

.prompt-btn {
  padding: 0.5rem 1rem;
  background-color: #E6F2EC;
  color: #2C6E49;
  border: 1px solid #C8DCD2;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.prompt-btn:hover {
  background-color: #CDE5D9;
}

/* ✅ Chat Box */
.chat-box {
  background: #F7FBF9;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

#chat-window {
  margin-bottom: 1rem;
  max-height: 500px;
  overflow-y: auto;
}

.chat-message {
  white-space: pre-wrap;
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* ✅ Updated User Message: Now Left-Aligned */
.chat-message.user {
  font-weight: 600;
  color: #222;
  text-align: left;
  background-color: #e6f2f1;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.98rem;
}

/* ✅ Assistant Message */
.chat-message.assistant {
  background-color: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.98rem;
  color: #333;
}

/* ✅ Input Section */
.input-area {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #C8DCD2;
  border-radius: 999px;
  padding: 0.5rem 0.7rem;
  gap: 0.5rem;
}

textarea {
  flex-grow: 1;
  border: none;
  resize: none;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  padding: 0.6rem 0.5rem;
  min-height: 42px;
  outline: none;
  line-height: 1.6;
}

.mic-button,
.send-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.mic-button svg,
.send-button svg {
  width: 20px;
  height: 20px;
  fill: #2C6E49;
}

.mic-button:hover,
.send-button:hover {
  opacity: 0.7;
}

/* ✅ Donate Button */
.donate-button-wrapper {
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
  text-align: center;
}

.donate-button {
  background-color: #D4AF37;
  color: white;
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 30px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}

.donate-button:hover {
  background-color: #b88e2c;
  color: #fff;
}

/* ✅ Typing Indicator */
.typing-indicator {
  font-size: 0.9rem;
  color: #555;
  padding: 0.5rem 1rem;
  font-style: italic;
  opacity: 0.8;
  text-align: center;
}

.dots::after {
  content: '';
  display: inline-block;
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}

/* ✅ Disclaimer */
.disclaimer {
  font-size: 0.65rem;
  color: #999;
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
}

/* ✅ Responsive */
@media (max-width: 768px) {
  .logo-img {
    width: 280px;
  }

  .ayah {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
  }

  .reference {
    font-size: 0.8rem;
  }

  .container {
    padding: 1.2rem 1rem;
  }

  .chat-box {
    padding: 1.2rem;
  }

  .lang-topbar {
    justify-content: center;
    padding-top: 0.5rem;
  }
}

@media (min-width: 768px) {
  .lang-topbar {
    justify-content: flex-start;
    padding-left: 2rem;
  }
}