/* Coach — the HoopLife website chat. Black, white and red only, phone first
   (390px is the design target, desktop is the adaptation). Loaded only by the
   /coach-preview test page for now; when Coach goes sitewide this same sheet
   styles the widget. */

/* Coach IS the ask surface on this page: the sitewide "Ask a question" bubble
   would float straight on top of the Send button (a real browser test found it
   swallowing every tap), and its auto-open panel covered the chat. Hidden here
   only — it stays on every other page. */
body:has(.coach-page) .hl-ask-launcher,
body:has(.coach-page) .hl-ask-panel,
/* ...and so would the sitewide promo popup (its overlay ate the lead card's
   submit button in the same browser test). Neither belongs over a chat. */
body:has(.coach-page) .modal_component {
  display: none !important;
}

.coach-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  font-family: Rubik, Arial, sans-serif;
  color: #111;
}

/* The preview banner — makes it unmistakable this is the test build. Delete
   the banner, not the chat, when Coach ships. */
.coach-preview-bar {
  background: #111;
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.55rem 1rem;
}
.coach-preview-bar strong {
  color: #ff8f98;
}

.coach-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  background: #fff;
  min-height: 0;
}
@media (min-width: 700px) {
  .coach-page {
    padding: 1.25rem;
  }
  .coach-shell {
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    min-height: 34rem;
    max-height: calc(100dvh - 5.5rem);
  }
}

.coach-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #bf202f;
  color: #fff;
}
.coach-head img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.coach-head-name {
  font-family: Cooperhewitt, Rubik, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.1;
}
.coach-head-sub {
  font-size: 0.78rem;
  opacity: 0.92;
}

.coach-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  overscroll-behavior: contain;
}

.coach-msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.coach-msg.is-user {
  align-self: flex-end;
  background: #111;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.coach-msg.is-coach {
  align-self: flex-start;
  background: #f2f2f2;
  border-bottom-left-radius: 4px;
}
.coach-msg.is-coach a {
  color: #bf202f;
  font-weight: 600;
  text-decoration: underline;
}
.coach-msg.is-error {
  align-self: center;
  background: #fdecee;
  color: #8f1420;
  font-size: 0.85rem;
  text-align: center;
}

/* Typing dots */
.coach-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 0.85rem 1rem;
}
.coach-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bf202f;
  animation: coach-bounce 1.1s infinite;
}
.coach-typing span:nth-child(2) { animation-delay: 0.15s; }
.coach-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes coach-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* First-message suggestion chips */
.coach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
}
.coach-chips button {
  border: 1.5px solid #bf202f;
  background: #fff;
  color: #bf202f;
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.coach-chips button:hover {
  background: #bf202f;
  color: #fff;
}

.coach-inputrow {
  display: flex;
  gap: 0.6rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid #e6e6e6;
  background: #fff;
}
.coach-inputrow textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid #d9d9d9;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  /* 16px floor: anything smaller makes iOS zoom the page on focus. */
  font-size: 16px;
  font-family: inherit;
  line-height: 1.35;
  max-height: 7.5rem;
}
.coach-inputrow textarea:focus {
  outline: none;
  border-color: #bf202f;
}
.coach-send {
  align-self: flex-end;
  background: #bf202f;
  color: #fff;
  border: none;
  border-radius: 12px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 1.1rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.coach-send:disabled {
  opacity: 0.45;
  cursor: default;
}

/* The follow-up (lead) card Coach can drop into the conversation */
.coach-lead {
  align-self: flex-start;
  width: 100%;
  max-width: 22rem;
  border: 1.5px solid #e6e6e6;
  border-top: 4px solid #bf202f;
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
}
.coach-lead h4 {
  margin: 0 0 0.55rem;
  font-family: Cooperhewitt, Rubik, sans-serif;
  font-size: 1rem;
}
.coach-lead input,
.coach-lead textarea {
  width: 100%;
  border: 1.5px solid #d9d9d9;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 0.5rem;
}
.coach-lead button {
  width: 100%;
  min-height: 44px;
  background: #bf202f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.coach-lead button:disabled { opacity: 0.5; }
.coach-lead .coach-lead-done {
  color: #1a7a3c;
  font-weight: 600;
  font-size: 0.9rem;
}
.coach-lead .coach-lead-skip {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #777;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  min-height: 32px;
  cursor: pointer;
  text-decoration: underline;
}

/* Per-reply feedback, preview-only: staff flag a bad answer and it lands in
   Website Forms. */
.coach-flag {
  align-self: flex-start;
  margin: -0.35rem 0 0;
}
.coach-flag > button {
  background: none;
  border: none;
  color: #999;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.35rem 0.25rem;
  text-decoration: underline;
}
.coach-flag textarea {
  width: 16rem;
  max-width: 70vw;
}

/* HL-069.6: the Forget me link in the header, for a family Coach remembers on this device. */
.coach-head { position: relative; }
.coach-forget {
  margin-left: auto;
  background: none;
  border: 0;
  padding: 6px 0;
  font: inherit;
  font-size: 13px;
  color: inherit;
  opacity: 0.75;
  text-decoration: underline;
  cursor: pointer;
}
.coach-forget:hover { opacity: 1; }
