/*
 * Messages page (conversations#index) — Figma reskin: dark-green cards on the
 * lobby background, segmented filter chips with lime→cyan active gradient.
 * Standalone sheet (same pattern as lobby-dock.css) — keeps Tailwind purge
 * away from these visual rules.
 */

/*
 * Stretch only inside the parent scroller (slider __slide / standalone main).
 * The slide already adds `padding-bottom: calc(84px + safe + 8px)` to clear
 * the fixed dock — duplicating that padding here pushed the page ~96px past
 * the viewport and produced the unwanted scroll + empty bottom band.
 */
.messages-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  padding: 16px;
  color: #fbfcfc;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  box-sizing: border-box;
}

.messages-page__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0 8px;
}

.messages-page__header-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.messages-page__title {
  color: #a6d90f;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

.messages-page__tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 6px;
  margin: 16px 0;
  background: #488453;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
}

.messages-page__tab {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
}

.messages-page__tab-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  width: 100%;
  height: 100%;
}

.messages-page__tab-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 8px 6px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
  text-align: center;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.messages-page__tab-input:checked + .messages-page__tab-label {
  background: linear-gradient(180deg, #a6d90f 0%, #03f3eb 100%);
  color: #031207;
  font-weight: 700;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 4px 14px rgba(3, 18, 7, 0.35);
}

.messages-page__tab-input:focus-visible + .messages-page__tab-label {
  outline: 2px solid #a6d90f;
  outline-offset: 2px;
}

.messages-page__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.messages-page__item {
  background: #0a421b;
  border-radius: 16px;
  padding: 12px 16px;
  transition: padding 0.18s ease;
}

.messages-page__item.is-expanded {
  padding-bottom: 16px;
}

.messages-page__item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

.messages-page__item-trigger {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.messages-page__item-trigger:focus-visible {
  outline: 2px solid #a6d90f;
  outline-offset: 4px;
  border-radius: 8px;
}

.messages-page__item-emoji {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.messages-page__item-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fbfcfc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-page__item.is-expanded .messages-page__item-title {
  color: #a6d90f;
}

.messages-page__item-chevron {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a6d90f;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 8px;
}

.messages-page__item-chevron.is-flipped {
  transform: rotate(-90deg);
}

.messages-page__item-chevron svg {
  width: 16px;
  height: 16px;
  display: block;
}

.messages-page__item-trash {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.messages-page__item-trash svg {
  width: 22px;
  height: 22px;
  display: block;
}

.messages-page__item-detail {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.messages-page__item-description {
  font-size: 14px;
  font-weight: 500;
  color: #fbfcfc;
  margin: 0;
}

.messages-page__item-timestamp {
  font-size: 10px;
  color: rgba(251, 252, 252, 0.7);
  margin: 0;
}

.messages-page__cta {
  align-self: center;
  margin: 24px auto 0;
  background: transparent;
  border: none;
  padding: 4px 8px;
  color: #a6d90f;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.messages-page__empty {
  text-align: center;
  color: rgba(251, 252, 252, 0.6);
  padding: 32px 16px;
  font-size: 14px;
}
