/**
 * Builder Cards v7.6.4
 * Extracted from team-builder.css (Sprint 4)
 *
 * Card system: base builder-card, pos-card, skill-card,
 * skill size tabs, category headers.
 *
 * Depends on: builder-core.css
 */

/* ============================================
   BUILDER-CARD: Unified base for pos-card & skill-card
   Both use identical structure, only accent colors differ
============================================ */
.builder-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: linear-gradient(145deg, rgba(50, 58, 70, 0.98) 0%, rgba(38, 44, 54, 0.95) 100%);
  border: 1px solid rgba(90, 100, 115, 0.5);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  transition: all var(--transition-fast);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: default;
  min-height: 70px;
}

/* Left accent bar */
.builder-card::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 0;
  bottom: 5px;
  width: 3px;
  background: rgba(120, 130, 145, 0.5);
  border-radius: 0 2px 2px 0;
  transition: all var(--transition-fast);
}

.builder-card:hover {
  border-color: var(--cat-color);
  background: linear-gradient(145deg, rgba(58, 66, 78, 0.98) 0%, rgba(45, 52, 62, 0.95) 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 12px var(--cat-glow);
}

.builder-card:hover::before {
  background: var(--cat-color);
}

.builder-card.has-qty {
  border-color: var(--cat-color);
  background: linear-gradient(145deg, rgba(45, 38, 32, 0.95) 0%, rgba(28, 24, 20, 0.9) 100%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), 0 0 10px var(--cat-glow);
}

.builder-card.has-qty::before {
  background: linear-gradient(180deg, var(--cat-color), var(--cat-dark));
}

/* Card name - centered text */
.card-name {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-heading);
  white-space: nowrap;
  text-align: center;
  padding: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Preset card names - allow wrapping for long team names */
.preset-card .card-name {
  white-space: normal;
  line-height: 1.1;
  font-size: 0.85rem;
  word-break: break-word;
  padding: 0 2px;
}

.builder-card.has-qty .card-name {
  color: var(--cat-color);
}

/* Info button - small circle top-right */
.builder-card .card-info-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  padding: 0;
  background: rgba(60, 70, 80, 0.6);
  border: none;
  border-radius: 50%;
  color: rgba(140, 150, 160, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.45rem;
  transition: all var(--transition-fast);
  z-index: 2;
}

.builder-card .card-info-btn:hover {
  background: rgba(184, 154, 87, 0.6);
  color: var(--gold-300);
  transform: scale(1.1);
}

.builder-card .card-info-btn:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 1px;
}

/* Card Row Layout */
.builder-card .card-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.builder-card .card-row-top {
  justify-content: center;
  flex: 1;
}

.builder-card .card-row-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(60, 68, 78, 0.3);
  margin-top: auto;
}

/* Qty value styling */
.builder-card .qty-value {
  min-width: 24px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--gold-400);
  letter-spacing: 0.02em;
}

.builder-card .qty-max {
  color: rgba(140, 150, 160, 0.7);
  font-weight: 500;
}

/* ============================================
   POS-CARD: Extends builder-card
   Adds position type colors + size tag
============================================ */

/* Position type color coding - left accent bar (muted palette) */
.pos-card.lineman::before { background: linear-gradient(180deg, var(--pos-lineman), var(--pos-lineman-dark)); }
.pos-card.catcher::before { background: linear-gradient(180deg, var(--pos-catcher), var(--pos-catcher-dark)); }
.pos-card.thrower::before { background: linear-gradient(180deg, var(--pos-thrower), var(--pos-thrower-dark)); }
.pos-card.blitzer::before { background: linear-gradient(180deg, var(--pos-blitzer), var(--pos-blitzer-dark)); }
.pos-card.blocker::before { background: linear-gradient(180deg, var(--pos-blocker), var(--pos-blocker-dark)); }
.pos-card.runner::before { background: linear-gradient(180deg, var(--pos-runner), var(--pos-runner-dark)); }
.pos-card.big-guy::before { background: linear-gradient(180deg, var(--pos-big-guy), var(--pos-big-guy-dark)); }

