/* ============================================================
   BACKWARD COMPAT: Old rafi.jinja class names
   
   The RAFI AJAX endpoint may still render the old rafi.jinja 
   which uses .right-section, .results-header, .results-row, 
   .cell, .header-cell. These styles make those work too.
   ============================================================ */

.right-section {
  overflow: hidden;
}

.results-header {
  display: flex;
  width: 100%;
  background: var(--hp-green, #2e8b57);
  color: white;
  font-weight: 700;
  border-radius: 3px;
  margin-bottom: 2px;
  overflow: hidden;
}

.results-row {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #ddd;
  align-items: center;
  overflow: hidden;
}

.header-cell,
.cell {
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 2px;
  text-align: center;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell {
  font-size: 11px;
}


/* PP date: full date shown by default, date_small hidden.
   At narrow widths, swap: hide full date, show date_small (3w/4d). */
.horsepage_pp_date_full { display: inline; }
.horsepage_pp_date_small { display: none; }

@media (max-width: 500px) {
  .horsepage_pp_date_full { display: none !important; }
  .horsepage_pp_date_small { display: inline !important; }
}

/* RAFI progressive column hiding */
@media (max-width: 900px) {
  .trv-col, .epnt-col { display: none; }
}
@media (max-width: 750px) {
  .otp-col, .surf-col { display: none; }
}
@media (max-width: 600px) {
  .sex-col, .age-col { display: none; }
}
@media (max-width: 500px) {
  .trk-col, .details-col { display: none; }
}
@media (max-width: 420px) {
  .cond-col { display: none; }
}

/* Old rafi detail rows */
.details-row {
  background: #f8f9fa;
  border: 1px solid #ddd;
  margin: 2px 0;
  border-radius: 3px;
  overflow: hidden;
}

.details-content {
  padding: 8px 10px;
  font-size: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px 8px;
  border-left: 3px solid #4a8c5c;
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-right: 0;
}

.detail-value {
  font-weight: 600;
  font-size: 13px;
  color: #333;
  text-transform: none;
  letter-spacing: normal;
  display: block;
  margin-top: 1px;
}

.detail-label {
  font-weight: 700;
  font-size: 9px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

/* Surface-colored detail card borders */
.surf_dfst-detail .detail-item  { border-left-color: #c4a265; }
.surf_dother-detail .detail-item { border-left-color: #8B6914; }
.surf_tfrm-detail .detail-item  { border-left-color: #4caf50; }
.surf_tyld-detail .detail-item  { border-left-color: #2e7d32; }
.surf_tother-detail .detail-item { border-left-color: #1b5e20; }
.surf_poly-detail .detail-item  { border-left-color: #7e57c2; }

/* Color-coded left borders for specific detail card types */
.detail-item-trk   { border-left-color: #4a90e2 !important; }
.detail-item-dist  { border-left-color: #ff9800 !important; }
.detail-item-purse { border-left-color: #fdd835 !important; }
.detail-item-epnt  { border-left-color: #e53935 !important; }
.detail-item-cr    { border-left-color: #607d8b !important; }
.detail-item-name  { border-left-color: #ab47bc !important; }

/* RAFI expand arrow */
.rafi-expand-arrow {
  display: inline-block;
  font-size: 10px;
  color: var(--hp-green, #0c420c);
  transition: transform 0.2s ease;
  cursor: pointer;
}

/* Old rafi button styles */
.btn-enter {
  background: #28a745;
  color: white;
  border: 1px solid #1e7e34;
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}

.btn-enter-pwd {
  background: #4528a7;
  color: yellow;
  border: 1px solid #341a7e;
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}

.btn-details {
  background: #6c757d;
  color: white;
  border: none;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 3px;
  cursor: pointer;
}

/* Old rafi badge classes */
.race-box {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
  background: #8d6e63;
  color: white;
}

.sex-M-box { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #5b9bd5; color: white; font-weight: 700; font-size: 10px; }
.sex-F-box { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #e57398; color: white; font-weight: 700; font-size: 10px; }
.age-box   { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #42a5f5; color: white; font-weight: 700; font-size: 10px; }

/* Old surf_X-box classes for surface badges in RAFI results */
.surf_yellow-box     { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #a1887f; color: white; font-weight: 700; font-size: 10px; }
.surf_darkyellow-box { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #6d4c41; color: white; font-weight: 700; font-size: 10px; }
.surf_green-box      { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #81c784; color: #000; font-weight: 700; font-size: 10px; }
.surf_darkgreen-box  { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #2e7d32; color: white; font-weight: 700; font-size: 10px; }
.surf_peach-box      { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #8d6e63; color: white; font-weight: 700; font-size: 10px; }
.surf_purple-box     { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #7e57c2; color: white; font-weight: 700; font-size: 10px; }
.surf_blue-box       { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #42a5f5; color: white; font-weight: 700; font-size: 10px; }


.offspring-toggle {
    cursor: pointer;
    padding: 6px 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-weight: bold;
    user-select: none;
    margin-bottom: 4px;
    display: inline-block;
}
.offspring-toggle:hover { background: #e0e0e0; }
.offspring-arrow { font-size: 0.8em; margin-left: 4px; }
.offspring-list { padding: 4px 0 8px 10px; }
.offspring-row { padding: 3px 0; display: flex; gap: 10px; align-items: center; }
.offspring-year { color: #666; min-width: 40px; }
.offspring-name { font-weight: bold; }
.badge { background: #ddd; border-radius: 3px; padding: 1px 5px; font-size: 0.8em; }


/* ============================================================
   hp_pp_showmore_delta.css
   Add to your existing CSS file
   ============================================================ */

.hp_pp_extra { display: none; }

.hp_pp_showmore_wrap {
    text-align: center;
    padding: 6px 0 2px 0;
}
.hp_pp_showmore_btn {
    cursor: pointer;
    padding: 4px 18px;
    background: #e8e8e8;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 0.9em;
}
.hp_pp_showmore_btn:hover { background: #d4d4d4; }