/*
 * SATURDAY RACING — Horse Detail Page
 * /horses/static/horses/css/detail.css
 */

/* ── PAGE WRAPPER ──────────────────────────────────────────── */
.horse-page { padding-bottom: var(--space-10); }

/* ── HERO ──────────────────────────────────────────────────── */
.horse-hero {
  position: relative;
  padding: calc(var(--nav-h) + 40px) 0 48px;
  overflow: hidden;
}
.horse-hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 65% 80% at 0% 60%,  rgba(10,55,120,0.45), transparent 55%),
    radial-gradient(ellipse 55% 70% at 100% 30%, rgba(100,15,50,0.42), transparent 52%),
    var(--c-navy);
}
.horse-hero__bg::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    90deg, transparent, transparent 79px,
    rgba(212,175,55,0.025) 79px, rgba(212,175,55,0.025) 80px
  );
}
.horse-hero__inner {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-6);
  align-items: start;
}

/* Silk avatar */
.horse-silk-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.horse-silk-avatar__number {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 900;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

/* Identity */
.horse-identity { min-width: 0; }
.horse-hero__eyebrow {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.horse-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 3px 10px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.08);
  color: var(--c-text-55);
  border: 1px solid var(--c-border);
}
.horse-badge--country { color: var(--c-cyan); border-color: rgba(14,165,233,0.3); background: rgba(14,165,233,0.08); }
.horse-badge--fav     { color: var(--c-gold); border-color: var(--c-border-gold); background: var(--c-gold-subtle); }

.horse-hero__name {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900; line-height: 1;
  color: var(--c-text-100);
  margin-bottom: 12px;
}
.horse-hero__connections {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  font-size: 14px; color: var(--c-text-55);
}
.horse-hero__connections strong { color: var(--c-text-100); font-weight: 600; }
.horse-hero__connections .sep   { color: var(--c-text-35); }
.horse-hero__breeding {
  margin-top: 8px; font-size: 13px;
  color: var(--c-text-35); font-style: italic;
}
.breeding-label { font-style: normal; color: var(--c-text-35); }

/* Hero stats panel */
.horse-hero__stats {
  display: flex; flex-direction: column;
  gap: 8px; align-items: flex-end; flex-shrink: 0;
}
.horse-stat {
  text-align: right;
}
.horse-stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 900;
  color: var(--c-text-100); line-height: 1;
}
.horse-stat--gold .horse-stat__num { color: var(--c-gold); }
.horse-stat__label {
  display: block; font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--c-text-35); margin-top: 2px;
}
.horse-voted-badge {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--c-emerald-lt);
  background: var(--c-emerald-glow);
  border: 1px solid rgba(45,189,122,0.25);
  padding: 6px 14px; border-radius: var(--r-pill);
}
.horse-vote-btn { font-size: 13px; padding: 9px 18px; white-space: nowrap; }

/* ── BODY LAYOUT ───────────────────────────────────────────── */
.horse-body { padding-top: var(--space-7); }
.horse-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-7);
  margin-bottom: var(--space-7);
}

/* ── SECTIONS ──────────────────────────────────────────────── */
.horse-section {
  background: var(--c-navy-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-5);
}
.horse-section__title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--c-text-100);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--c-border);
}
.horse-section__icon { font-size: 18px; }

/* Guide & bio */
.horse-guide-tip { margin-bottom: var(--space-4); }
.horse-bio {
  font-size: 15px; color: var(--c-text-75);
  line-height: 1.78; margin-top: var(--space-4);
}

/* Notable wins */
.horse-notable-wins { display: flex; flex-direction: column; gap: 8px; }
.horse-win-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--c-text-75);
  padding: 8px 12px;
  background: rgba(212,175,55,0.05);
  border-left: 2px solid var(--c-gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.horse-win-icon { color: var(--c-gold); font-size: 12px; flex-shrink: 0; }

/* ── RACE HISTORY TABLE ─────────────────────────────────────── */
.horse-results-table { border-radius: var(--r-md); overflow: hidden; }
.hrt-header {
  display: grid;
  grid-template-columns: 100px 1fr 50px 90px 120px 60px;
  gap: 12px; padding: 10px 16px;
  background: rgba(212,175,55,0.07);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--c-text-35);
}
.hrt-row {
  display: grid;
  grid-template-columns: 100px 1fr 50px 90px 120px 60px;
  gap: 12px; padding: 12px 16px;
  font-size: 14px; color: var(--c-text-75);
  border-bottom: 1px solid var(--c-border);
  transition: background 0.15s;
  align-items: center;
}
.hrt-row:last-child { border-bottom: none; }
.hrt-row:hover { background: var(--c-navy-raised); }
.hrt-row--win    { background: rgba(26,92,64,0.08); }
.hrt-row--placed { background: rgba(212,175,55,0.04); }