.pos-card.has-qty.lineman::before { background: linear-gradient(180deg, var(--pos-lineman-light), var(--pos-lineman)); }
.pos-card.has-qty.catcher::before { background: linear-gradient(180deg, var(--pos-catcher-light), var(--pos-catcher)); }
.pos-card.has-qty.thrower::before { background: linear-gradient(180deg, var(--pos-thrower-light), var(--pos-thrower)); }
.pos-card.has-qty.blitzer::before { background: linear-gradient(180deg, var(--pos-blitzer-light), var(--pos-blitzer)); }
.pos-card.has-qty.blocker::before { background: linear-gradient(180deg, var(--pos-blocker-light), var(--pos-blocker)); }
.pos-card.has-qty.runner::before { background: linear-gradient(180deg, var(--pos-runner-light), var(--pos-runner)); }
.pos-card.has-qty.big-guy::before { background: linear-gradient(180deg, var(--pos-big-guy-light), var(--pos-big-guy)); }

/* Size tags (32mm/40mm) - top left corner */
.pos-size-tag {
  position: absolute;
  top: 3px;
  left: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 600;
  padding: var(--space-1) 0.25rem;
  border-radius: var(--radius-xs);
  line-height: 1;
}

.pos-size-tag.size-32mm {
  background: rgba(80, 90, 100, 0.35);
  color: rgba(160, 165, 175, 0.9);
  border: 1px solid rgba(90, 100, 110, 0.3);
}

.pos-size-tag.size-40mm {
  background: rgba(112, 80, 160, 0.3);
  color: rgba(190, 170, 220, 0.95);
  border: 1px solid rgba(112, 80, 160, 0.4);
}

.pos-card.has-qty .pos-size-tag.size-32mm {
  background: rgba(100, 110, 120, 0.4);
  color: rgba(180, 185, 195, 0.95);
}

.pos-card.has-qty .pos-size-tag.size-40mm {
  background: rgba(136, 104, 184, 0.4);
  color: rgba(210, 190, 235, 1);
}

/* Inline number pickers for 40mm Big Guys */
.inline-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  padding: 0.35rem 0;
}

.inline-num-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 0.35rem;
  background: rgba(20, 24, 28, 0.7);
  border: 1px solid rgba(112, 80, 160, 0.35);
  border-radius: var(--radius-xs);
  color: rgba(160, 140, 180, 0.8);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.inline-num-btn:hover {
  border-color: var(--gold-600);
  color: var(--gold-400);
  background: rgba(184, 154, 87, 0.1);
}

.inline-num-btn.has-number {
  background: linear-gradient(135deg, rgba(184, 154, 87, 0.2), rgba(140, 85, 35, 0.15));
  border-color: rgba(184, 154, 87, 0.5);
  color: var(--gold-400);
}

.inline-num-btn.picker-open {
  border-color: var(--gold-600);
  box-shadow: 0 0 6px rgba(184, 154, 87, 0.3);
}

/* Qty Controls - Team Builder specific (high specificity to override shop styles) */
.team-builder-page .qty-btn,
.picker-section .qty-btn,
.pos-card .qty-btn,
.skill-card .qty-btn {
  width: 28px;
  height: 28px;
  background: linear-gradient(145deg, rgba(184, 154, 87, 0.4), rgba(140, 87, 40, 0.35));
  border: 1px solid rgba(184, 154, 87, 0.6);
  color: var(--text-primary);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
  min-width: 28px;
  min-height: 28px;
}

.team-builder-page .qty-btn:hover:not(:disabled),
.picker-section .qty-btn:hover:not(:disabled),
.pos-card .qty-btn:hover:not(:disabled),
.skill-card .qty-btn:hover:not(:disabled) {
  background: linear-gradient(145deg, rgba(184, 154, 87, 0.6), rgba(160, 100, 45, 0.55));
  border-color: var(--gold-600);
  color: var(--text-primary);
  transform: none;
}

