/* ═══════════════════════════════════════════════════
   components.css — Reusable UI components
═══════════════════════════════════════════════════ */

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card + .card { margin-top: 1rem; }

.card-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
  margin-bottom: 0.85rem;
}

/* ── Grid helpers ── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ── Stat boxes ── */
.stat-box {
  background: var(--bg3);
  border-radius: var(--r2);
  padding: 0.85rem;
  text-align: center;
}
.stat-val {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.8rem;
  letter-spacing: 1px;
  color: var(--text);
}
.stat-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text3);
  margin-top: 2px;
}

/* ── Tags & Pills ── */
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  border: 1px solid var(--border2);
  color: var(--text2);
  background: var(--bg3);
}
.tag.orange {
  background: var(--orange-dim);
  border-color: var(--orange-border);
  color: var(--orange);
}

.pill { padding: 2px 8px; border-radius: 20px; font-size: 0.68rem; font-weight: 600; }
.pill-green  { background: rgba(46, 204, 113, 0.1); color: var(--green); }
.pill-orange { background: var(--orange-dim);       color: var(--orange); }
.pill-red    { background: rgba(224, 48, 48, 0.1);  color: var(--red); }
.pill-gray   { background: var(--bg4);              color: var(--text3); }

/* ── Buttons ── */
.btn {
  padding: 8px 18px;
  border-radius: var(--r2);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary       { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange2); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; }

/* ── Form inputs ── */
.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}
.input:focus     { border-color: var(--orange); }
select.input     { cursor: pointer; }

.form-row              { display: grid; gap: 10px; margin-bottom: 0.75rem; }
.form-row.c2           { grid-template-columns: 1fr 1fr; }
.form-label            { font-size: 0.72rem; color: var(--text3); margin-bottom: 4px; }

/* ── Progress bars ── */
.progress-wrap { margin-top: 1rem; }
.pb-row        { margin-bottom: 0.6rem; }
.pb-labels     { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text2); margin-bottom: 4px; }
.pb            { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.pb-fill       { height: 100%; background: linear-gradient(90deg, var(--orange), var(--gold)); border-radius: 3px; }

/* ── Stars ── */
.stars { color: var(--gold); font-size: 0.8rem; }

/* ── Coach cards (Browse Coaches) ── */
.coach-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: border-color 0.15s;
  margin-bottom: 0.75rem;
}
.coach-card:hover { border-color: var(--border2); }

.coach-av {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', cursive;
  font-size: 1.4rem;
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.3);
  flex-shrink: 0;
}

.coach-name    { font-weight: 600; font-size: 0.95rem; }
.coach-spec    { font-size: 0.75rem; color: var(--text3); margin: 0.15rem 0 0.4rem; }
.coach-tags    { display: flex; flex-wrap: wrap; gap: 5px; }
.coach-actions { margin-left: auto; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ── Chat ── */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  max-height: 700px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg3);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}
.msg-bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.msg-bubble.mine   { align-self: flex-end; background: var(--orange); color: #fff; border-radius: 12px 12px 3px 12px; }
.msg-bubble.theirs { align-self: flex-start; background: var(--bg4); color: var(--text); border-radius: 12px 12px 12px 3px; }
.msg-meta          { font-size: 0.65rem; opacity: 0.6; margin-top: 4px; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}
.chat-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  resize: none;
}
.chat-input:focus { border-color: var(--orange); }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--orange);
  background: var(--orange-dim);
}
.upload-zone-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.4; }

/* ── Feedback cards ── */
.feedback-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s;
  margin-bottom: 0.75rem;
}
.feedback-card:hover { border-color: var(--orange-border); }

.feedback-thumb {
  aspect-ratio: 16/9;
  background: #111;
  border-radius: var(--r2);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.feedback-ann-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

/* ── Roster rows ── */
.roster-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: var(--bg3);
  border-radius: var(--r2);
  margin-bottom: 6px;
}
.r-av  { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
.r-name { font-size: 0.85rem; font-weight: 500; }
.r-meta { font-size: 0.72rem; color: var(--text3); }

/* ── Video thumbnail cards (renderVideoGrid in utils.js) ── */
.video-thumb-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.vtc-thumb {
  aspect-ratio: 16 / 9;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.vtc-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vtc-play-icon {
  border-top:    7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left:   12px solid rgba(255,255,255,.7);
  margin-left: 3px;
}
.vtc-lift-tag {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--orange);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.vtc-ann-badge {
  position: absolute;
  bottom: 6px; right: 6px;
  background: var(--gold);
  color: #000;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}
.vtc-info  { padding: .65rem .75rem; }
.vtc-title { font-weight: 500; font-size: .82rem; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtc-meta  { font-size: .7rem; color: var(--text3); }

/* ── Review queue rows ── */
.review-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg3);
  border-radius: var(--r2);
  margin-bottom: 6px;
}
.rv-thumb { width: 60px; height: 38px; background: #111; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rv-title { font-size: 0.82rem; font-weight: 500; }
.rv-meta  { font-size: 0.72rem; color: var(--text3); }

/* ── Video thumbnail card (used in video grids) ── */
.video-thumb-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.vtc-thumb {
  aspect-ratio: 16 / 9;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.vtc-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vtc-play-icon {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid rgba(255,255,255,.7);
  margin-left: 3px;
}
.vtc-lift-tag {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--orange);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.vtc-ann-badge {
  position: absolute;
  bottom: 6px; right: 6px;
  background: var(--gold);
  color: #000;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}
.vtc-info  { padding: 0.65rem 0.75rem; }
.vtc-title { font-weight: 500; font-size: 0.82rem; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtc-meta  { font-size: 0.7rem; color: var(--text3); }

/* ── Profile badges ──────────────────────────────────────────── */
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 700;
  color: var(--badge-color, var(--text3));
  background: color-mix(in srgb, var(--badge-color, var(--text3)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color, var(--text3)) 30%, transparent);
  border-radius: 10px;
  padding: 2px 7px;
  white-space: nowrap;
  line-height: 1.4;
}

/* ── Avatar change button ────────────────────────────────────── */
.avatar-change-btn {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: .7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
  padding: 0;
}
.avatar-change-btn:hover { background: var(--bg4); }

/* ── Coach stats row ─────────────────────────────────────────── */
.coach-stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.coach-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.coach-stat-val {
  font-family: 'Bebas Neue', cursive;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: .5px;
}
.coach-stat-lbl {
  font-size: .62rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .4px;
}
