/**
 * Components Stylesheet - Reusable UI Components
 */

/* App Tab Component */
.app-tab-button {
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  position: relative;
}

.app-tab-button:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  transform: translateY(-2px);
}

.app-tab-button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

/* Gang Tab Component */
.gang-tab {
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 1rem 1.2rem;
  color: var(--text-secondary);
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  position: relative;
}

.gang-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  transform: translateY(-2px);
}

.gang-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

.gang-tab-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.gang-tab-badge.has-members {
  background-color: #00cc00;
  color: white;
}

.gang-tab.active .gang-tab-badge {
  background-color: var(--accent);
  color: white;
}

.gang-tab.active .gang-tab-badge.has-members {
  background-color: #00cc00;
  color: white;
}

/* Gang Section Header */
.gang-section {
  margin-bottom: 2rem;
}

.gang-section-header {
  background: linear-gradient(135deg, #2e2e2e 0%, #1a1a1a 100%);
  padding: 1.25rem 2rem;
  border-radius: 12px;
  margin: 0 auto 2rem auto;
  max-width: 850px;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.gang-section-header-text {
  flex: 1;
  text-align: center;
}

.gang-section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.player-count {
  color: var(--accent);
  font-weight: 700;
}

.gang-section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  font-style: italic;
}

.section-description {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  font-style: italic;
}

/* Stats Section */
.stats-section {
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
}

.stats-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stats-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stats-value.online {
  color: var(--online-status);
}

/* Player List Container */
.player-list-container {
  max-width: 850px;
  margin: 0 auto;
}

/* Player List Header (Sort Headers) */
.player-list-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px 8px 0 0;
  margin-bottom: 0.5rem;
  max-width: 850px;
  margin: 0 auto;
}

.sort-header {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease;
  text-align: left;
  white-space: nowrap;
}

.sort-header:hover {
  color: var(--accent);
}

.sort-name {
  justify-self: start;
  margin-left: 1.6rem;
}

.sort-ping {
  justify-self: end;
  text-align: right;
  margin-right: 1.6rem;
}

.sort-id {
  justify-self: end;
  text-align: right;
  margin-right: 2.6rem;
}

/* Player List */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 850px;
  margin: 0 auto;
}

.player-list-section {
  margin-bottom: 1.5rem;
}

.player-list-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* Player Card Component */
.player-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.2s ease;
  position: relative;
  width: 100%;
}

.player-card:hover {
  background-color: var(--bg-hover);
  transform: translateX(4px);
}

.player-card.online {
  border-left: 4px solid var(--online-status);
}

.player-card.offline {
  border-left: 4px solid var(--offline-status);
  opacity: 0.7;
}

.player-card.highlight {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.player-card.highlight .player-name,
.player-card.highlight .player-status {
  color: white;
}

/* Status Badge */
.status-badge {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.player-card.online .status-badge {
  background-color: var(--online-status);
  box-shadow: 0 0 8px var(--online-status);
  animation: pulse 2s ease infinite;
}

.player-card.offline .status-badge {
  background-color: var(--offline-status);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Player Info */
.player-info {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.3rem;
}

.player-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

/* Player name and gang badge on same line */
.player-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.player-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.online-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.player-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-self: end;
}

/* Ping Badge */
.ping-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  width: 60px;
  text-align: center;
}

.ping-excellent {
  background-color: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid #4CAF50;
}

.ping-good {
  background-color: rgba(139, 195, 74, 0.2);
  color: #8BC34A;
  border: 1px solid #8BC34A;
}

.ping-fair {
  background-color: rgba(255, 193, 7, 0.2);
  color: #FFC107;
  border: 1px solid #FFC107;
}

.ping-poor {
  background-color: rgba(244, 67, 54, 0.2);
  color: #F44336;
  border: 1px solid #F44336;
}

.player-status {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
  width: 95px;
  text-align: center;
}

.player-card.online .player-status {
  background-color: rgba(76, 175, 80, 0.2);
  color: var(--online-status);
}

.player-card.offline .player-status {
  background-color: rgba(117, 117, 117, 0.2);
  color: var(--offline-status);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state-description {
  font-size: 0.95rem;
}

/* Gang Badge (for All Players tab) */
.gang-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0;
  margin-top: 0;
  color: white;
  white-space: nowrap;
}

/* Confidence Badges */
.confidence-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.confidence-high {
  background-color: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid #4CAF50;
}

.confidence-low {
  background-color: rgba(255, 193, 7, 0.2);
  color: #FFC107;
  border: 1px solid #FFC107;
}

.confidence-ambiguous {
  background-color: rgba(244, 67, 54, 0.2);
  color: #F44336;
  border: 1px solid #F44336;
}

/* Identity Dropdown */
.identity-dropdown {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.identity-dropdown:hover {
  border-color: var(--accent);
}

.identity-dropdown:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Unconfirmed Player Cards */
.player-card.unconfirmed {
  border-left-color: #FFC107;
  background-color: var(--bg-hover);
}

/* Unidentified Section */
.unidentified-section {
  margin: 0 auto 2rem auto;
  max-width: 850px;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  border: 2px solid #F44336;
}

.unidentified-header {
  margin-bottom: 1rem;
}

.unidentified-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #F44336;
  margin-bottom: 0.5rem;
}

.unidentified-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Responsive Components */
@media (max-width: 768px) {
  .gang-section-header {
    padding: 1.5rem;
  }

  .gang-section-title {
    font-size: 1.5rem;
  }

  .gang-tab {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .stats-section {
    padding: 1rem;
  }

  .stats-value {
    font-size: 1.25rem;
  }

  .player-card {
    padding: 0.875rem 1rem;
  }

  .player-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .player-details {
    width: 100%;
  }

  .player-name {
    font-size: 0.95rem;
  }

  .player-name-row {
    gap: 0.4rem;
  }

  .online-time {
    font-size: 0.75rem;
  }

  .player-stats {
    width: 100%;
    justify-content: space-between;
  }

  .ping-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }

  .player-status {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .gang-tab {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }

  .stats-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-card {
    padding: 0.75rem;
  }

  .player-name-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Player ID styling */
.player-name-container {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.player-id {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: 'Courier New', monospace;
}

/* FiveM Names Display */
.fivem-names {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-style: italic;
}
