/**
 * AAG FP Leaderboard — Custom Styles
 *
 * This file contains ONLY styles specific to AAG FP.
 * The following are intentionally NOT re-declared here because they are
 * already handled by the existing theme stylesheet (leaderboard CSS):
 *
 *   .divison-leaderboard-options, .leader-board-table,
 *   .table-heading h3, .table-blocks, .table-block table,
 *   tr.state-name h4, tr.table-row, .player-pos, .player-text,
 *   .player-initials, .tab-filter-dropdown, .table-bottom a
 *
 * @package USSSA TournamentGear Theme
 * @version 2.0.0
 */

/* ═══════════════════════════════════════════════════════
   TAB NAV ROW
   Flex wrapper: category tabs (left) + lookup button (right)
═══════════════════════════════════════════════════════ */
.aag-fp-tab-nav {
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 25px;
}

/* Override border/margin on the ul since wrapper now owns them */
.aag-fp-tab-nav .divison-leaderboard-options {
  border-bottom: none;
  margin-bottom: 0;
  flex: 1;
}

/* Lookup button — sits inline right, bottom-aligned with tab text */
.aag-fp-lookup-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--btn-y) var(--btn-x);
  margin-bottom: 10px;
  margin-left: 20px;
  background: none;
  border: 1.5px solid var(--color-brand);
  border-radius: 5px;
  color: var(--color-brand);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 160px;
  transition:
    background 0.2s,
    color 0.2s;
}
.aag-fp-lookup-btn svg {
  stroke: var(--color-brand);
  transition: stroke 0.2s;
  flex-shrink: 0;
}
.aag-fp-lookup-btn:hover,
.aag-fp-lookup-btn.active {
  background: var(--color-brand);
  color: #fff;
}
.aag-fp-lookup-btn:hover svg,
.aag-fp-lookup-btn.active svg {
  stroke: #fff;
}

/* ═══════════════════════════════════════════════════════
   MOBILE TAB SELECTOR
═══════════════════════════════════════════════════════ */
.aag-fp-mobile-selector {
  margin-bottom: 16px;
}
.aag-fp-mobile-tab-select {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════
   PANELS
═══════════════════════════════════════════════════════ */
.aag-fp-tab-content {
  /* display toggled via JS */
}

/* ═══════════════════════════════════════════════════════
   RANKED TABLE — AAG-SPECIFIC ADDITIONS ONLY
   (row/heading/avatar styles come from theme)
═══════════════════════════════════════════════════════ */

/* Gold rank for #1 — overrides the gray .player-pos color */
.aag-fp-rank-first {
  color: #f59e0b !important;
}

/* Stat value + unit in ranked rows */
.aag-fp-stat-value {
  color: #333;
  font-size: 16px;
  font-weight: 700;
}
.aag-fp-stat-unit {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 400;
  margin-left: 2px;
}

/* Player name + meta stacked inside .player-text */
.aag-fp-leaderboard .player-text .player-name {
  display: block;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}
.aag-fp-leaderboard .player-text .player-meta {
  display: block;
  font-size: 12px;
  color: #9ca3af;
}

/* ═══════════════════════════════════════════════════════
   PLAYER LOOKUP — HEADING ROW
═══════════════════════════════════════════════════════ */
/* .table-heading flex already handles left/right layout.
   Mirror the min-width from .leader-board-table .table-heading > div */
.aag-fp-lookup-heading > div {
  min-width: 120px;
}

/* ═══════════════════════════════════════════════════════
   PLAYER CARDS
═══════════════════════════════════════════════════════ */
.aag-fp-player-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}
.aag-fp-player-card.hidden {
  display: none;
}

.aag-fp-card-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
  transition: background 0.15s;
}
.aag-fp-card-header:hover {
  background: #fafbfc;
}

/* Avatar — standalone, no dependency on .player-initials */
.aag-fp-card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #23346b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
  text-align: center;
  position: static;
  transform: none;
}

.aag-fp-card-info {
  flex: 1;
  min-width: 0;
}
.aag-fp-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
}
.aag-fp-card-detail {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.aag-fp-card-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-right: 4px;
}
.aag-fp-pos-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #eef0f8;
  color: var(--color-brand);
  letter-spacing: 0.3px;
}

.aag-fp-card-toggle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.aag-fp-card-header:hover .aag-fp-card-toggle {
  background: #e5e7eb;
}
.aag-fp-card-toggle svg {
  transition: transform 0.25s;
}
.aag-fp-player-card.open .aag-fp-card-toggle svg {
  transform: rotate(180deg);
}

.aag-fp-card-body {
  display: none;
  border-top: 1px solid #e5e7eb;
}
.aag-fp-player-card.open .aag-fp-card-body {
  display: block;
}

/* ═══════════════════════════════════════════════════════
   EVAL TABS (inside player card)
   Same visual language as .divison-leaderboard-options,
   compact scale, using same CSS variables.
═══════════════════════════════════════════════════════ */
.aag-fp-eval-tabs {
  display: flex;
  background: #f9fafb;
  border-bottom: 1px solid #dee2e6;
  overflow-x: auto;
  scrollbar-width: none;
}
.aag-fp-eval-tabs::-webkit-scrollbar {
  display: none;
}

.aag-fp-eval-tab {
  color: var(--color-text-secondary, #7c8799);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 11px 14px 13px;
  position: relative;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  background: none;
  font-family: inherit;
  outline: none;
  transition: color 0.2s;
}
.aag-fp-eval-tab:hover {
  color: var(--color-brand);
}
.aag-fp-eval-tab.active {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
  background: #fff;
}

/* ═══════════════════════════════════════════════════════
   EVAL CONTENT
═══════════════════════════════════════════════════════ */
.aag-fp-eval-content {
  padding: 16px;
}

/* Subgroup title — same style as tr.state-name h4 */
.aag-fp-subgroup-title {
  color: #7c8799;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 12px 0 8px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2px;
}
.aag-fp-subgroup-title:first-child {
  padding-top: 0;
}

/* Metrics 2-col grid */
.aag-fp-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  margin-bottom: 6px;
}

.aag-fp-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.aag-fp-metric-label {
  color: #6b7280;
}
.aag-fp-metric-value {
  font-weight: 700;
  color: #333;
}
.aag-fp-metric-unit {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 2px;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════
   RATING DOTS
═══════════════════════════════════════════════════════ */
.aag-fp-rating-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}
.aag-fp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e7eb;
}
.aag-fp-dot.filled {
  background: var(--color-brand);
}
.aag-fp-dot.half {
  background: linear-gradient(90deg, var(--color-brand) 50%, #e5e7eb 50%);
}
.aag-fp-rating-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-brand);
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════
   COMMENT FIELD
═══════════════════════════════════════════════════════ */
.aag-fp-comment {
  grid-column: 1 / -1;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 5px;
  border-left: 3px solid #d1d5db;
  font-size: 12px;
  color: #4b5563;
  font-style: italic;
  line-height: 1.6;
  margin: 6px 0 10px;
}

/* ═══════════════════════════════════════════════════════
   LOOKUP FOOTER COUNT
═══════════════════════════════════════════════════════ */
.aag-fp-lookup-footer {
  text-align: center;
  padding: 16px 0 4px;
  font-size: 13px;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════
   NO DATA STATE
═══════════════════════════════════════════════════════ */
.aag-fp-no-data {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .aag-fp-tab-nav {
    display: none;
  }
  .aag-fp-card-badges {
    display: none;
  }
  .aag-fp-metrics-grid {
    grid-template-columns: 1fr;
  }
}
