/* Trade Builder Styles - Dark Theme */
.trade-builder-container {
  width: 100%;
  height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.trade-builder-header {
  text-align: center;
  padding: 1em 0;
  background: var(--bg-primary);
  flex-shrink: 0;
}

.trade-builder-header h1 {
  font-size: 1.5em;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25em;
}

.trade-builder-header .subtitle {
  font-size: 1em;
  color: var(--text-muted);
  margin: 0;
}

/* Partner Selection */
.partner-selection {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1em;
  margin: 0 1em 1em 1em;
  flex-shrink: 0;
}

.partner-selection h2 {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1em;
  max-width: 800px;
  margin: 0 auto;
}

.partner-option {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  background: var(--bg-secondary);
}

.partner-option:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.partner-option.selected {
  border-color: var(--accent-success);
  background: rgba(0, 223, 196, 0.1);
}

.partner-select-btn {
  width: 100%;
  padding: 1em;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1em;
  font-size: 1em;
  color: var(--text-primary);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.partner-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* Trade Workspace */
.trade-workspace {
  flex: 1;
  padding: 0 1em 1em 1em;
  overflow: hidden;
  min-height: 0;
}

.roster-section-header-left {
  width: 100%;
  padding: 0.5em 0 1em 0;
  border: none;
  background: transparent;
  color: var(--accent-primary);
  font-size: 1.1em;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  outline: none;
}

.roster-section-header {
  width: 100%;
  padding: 0.5em 0 1em 0;
  border: none;
  background: transparent;
  color: var(--accent-primary);
  font-size: 1.1em;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  appearance: none;
  cursor: pointer;
  margin: 0;
  outline: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%237ec4ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right center;
  background-repeat: no-repeat;
  background-size: 1.2em 1.2em;
  padding-right: 1.5em;
}

.roster-section-header:hover {
  color: #ffffff;
}

/* Player Search */
.player-search-container {
  position: relative;
  margin-bottom: 1em;
}

.player-search-input {
  width: 100%;
  padding: 0.75em 1em;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1em;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.player-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.player-search-input::placeholder {
  color: var(--text-muted);
}

/* Search Results */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.75em 1em;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: var(--bg-tertiary);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.search-player-info {
  flex: 1;
}

.search-player-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9em;
}

.search-player-position {
  font-size: 0.8em;
  color: var(--text-muted);
}

.no-search-results {
  padding: 1em;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* Trade Items */
.trade-items {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.trade-item {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.75em;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  position: relative;
}

.player-item {
  border-left: 3px solid var(--accent-primary);
}

.pick-item {
  border-left: 3px solid var(--accent-warning);
}

.faab-item {
  border-left: 3px solid var(--accent-success);
}

.trade-player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.trade-player-info {
  flex: 1;
}

.trade-player-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95em;
}

.trade-player-position {
  font-size: 0.8em;
  color: var(--text-muted);
}

.remove-trade-item {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--accent-danger);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.remove-trade-item:hover {
  background: #cc0000;
  transform: scale(1.1);
}

.empty-trade-message {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 1.5em;
}

/* Trade Actions */
.btn-secondary {
  padding: 0.75em 2em;
  border: 1px solid var(--text-muted);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-color);
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.btn-primary {
  padding: 0.75em 2em;
  border: none;
  background: var(--accent-success);
  color: #000;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  background: #00b8a3;
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

.player-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.75em;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-tertiary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.player-card:hover {
  border-color: var(--accent-primary);
  background: var(--border-color);
}

.player-card.selected {
  border-color: var(--accent-success);
  background: rgba(0, 223, 196, 0.1);
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  min-width: 0;
}

.player-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-position-team {
  font-size: 0.8em;
  color: var(--text-muted);
}

.player-ktc-info {
  font-size: 0.8em;
  color: var(--accent-primary);
  font-weight: 500;
}

/* Player Scoring Badges */
.player-scores {
  display: flex;
  gap: 0.4em;
  margin-top: 0.25em;
}

.score-badge {
  font-size: 0.7em;
  font-weight: 600;
  color: #000;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  text-shadow: none;
  line-height: 1;
}

.score-badge.value-score {
  /* Background color set dynamically via style attribute */
}

.score-badge.contender-score {
  /* Background color set dynamically via style attribute */
}

.add-player-btn {
  display: none;
}

/* No leagues message */
.no-leagues {
  text-align: center;
  padding: 3em;
  color: var(--text-muted);
  font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 1400px) {
  .partner-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 1200px) {
  .trade-builder-container {
    height: auto;
  }
}

/* Add these styles to your trade-builder.css file */

.faab-input-container {
  margin-top: 0.5em;
  padding: 0.75em;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.faab-input {
  width: 80px;
  padding: 0.4em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9em;
}

.faab-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.add-faab-btn {
  padding: 0.4em 0.8em;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.add-faab-btn:hover:not(:disabled) {
  background: var(--accent-secondary);
}

.add-faab-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.faab-item {
  border-left: 3px solid #4caf50 !important;
}

@media (max-width: 1024px) {
  #trade-builder-tab {
    height: auto !important;
    min-height: 100vh !important;
  }

  .trade-builder-container {
    overflow: visible !important;
  }

  .trade-workspace {
    overflow: visible !important;
    padding: 0.25em;
  }

  /* Make roster headers smaller */
  .roster-section-header,
  .roster-section-header-left {
    font-size: 0.9em;
    padding: 0.25em 0 0.75em 0;
  }

  /* Smaller player cards */
  .player-card {
    padding: 0.5em;
    gap: 0.75em;
  }

  .player-avatar {
    width: 32px;
    height: 32px;
  }

  .player-name {
    font-size: 0.85em;
  }

  .player-position-team,
  .player-ktc-info {
    font-size: 0.75em;
  }

  .score-badge {
    font-size: 0.6em;
    padding: 0.1em 0.3em;
  }

  /* Adjust trade summary for mobile */
  .trade-summary {
    grid-template-columns: 1fr auto 1fr;
    gap: 1em;
  }

  .trade-arrow {
    font-size: 1.5em;
  }

  /* Make trade boxes more compact */
  .trade-box {
    min-height: 120px;
    padding: 0.75em;
  }

  /* Smaller search inputs */
  .player-search-input {
    padding: 0.6em 0.75em;
    font-size: 0.9em;
  }
}

/* Very small screens - still use good portion of screen */
@media (max-width: 480px) {
  .roster-section {
    max-height: 50vh;
  }
}

#trade-builder-tab {
  height: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.trade-builder-container {
  flex: 1;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.trade-workspace {
  flex: 1;
  overflow: visible;
}

/* Override base tab CSS for trade builder */
#trade-builder-tab.tab-content.active {
  display: flex !important;
  flex-direction: column !important;
}