/**
 * Transfer timeline + team transfer tabs (API-backed partials).
 * Tokens: theme.css only.
 */

/* ---- Transfermarkt (player Career → Transfers) ---- */
.player-section-head--transfers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.player-section-head--transfers .player-section-title {
  margin-bottom: 0;
}

.player-section-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.transfers-refresh-form {
  margin: 0;
}

.transfers-refresh-btn {
  margin: 0;
}

.transfermarkt-external-link {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--primary-container);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.transfermarkt-external-link:hover {
  text-decoration: underline;
  color: var(--primary);
}

.transfermarkt-external-link__icon {
  font-weight: 800;
  font-size: 0.875em;
}

/* ---- Career sub-tabs (player) ---- */
.career-sub-tabs {
  margin-bottom: 24px;
}

.career-sub-panel--transfers .player-section-title {
  margin-bottom: 16px;
}

/* ---- Lazy HTMX ---- */
.transfers-lazy-wrap {
  position: relative;
  min-height: 120px;
}

.transfers-htmx-indicator.fs-loading-bar.htmx-request {
  opacity: 1;
}

.transfers-placeholder {
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  margin: 0;
  padding: 16px 0;
}

/* ---- Team page heading ---- */
.team-transfers-section {
  padding: 0 0 24px;
}

.team-transfers-heading {
  font-family: var(--te-font);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--on-surface);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

/* ---- Timeline ---- */
.transfers-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.transfers-timeline__item {
  position: relative;
  padding: 0 0 20px 16px;
  margin: 0 0 8px;
}

.transfers-timeline__item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: -4px;
  width: 2px;
  background: var(--surface-highest);
  border-radius: var(--te-radius-full);
}

.transfers-timeline__item:last-child::before {
  bottom: auto;
  height: 12px;
}

.transfers-timeline__date {
  margin-bottom: 10px;
}

.transfers-timeline__date-label {
  display: inline-block;
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.transfers-timeline__body {
  background: var(--surface-container);
  border-radius: var(--te-radius-lg);
  box-shadow: var(--te-shadow-ambient);
  padding: 14px 16px;
}

.transfers-timeline__player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.transfers-player__photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-container-high);
  object-fit: cover;
  flex-shrink: 0;
}

.transfers-player__photo--ph {
  display: inline-block;
}

.transfers-player__name {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--on-surface);
  word-break: break-word;
}

.transfers-player__link {
  color: var(--primary-container);
  text-decoration: none;
}

.transfers-player__link:hover {
  text-decoration: underline;
}

.transfers-timeline--compact .transfers-player__photo {
  width: 28px;
  height: 28px;
}

.transfers-timeline--compact .transfers-player__name {
  font-size: 0.875rem;
}

.transfers-timeline__clubs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 10px;
}

.transfers-timeline__arrow {
  font-weight: 800;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}

.transfers-club {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 140px;
}

.transfers-club__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--te-radius-md);
  background: var(--surface-container-high);
  flex-shrink: 0;
}

.transfers-club__logo--ph {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: var(--te-radius-md);
  background: var(--surface-highest);
}

.transfers-club__name {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--on-surface);
  min-width: 0;
  word-break: break-word;
}

.transfers-club__link {
  color: var(--primary-container);
  text-decoration: none;
  font-weight: 800;
}

.transfers-club__link:hover {
  text-decoration: underline;
}

.transfers-timeline--compact .transfers-club__logo,
.transfers-timeline--compact .transfers-club__logo--ph {
  width: 36px;
  height: 36px;
}

.transfers-timeline__meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.transfers-fee {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--on-surface-variant);
}

.transfers-fee--undisclosed {
  font-weight: 700;
  color: var(--on-surface-variant);
  opacity: 0.85;
}

.transfers-timeline__detail {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
}

.transfers-detail-pair {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  min-width: 0;
}

.transfers-detail-label {
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.transfers-detail-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--on-surface);
  word-break: break-word;
}

/* ---- Type badges ---- */
.transfer-type-badge {
  display: inline-block;
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--te-radius-md);
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}

.transfer-type-badge--loan {
  background: var(--te-secondary-tint);
  color: var(--on-secondary-container);
}

.transfer-type-badge--transfer {
  background: var(--te-accent-tint);
  color: var(--on-primary-container);
}

.transfer-type-badge--free {
  background: color-mix(in srgb, var(--te-win) 12%, transparent);
  color: var(--te-win);
}

.transfer-type-badge--return-loan,
.transfer-type-badge--return_from_loan {
  background: var(--surface-highest);
  color: var(--on-surface);
}

.transfer-type-badge--na,
.transfer-type-badge--n-a {
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}

.transfer-type-badge--appointment {
  background: var(--te-secondary-tint);
  color: var(--on-secondary-container);
}

.transfers-empty {
  font-size: 0.9375rem;
  color: var(--on-surface-variant);
  margin: 0;
  padding: 12px 0;
}

/* ---- Team: radio-driven subtabs ---- */
.transfers-radio-state {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.transfers-partial--team .xfer-panel--in,
.transfers-partial--team .xfer-panel--out {
  display: none;
  margin-top: 16px;
}

.transfers-partial--team #team-xfer-in:checked ~ .xfer-panel--in,
.transfers-partial--team #team-xfer-out:checked ~ .xfer-panel--out {
  display: block;
}

.transfers-subtabs--team {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.transfers-subtab {
  cursor: pointer;
  margin: 0;
  border-radius: var(--te-radius-lg);
  padding: 8px 14px;
  font-size: var(--te-label-size);
  font-weight: var(--te-label-weight);
  letter-spacing: var(--te-label-spacing);
  text-transform: uppercase;
  color: var(--on-surface-variant);
  background: var(--surface-container-high);
  transition: color var(--te-transition-fast), background var(--te-transition-fast);
}

.transfers-subtab__arrow {
  margin-right: 6px;
}

.transfers-partial--team #team-xfer-in:checked ~ .transfers-subtabs label[for="team-xfer-in"],
.transfers-partial--team #team-xfer-out:checked ~ .transfers-subtabs label[for="team-xfer-out"] {
  color: var(--on-primary);
  background: var(--primary-container);
}

@media (max-width: 576px) {
  .transfers-timeline__clubs {
    flex-direction: column;
    align-items: stretch;
  }

  .transfers-timeline__arrow {
    align-self: center;
    transform: rotate(90deg);
  }
}
