/* thread.css
   Thread, messages, and jump-to-bottom button (no media queries)
*/
.thread {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.thread-inner {
  height: 100%;
  overflow: auto;
  padding: 20px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

/* Empty state (shown when no messages) */
.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 18px 140px; /* lifts it above the composer */
  text-align: center;

  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
}

.empty-state.is-hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.empty-state-title {
  font-weight: 200;
  font-size: clamp(18px, 2.2vw, 26px);
  color: rgba(0, 0, 0, 0.5);
  letter-spacing: 0.35px;
}

/* Thinking (subtle shimmer) */
.msg.thinking .bubble {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.thinking-text {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;

  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.28),
    rgba(15, 23, 42, 0.48),
    rgba(15, 23, 42, 0.28)
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  animation: thinkingShimmer 1.1s ease-in-out infinite;
}

@keyframes thinkingShimmer {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 100% 0;
  }
}

/* Messages */

.msg {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.bubble {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.03);
  line-height: 1.55;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user {
  justify-content: flex-end;
}
.msg.user .bubble {
  background: #0f4c81;
  color: #ffffff;
  border-color: rgba(15, 76, 129, 0.35);
}
.msg.ai .bubble {
  background: #ffffff;
  color: var(--text);
}

/* ===== AI message actions (ChatGPT-style) ===== */
.msg .bubble .msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}

/* No divider line. Tight, premium row like ChatGPT */
.msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-top: 8px;
  padding-top: 0;

  border-top: 0;
}

/* Smaller hit-area, no heavy border/shadow */
.msg-act {
  width: 28px;
  height: 28px;
  border-radius: 8px;

  border: 0;
  background: transparent;

  display: grid;
  place-items: center;

  position: relative;
  overflow: visible;

  color: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.copied-pill {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-62%, -6px);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(11, 15, 25, 0.95);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 30;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.msg-act.show-copied .copied-pill {
  opacity: 1;
  visibility: visible;
  transform: translate(-62%, -10px);
}

.msg-act:hover {
  background: rgba(15, 76, 129, 0.06);
  color: rgba(15, 23, 42, 0.78);
}

.msg-act:active {
  transform: translateY(0.5px);
}

.msg-act.is-on {
  background: rgba(15, 76, 129, 0.1);
  color: rgba(15, 23, 42, 0.92);
}

.msg-act svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Jump-to-bottom */
.jump {
  position: absolute;
  right: 16px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}