.team-builder-page .qty-btn:active:not(:disabled),
.picker-section .qty-btn:active:not(:disabled),
.pos-card .qty-btn:active:not(:disabled),
.skill-card .qty-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.team-builder-page .qty-btn:disabled,
.picker-section .qty-btn:disabled,
.pos-card .qty-btn:disabled,
.skill-card .qty-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  background: rgba(60, 68, 78, 0.5);
  border-color: rgba(80, 88, 98, 0.4);
  color: rgba(150, 155, 165, 0.6);
}

/* Focus states for qty buttons */
.team-builder-page .qty-btn:focus-visible,
.picker-section .qty-btn:focus-visible,
.pos-card .qty-btn:focus-visible,
.skill-card .qty-btn:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 1px;
}

.qty-value {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold-400);
}

.qty-max {
  color: rgba(140, 150, 160, 0.7);
  font-weight: 500;
}

/* Tooltip for full name on hover */
.pos-card[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--gold-600);
  color: var(--text-primary);
  padding: var(--space-2) 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-weight: 500;
}


/* Team button generic style */
.team-btn-generic {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-color: var(--gold-600);
}

.team-btn-generic i {
  color: var(--gold-600);
}

.team-btn-generic.active i {
  color: var(--text-on-gold);
}

/* Big Guys Section */
.big-guys-list {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.big-guy-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: var(--space-3) 1rem;
  transition: all var(--transition-fast);
}

.big-guy-option:hover {
  border-color: var(--border-default);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bg-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}



/* Big Guy Card */
.big-guy-card {
  background: linear-gradient(135deg, rgba(184, 154, 87, 0.15) 0%, rgba(184, 154, 87, 0.05) 100%);
  border: 2px solid var(--gold-600);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: 0 4px 20px rgba(184, 154, 87, 0.2);
  position: relative;
}

.big-guy-card::before {
  content: '40mm';
  position: absolute;
  top: -10px;
  right: 10px;
  background: linear-gradient(135deg, var(--gold-600), var(--gold-400));
  color: var(--text-on-gold);
  font-size: 0.7rem;
  padding: var(--space-1) 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-muted);
}

.bg-header .bg-name {
  font-size: 1.15rem;
  color: var(--gold-400);
}



.bg-player-num {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 1rem;
}

.bg-player-num label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.player-number-input {
  width: 70px;
  background: var(--bg-dark);
  border: 1px solid var(--border-muted);
  color: var(--gold-600);
  padding: var(--space-2) 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.player-number-input:focus {
  outline: none;
  border-color: var(--gold-600);
}

.bg-skills label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.bg-skill-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-dark);
  border: 1px dashed var(--border-muted);
  color: var(--text-secondary);
  padding: var(--space-2) 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.skill-tag.filled {
  background: linear-gradient(135deg, rgba(184, 154, 87, 0.2) 0%, rgba(184, 154, 87, 0.1) 100%);
  border: 1px solid var(--gold-600);
  border-style: solid;
  color: var(--gold-400);
  font-weight: 500;
}

.skill-tag.empty {
  cursor: pointer;
}

.skill-tag.empty:hover {
  border-color: var(--gold-600);
  color: var(--gold-600);
}

.skill-tag .remove-skill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  margin-left: 0.35rem;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.skill-tag .remove-skill:hover {
  color: var(--status-error);
}


/* ========================================================
   SKILL SIZE TABS (32mm / 40mm toggle)
   ======================================================== */
.skill-size-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-2);
  background: rgba(25, 30, 38, 0.6);
  border: 1px solid rgba(70, 80, 95, 0.35);
  border-radius: var(--radius-lg);
}

.skill-size-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: rgba(40, 46, 56, 0.6);
  border: 2px solid rgba(80, 90, 105, 0.4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  color: var(--text-secondary);
}

