/* REFLECTION VIEW */
#reflection-view {
  display: none;
  height: 100vh;
  display: none;
  flex-direction: column;
}

#reflection-view.active {
  display: flex;
}

/* SCROLLABLE CONVERSATION */
#conversation {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.25rem 1rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 120px; /* clear fixed bottom bar */
}

/* QUESTION BUBBLE */
.q-bubble {
  background: var(--green);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 12px 12px 12px 4px;
  font-size: 0.95rem;
  display: inline-block;
  max-width: 80%;
  margin-bottom: 1rem;
}

/* REFLECTION CARD */
.reflection-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

/* LOADING DOTS */
.reflection-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* REFLECTION TEXT */
.reflection-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.85;
}

.reflection-text p {
  margin-bottom: 1rem;
}

.reflection-text p:last-child {
  margin-bottom: 0;
}

.reflection-text strong {
  color: var(--text);
  font-weight: 600;
}

.reflection-text em {
  font-style: italic;
  color: var(--text-mid);
}

/* STREAMING CURSOR */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
  margin-left: 1px;
}

@keyframes blink { 50% { opacity: 0; } }

/* SCHOLAR CTA — inside card */
.btn-scholar {
  display: none;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  color: var(--green);
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: none;
  align-items: center;
  gap: 0.4rem;
  transition: opacity 0.15s;
}

.btn-scholar:hover { opacity: 0.75; }

.btn-scholar.visible {
  display: flex;
}

/* AYAH BLOCK */
.ayah-block {
  background: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  text-align: center;
}

.ayah-arabic {
  direction: rtl;
  font-family: Georgia, serif;
  font-size: 1.3rem;
  color: var(--green);
  line-height: 2.2;
  margin-bottom: 0.75rem;
}

.ayah-translation {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.ayah-ref {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--green);
  display: block;
  margin-top: 0.4rem;
}

/* FIXED BOTTOM INPUT BAR */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.25rem 0.75rem;
  z-index: 50;
}

#bottom-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.625rem;
  max-width: 720px;
  margin: 0 auto;
}

#follow-up-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--cream);
  resize: none;
  line-height: 1.5;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
}

#follow-up-input:focus { border-color: var(--green); background: white; }
#follow-up-input::placeholder { color: var(--text-muted); }

#follow-up-submit {
  width: 40px;
  height: 40px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

#follow-up-submit:hover { background: var(--green-mid); }
#follow-up-submit:disabled { background: #999; cursor: not-allowed; }

#bottom-note {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* MOBILE */
@media (max-width: 480px) {
  #conversation { padding: 1.5rem 1rem 140px; }
  .q-bubble { max-width: 100%; font-size: 0.875rem; }
  .reflection-card { padding: 1.25rem; }
  .reflection-text { font-size: 0.9rem; }
  #bottom-bar { padding: 0.75rem 1rem 0.625rem; }
}