/**
 * AAG FP Leaderboard Styles
 * 
 * All classes prefixed with .aag-fp- to avoid any conflict
 * with existing leaderboard CSS. This file is completely independent.
 * 
 * @package USSSA TournamentGear Theme
 * @version 1.0.0
 */

/* ===== Container ===== */
.aag-fp-leaderboard {
  width: 100%;
}

/* ===== Tab Navigation ===== */
.aag-fp-tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.aag-fp-tabs::-webkit-scrollbar {
  display: none;
}

.aag-fp-tab {
  padding: 11px 18px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  outline: none;
  font-family: inherit;
}
.aag-fp-tab:hover {
  color: #23346b;
}
.aag-fp-tab.active {
  color: #23346b;
  border-bottom-color: #23346b;
  font-weight: 600;
}

.aag-fp-tab-lookup {
  margin-left: auto;
  color: #23346b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ===== Mobile Tab Selector ===== */
.aag-fp-mobile-selector {
  margin-bottom: 12px;
}
.aag-fp-mobile-tab-select {
  width: 100%;
  box-sizing: border-box;
}

/* ===== Filter Bar ===== */
.aag-fp-filter-bar {
  padding: 16px 0 0;
}
.aag-fp-filter-select {
  padding: 7px 30px 7px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #374151;
  background: #fff;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
}

/* ===== Tab Content ===== */
.aag-fp-tab-content {
  padding-top: 16px;
}
.aag-fp-tab-header {
  margin-bottom: 16px;
}
.aag-fp-tab-heading {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: #23346b;
}

/* ===== Stat Tables Grid ===== */
.aag-fp-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 28px;
}

.aag-fp-stat-block {
}

.aag-fp-stat-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #6b7280;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2px;
}

/* ===== Leader Row ===== */
.aag-fp-leader-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}
.aag-fp-leader-row:last-of-type {
  border-bottom: none;
}

.aag-fp-rank {
  width: 22px;
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  flex-shrink: 0;
}
.aag-fp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #23346b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 10px;
  flex-shrink: 0;
}
.aag-fp-player-info {
  flex: 1;
  min-width: 0;
}
.aag-fp-player-name {
  font-size: 13px;
  font-weight: 600;
  color: #23346b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aag-fp-player-meta {
  font-size: 11px;
  color: #9ca3af;
}
.aag-fp-value {
  font-size: 17px;
  font-weight: 700;
  color: #23346b;
  margin-left: 10px;
  flex-shrink: 0;
}
.aag-fp-unit {
  font-size: 10px;
  font-weight: 500;
  color: #9ca3af;
  margin-left: 2px;
}

.aag-fp-view-all {
  display: block;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #23346b;
  text-decoration: none;
  cursor: pointer;
}
.aag-fp-view-all:hover {
  text-decoration: underline;
}
.aag-fp-view-all svg {
  vertical-align: middle;
  margin-left: 2px;
}

/* ===== No Data ===== */
.aag-fp-no-data {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* ===== PLAYER LOOKUP TAB ===== */
.aag-fp-lookup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.aag-fp-search-box {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.aag-fp-search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.aag-fp-search-box input:focus {
  border-color: #23346b;
}
.aag-fp-search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  stroke: #9ca3af;
}

.aag-fp-player-count {
  font-size: 13px;
  color: #6b7280;
}
.aag-fp-player-count strong {
  color: #23346b;
}

/* ===== Player Card ===== */
.aag-fp-player-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.aag-fp-player-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.aag-fp-card-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.aag-fp-card-header:hover {
  background: #fafbfc;
}

.aag-fp-card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #23346b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
}
.aag-fp-card-info {
  flex: 1;
}
.aag-fp-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #23346b;
}
.aag-fp-card-detail {
  font-size: 12px;
  color: #6b7280;
  margin-top: 1px;
}
.aag-fp-card-positions {
  display: flex;
  gap: 4px;
  margin-right: 10px;
}
.aag-fp-pos-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #eef0f4;
  color: #23346b;
  letter-spacing: 0.5px;
}
.aag-fp-card-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}
.aag-fp-player-card.open .aag-fp-card-toggle {
  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 Group Tabs (inside player card) ===== */
.aag-fp-eval-tabs {
  display: flex;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  scrollbar-width: none;
}
.aag-fp-eval-tabs::-webkit-scrollbar {
  display: none;
}
.aag-fp-eval-tab {
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  background: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: inherit;
  outline: none;
}
.aag-fp-eval-tab:hover {
  color: #23346b;
}
.aag-fp-eval-tab.active {
  color: #23346b;
  border-bottom-color: #23346b;
  background: #fff;
}

.aag-fp-eval-content {
  padding: 16px;
}

/* ===== Subgroup Title ===== */
.aag-fp-subgroup-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #23346b;
  padding: 12px 0 8px;
  border-bottom: 2px solid #23346b;
  margin-bottom: 4px;
}
.aag-fp-subgroup-title:first-child {
  padding-top: 0;
}

/* ===== Metrics Grid ===== */
.aag-fp-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

.aag-fp-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #f3f4f6;
}
.aag-fp-metric-label {
  font-size: 12px;
  color: #6b7280;
}
.aag-fp-metric-value {
  font-size: 13px;
  font-weight: 700;
  color: #23346b;
}
.aag-fp-metric-unit {
  font-size: 10px;
  color: #9ca3af;
  margin-left: 2px;
}
.aag-fp-metric-empty {
  color: #d1d5db;
  font-style: italic;
  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: #23346b;
}
.aag-fp-dot.half {
  background: linear-gradient(90deg, #23346b 50%, #e5e7eb 50%);
}
.aag-fp-rating-num {
  font-size: 12px;
  font-weight: 700;
  color: #23346b;
  margin-left: 4px;
}

/* ===== Comment ===== */
.aag-fp-comment {
  grid-column: 1 / -1;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 6px;
  margin: 6px 0 10px;
  font-size: 12px;
  color: #4b5563;
  font-style: italic;
  line-height: 1.6;
  border-left: 3px solid #d1d5db;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .aag-fp-tabs {
    display: none;
  }
  .aag-fp-stat-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .aag-fp-metrics-grid {
    grid-template-columns: 1fr;
  }
  .aag-fp-search-box {
    max-width: 100%;
  }
  .aag-fp-lookup-header {
    flex-direction: column;
    align-items: stretch;
  }
  .aag-fp-card-positions {
    display: none;
  }
}