.hrt-date    { color: var(--c-text-55); font-size: 13px; white-space: nowrap; }
.hrt-race    { font-weight: 600; color: var(--c-text-100); min-width: 0; }
.hrt-course  { display: block; font-size: 12px; font-weight: 400; color: var(--c-text-35); }
.hrt-pos     { font-family: var(--font-display); font-weight: 900; font-size: 15px; text-align: center; }
.hrt-pos--win  { color: var(--c-emerald-lt); }
.hrt-pos--dnf  { color: var(--c-text-35); font-size: 12px; }
.hrt-going   { font-size: 13px; color: var(--c-text-55); }
.hrt-jockey  { font-size: 13px; color: var(--c-text-75); }
.hrt-odds    { font-family: var(--font-display); font-weight: 700; color: var(--c-gold); text-align: right; }

.horse-empty { color: var(--c-text-35); font-size: 14px; font-style: italic; }

/* ── VOTERS PANEL ──────────────────────────────────────────── */
.horse-voters__count {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: var(--space-4);
}
.voters-num {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 900;
  color: var(--c-gold); line-height: 1;
}
.voters-label { font-size: 14px; color: var(--c-text-55); }
.horse-voters__grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: var(--space-4);
}
.voter-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(212,175,55,0.15);
  border: 2px solid rgba(212,175,55,0.3);
  display: flex; align-items: center; justify-content: center;
  cursor: default; transition: transform 0.15s;
}
.voter-avatar:hover { transform: scale(1.12); }
.voter-avatar__letter {
  font-size: 14px; font-weight: 700;
  color: var(--c-gold);
}
.horse-voters__names {
  font-size: 13px; color: var(--c-text-55);
  flex-wrap: wrap; display: flex; gap: 6px; align-items: center;
}
.voter-name  { color: var(--c-text-75); }
.voter-sep   { color: var(--c-text-35); }
.horse-voters__empty {
  display: flex; flex-direction: column; gap: 10px;
  font-size: 14px; color: var(--c-text-55);
}
.horse-voters__join {
  color: var(--c-gold); font-weight: 600; font-size: 13px;
  border-bottom: 1px solid rgba(212,175,55,0.3);
  padding-bottom: 1px;
}

/* ── ENTRY CARD ────────────────────────────────────────────── */
.entry-grid { display: flex; flex-direction: column; gap: 0; }
.entry-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
}
.entry-row:last-child { border-bottom: none; }
.entry-row span:first-child { color: var(--c-text-35); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.entry-row span:last-child  { color: var(--c-text-100); font-weight: 500; }
.entry-form  { font-family: var(--font-display); letter-spacing: 0.1em; }
.entry-odds  { font-family: var(--font-display); font-size: 18px; font-weight: 900; color: var(--c-gold); }
.entry-row--odds { padding: 12px 0; }
.entry-comment {
  margin-top: var(--space-4); padding-top: var(--space-4);
  border-top: 1px solid var(--c-border);
  font-size: 14px; color: var(--c-text-55);
  font-style: italic; line-height: 1.7;
}

/* ── CHAT ──────────────────────────────────────────────────── */
.horse-chat { margin-top: 0; }
.horse-chat .horse-section__title .chat-count {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600;
  color: var(--c-text-35);
}
.horse-chat__rule {
  font-size: 13px; color: var(--c-text-35);
  margin-top: -12px; margin-bottom: var(--space-5);
  font-style: italic;
}

/* Posts list */
.chat-posts {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: var(--space-5);
}
.chat-post {
  display: flex; gap: 12px;
  padding: 14px 16px;
  background: var(--c-navy-mid);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: border-color 0.2s;
}
.chat-post--mine {
  border-color: var(--c-border-gold);
  background: rgba(212,175,55,0.04);
}
.chat-post__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px; font-weight: 700; color: var(--c-gold);
  border: 1px solid rgba(212,175,55,0.2);
}
.chat-post__body { flex: 1; min-width: 0; }
.chat-post__header {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 6px;
}
.chat-post__name { font-weight: 600; font-size: 13px; color: var(--c-text-100); }
.chat-post__time { font-size: 11px; color: var(--c-text-35); margin-left: auto; }
.chat-post__text { font-size: 15px; color: var(--c-text-75); line-height: 1.55; margin-bottom: 8px; }
.chat-emoji      { margin-right: 4px; }

