/* Inside Pace messaging — trash belongs ONLY to per-session conversations.
   The athlete directory remains a clean directory; old resolved session threads
   can be hidden from the horizontal/desktop session list. */

/* --------------------------------------------------------------------------
   MAIN ATHLETE DIRECTORY
   Keep the wrapper introduced by the React row invisible to the old premium
   selector and restore the exact dark-card appearance. Never show a trash icon
   at athlete level: hiding happens per session, not per athlete.
   -------------------------------------------------------------------------- */
body:has(input[placeholder="Rechercher un athlète…"])
  .desktop-col:has(input[placeholder="Rechercher un athlète…"]) > div > div:last-child > div {
  position: relative !important;
  overflow: hidden !important;
  margin: 0 !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(100px 70px at 100% 0%, rgba(255,196,71,.10), transparent 74%),
    linear-gradient(145deg, rgba(8,20,50,.74), rgba(29,59,108,.68)) !important;
  box-shadow: 0 8px 18px rgba(1,8,28,.17), inset 0 1px 0 rgba(255,255,255,.055) !important;
}

body:has(input[placeholder="Rechercher un athlète…"])
  .desktop-col:has(input[placeholder="Rechercher un athlète…"]) > div > div:last-child > div::before {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, rgba(34,160,107,.72), rgba(83,202,144,.78), rgba(255,196,71,.78));
  opacity: .75;
  content: '';
  pointer-events: none;
}

body:has(input[placeholder="Rechercher un athlète…"])
  .desktop-col:has(input[placeholder="Rechercher un athlète…"]) > div > div:last-child > div > button:first-child {
  position: relative !important;
  z-index: 2;
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: rgba(255,255,255,.97) !important;
  -webkit-tap-highlight-color: transparent;
}

body:has(input[placeholder="Rechercher un athlète…"])
  .desktop-col:has(input[placeholder="Rechercher un athlète…"]) > div > div:last-child > div > button:first-child span {
  color: rgba(255,255,255,.97) !important;
}

body:has(input[placeholder="Rechercher un athlète…"])
  .desktop-col:has(input[placeholder="Rechercher un athlète…"]) > div > div:last-child > div > button:first-child div > div:last-child > span:first-child {
  color: rgba(255,255,255,.72) !important;
}

/* This is the wrong athlete-level trash from the previous implementation.
   Make it impossible to use: per-session controls below are the only trash. */
body:has(input[placeholder="Rechercher un athlète…"])
  button[aria-label^="Masquer la conversation avec"] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   PER-SESSION CONVERSATIONS
   Each resolved session has .msg-session-row + the actual trash control.
   Preserve the premium dark card and reserve room for a 40px touch target.
   -------------------------------------------------------------------------- */
body:has(input[placeholder="Rechercher un athlète…"]) .msg-session-list .msg-session-row {
  position: relative !important;
  overflow: hidden !important;
  flex: 0 0 auto;
  margin: 0 0 7px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 14px !important;
  background:
    radial-gradient(100px 62px at 100% 0%, rgba(255,196,71,.09), transparent 72%),
    linear-gradient(145deg, rgba(13,32,72,.82), rgba(25,55,102,.72)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 7px 16px rgba(0,0,0,.13) !important;
}

body:has(input[placeholder="Rechercher un athlète…"]) .msg-session-list .msg-session-row::before {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, rgba(34,160,107,.68), rgba(83,202,144,.72), rgba(255,196,71,.76));
  content: '';
  pointer-events: none;
}

body:has(input[placeholder="Rechercher un athlète…"]) .msg-session-list .msg-session-row > .msg-session-button {
  position: relative !important;
  z-index: 2;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  padding-right: 52px !important;
  box-shadow: none !important;
}

body:has(input[placeholder="Rechercher un athlète…"]) .msg-session-list .msg-session-row > .msg-session-button strong,
body:has(input[placeholder="Rechercher un athlète…"]) .msg-session-list .msg-session-row > .msg-session-button > div:nth-child(3) {
  color: rgba(255,255,255,.97) !important;
}

body:has(input[placeholder="Rechercher un athlète…"]) .msg-session-list .msg-session-row > .msg-session-button > div:nth-child(2) {
  color: rgba(255,255,255,.50) !important;
}

/* Actual session trash: aria label is "Masquer la conversation <session title>".
   It only exists when conversation.clos === true, so unanswered sessions remain safe. */
body:has(input[placeholder="Rechercher un athlète…"])
  .msg-session-list .msg-session-row > button[aria-label^="Masquer la conversation "]:not([aria-label^="Masquer la conversation avec"]) {
  position: absolute !important;
  z-index: 20 !important;
  right: 7px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border: 1px solid rgba(255,196,71,.40) !important;
  border-radius: 12px !important;
  background: rgba(255,196,71,.14) !important;
  color: #FFD263 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 6px 14px rgba(0,0,0,.20) !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent;
}

body:has(input[placeholder="Rechercher un athlète…"])
  .msg-session-list .msg-session-row > button[aria-label^="Masquer la conversation "] svg {
  color: #FFD263 !important;
}

body:has(input[placeholder="Rechercher un athlète…"])
  .msg-session-list .msg-session-row > button[aria-label^="Masquer la conversation "]:active {
  transform: translateY(-50%) scale(.94) !important;
}

@media (max-width: 860px) {
  body:has(input[placeholder="Rechercher un athlète…"])
    .desktop-col:has(input[placeholder="Rechercher un athlète…"]) > div > div:last-child {
    gap: 7px !important;
    padding: 2px 9px 10px !important;
  }

  body:has(input[placeholder="Rechercher un athlète…"])
    .desktop-col:has(input[placeholder="Rechercher un athlète…"]) > div > div:last-child > div > button:first-child {
    min-height: 76px;
  }

  /* In the mobile modal the session list is horizontal. Give each wrapped
     session the same width as the historical .msg-session-button card. */
  body:has(input[placeholder="Rechercher un athlète…"]) .msg-session-list .msg-session-row {
    min-width: 230px !important;
    max-width: 270px !important;
    margin: 0 7px 0 0 !important;
  }

  body:has(input[placeholder="Rechercher un athlète…"]) .msg-session-list .msg-session-row > .msg-session-button {
    min-width: 230px !important;
    max-width: 270px !important;
    min-height: 86px !important;
    padding-right: 54px !important;
  }

  body:has(input[placeholder="Rechercher un athlète…"])
    .msg-session-list .msg-session-row > button[aria-label^="Masquer la conversation "]:not([aria-label^="Masquer la conversation avec"]) {
    width: 42px !important;
    height: 42px !important;
    right: 7px !important;
  }
}