.skill-size-tab i {
  font-size: 1.1rem;
  opacity: 0.6;
  transition: all var(--transition-normal);
}

.skill-size-tab .tab-label {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skill-size-tab .tab-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
}

.skill-size-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.skill-size-tab:hover i {
  opacity: 0.8;
}

/* Active 32mm tab */
.skill-size-tab.active[data-size="32"] {
  background: linear-gradient(135deg, rgba(90, 138, 92, 0.25) 0%, rgba(90, 138, 92, 0.1) 100%);
  border-color: rgba(90, 138, 92, 0.5);
  color: var(--text-primary);
}

.skill-size-tab.active[data-size="32"] i {
  color: var(--cat-general);
  opacity: 1;
}

.skill-size-tab.active[data-size="32"] .tab-count {
  background: rgba(90, 138, 92, 0.3);
  color: #8fca91;
}

/* Active 40mm tab */
.skill-size-tab.active[data-size="40"] {
  background: linear-gradient(135deg, rgba(120, 80, 160, 0.25) 0%, rgba(120, 80, 160, 0.1) 100%);
  border-color: rgba(120, 80, 160, 0.5);
  color: var(--text-primary);
}

.skill-size-tab.active[data-size="40"] i {
  color: #a080d0;
  opacity: 1;
}

.skill-size-tab.active[data-size="40"] .tab-count {
  background: rgba(120, 80, 160, 0.3);
  color: #c0a0e0;
}

/* Skills Filter Container - unified class name across all builders */
#skillFilters.skill-filter-bar {
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
  padding: 0 var(--space-4);
}

/* Filter buttons: Uses unified .filter-btn from core/components.css */

/* ---- Team Skill Access Indicators ---- */
/* Primary access: gold dot + boosted visibility */
.filter-btn.is-primary {
  position: relative;
  border-color: rgba(184, 154, 87, 0.5);
}
.filter-btn.is-primary::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-600, #B89A57);
  box-shadow: 0 0 4px rgba(184, 154, 87, 0.6);
}

/* Secondary access: silver dot + subtle visibility */
.filter-btn.is-secondary {
  position: relative;
  border-color: rgba(160, 168, 178, 0.35);
}
.filter-btn.is-secondary::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(180, 188, 198, 0.6);
}

/* Irrelevant categories: dimmed */
.filter-btn.is-irrelevant {
  opacity: 0.45;
}
.filter-btn.is-irrelevant:hover {
  opacity: 0.75;
}

/* Active state overrides — always full opacity when clicked */
.filter-btn.active.is-irrelevant {
  opacity: 1;
}
/* Hide dot when filter is active (the active gradient makes it clear) */
.filter-btn.active.is-primary::after,
.filter-btn.active.is-secondary::after {
  display: none;
}

/* Unified skills card container */
.skills-grid,
#skillsGrid {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: var(--space-4);
  padding: var(--space-4);
  width: 100%;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Each category section inside the unified card */
.skill-category {
  display: block !important;
  width: 100% !important;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: var(--space-4);
}

.skill-category:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.skill-category.hidden {
  display: none !important;
}

/* ============================================
   CATEGORY HEADERS
   Uses unified .category-header from core/components.css
   Only layout-specific overrides below
============================================ */
.category-header {
  margin-bottom: var(--space-2);
}

.category-skills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-2);
}

@media (max-width: 768px) {
  .category-skills {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .category-skills {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   SKILL-CARD: Extends builder-card from components.css
   Category colors defined in core/components.css
   Team-builder specific overrides below
============================================ */

/* Skill card with quantity - use category color */
.skill-card.has-qty {
  border-color: var(--cat-color);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), 0 0 10px var(--cat-glow);
}

.skill-card.has-qty .card-name {
  color: var(--cat-color);
}

/* Tooltip for full skill name on hover */
.skill-card[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--gold-600);
  color: var(--text-primary);
  padding: var(--space-2) 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-weight: 500;
}

/* Hide the skill name, show code only */
.skill-name {
  display: none;
}