/* Category label */
.chat-post__cat {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 2px 8px; border-radius: var(--r-pill);
}
.chat-post__cat--confident { background: rgba(212,175,55,0.12); color: var(--c-gold); border: 1px solid rgba(212,175,55,0.22); }
.chat-post__cat--sceptical { background: rgba(14,165,233,0.10); color: #7baff8; border: 1px solid rgba(14,165,233,0.22); }
.chat-post__cat--tactical  { background: rgba(139,92,246,0.10); color: #c084fc; border: 1px solid rgba(139,92,246,0.22); }
.chat-post__cat--banter    { background: rgba(212,98,42,0.10);  color: #f0804a; border: 1px solid rgba(212,98,42,0.22); }

/* Like button */
.chat-post__actions { display: flex; align-items: center; gap: 6px; }
.chat-like-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--c-border);
  border-radius: var(--r-pill); padding: 3px 10px;
  font-size: 13px; color: var(--c-text-55);
  cursor: pointer; transition: all 0.18s;
}
.chat-like-btn:hover { border-color: rgba(212,175,55,0.4); color: var(--c-gold); }
.chat-like-btn--liked { border-color: rgba(212,175,55,0.4); color: var(--c-gold); background: var(--c-gold-subtle); }
.like-heart { font-size: 14px; line-height: 1; }
.like-count { font-weight: 600; }
.chat-likes-readonly { font-size: 13px; color: var(--c-text-35); }

.chat-empty {
  text-align: center; padding: var(--space-6);
  font-size: 14px; color: var(--c-text-35); font-style: italic;
  background: var(--c-navy-mid); border-radius: var(--r-md);
  border: 1px dashed var(--c-border);
}

/* Already posted bar */
.chat-posted-msg {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(212,175,55,0.06);
  border: 1px solid var(--c-border-gold);
  border-radius: var(--r-md); margin-bottom: var(--space-4);
  font-size: 14px; color: var(--c-text-75);
}
.chat-posted-msg strong { color: var(--c-gold); }
.chat-change-btn {
  margin-left: auto; background: none; border: none;
  color: var(--c-gold); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: underline;
}

/* ── CHAT PICKER ───────────────────────────────────────────── */
.chat-picker { }
.chat-picker--hidden { display: none; }
.chat-picker__title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--c-text-35);
  margin-bottom: var(--space-4);
}
.chat-picker__group { margin-bottom: var(--space-5); }
.chat-picker__group-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 10px;
  padding: 4px 0; border-bottom: 1px solid var(--c-border);
}
.label--confident { color: var(--c-gold); }
.label--sceptical { color: #7baff8; }
.label--tactical  { color: #c084fc; }
.label--banter    { color: #f0804a; }

.chat-picker__lines {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chat-line-btn {
  font-size: 13px; padding: 8px 14px;
  border-radius: var(--r-pill); cursor: pointer;
  transition: all 0.18s; border: 1px solid;
  display: flex; align-items: center; gap: 6px;
  background: none;
}
.line--confident { color: var(--c-gold);   border-color: rgba(212,175,55,0.28); }
.line--confident:hover { background: var(--c-gold-subtle); border-color: var(--c-gold); }
.line--sceptical { color: #7baff8; border-color: rgba(14,165,233,0.25); }
.line--sceptical:hover { background: rgba(14,165,233,0.08); border-color: #7baff8; }
.line--tactical  { color: #c084fc; border-color: rgba(139,92,246,0.25); }
.line--tactical:hover  { background: rgba(139,92,246,0.08); border-color: #c084fc; }
.line--banter    { color: #f0804a; border-color: rgba(212,98,42,0.25); }
.line--banter:hover    { background: rgba(212,98,42,0.08); border-color: #f0804a; }

/* Sign-in prompt */
.chat-signin-prompt {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-5) var(--space-5);
  background: var(--c-navy-mid);
  border: 1px dashed var(--c-border-gold);
  border-radius: var(--r-md);
  font-size: 20px;
}
.chat-signin-prompt > div { flex: 1; }
.chat-signin-prompt strong { display: block; font-size: 15px; color: var(--c-text-100); margin-bottom: 3px; }
.chat-signin-prompt p { font-size: 13px; color: var(--c-text-55); margin: 0; }

/* ── MOBILE ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .horse-hero__inner {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .horse-hero__stats {
    grid-column: 1 / -1;
    flex-direction: row; flex-wrap: wrap;
    align-items: flex-start; justify-content: flex-start;
    gap: 16px;
  }
  .horse-stat { text-align: left; }
  .horse-layout {
    grid-template-columns: 1fr;
  }
  .hrt-header,
  .hrt-row {
    grid-template-columns: 85px 1fr 44px 70px;
  }
  .hrt-jockey, .hrt-odds { display: none; }
}

@media (max-width: 600px) {
  .horse-silk-avatar { width: 60px; height: 60px; }
  .horse-silk-avatar__number { font-size: 22px; }
  .horse-hero__name { font-size: 32px; }
  .horse-section { padding: var(--space-4); }
  .hrt-header, .hrt-row { grid-template-columns: 80px 1fr 44px; }
  .hrt-going { display: none; }
  .chat-line-btn { font-size: 12px; padding: 7px 12px; }
  .chat-signin-prompt { flex-wrap: wrap; }
}
