/* ==================== PLAYER TRACKER ==================== */

.player-tracker-container {
  padding: 20px;
}

/* ==================== FILTERS BAR ==================== */

.player-tracker-filters {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  padding: 20px;
  background: rgba(20, 22, 28, 0.8);
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.pt-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pt-filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
}

.pt-filter-group select,
.pt-filter-group input[type="date"],
.pt-filter-group input[type="text"] {
  padding: 10px 14px;
  background: rgba(15, 17, 21, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 0.875rem;
  min-width: 180px;
  transition: all 0.2s ease;
}

.pt-filter-group select:focus,
.pt-filter-group input:focus {
  outline: none;
  border-color: #5b7fff;
}

.pt-filter-group select option {
  background: #0f1115;
  color: #fff;
}

.pt-btn-apply {
  padding: 10px 24px;
  background: #5b7fff;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pt-btn-apply:hover {
  background: #4a6ae8;
  transform: translateY(-1px);
}

/* ==================== AUTOCOMPLETE ==================== */

.pt-autocomplete-wrapper {
  position: relative;
}

.pt-player-input {
  padding: 10px 14px;
  background: rgba(15, 17, 21, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 0.875rem;
  min-width: 200px;
  width: 100%;
  transition: all 0.2s ease;
}

.pt-player-input:focus {
  outline: none;
  border-color: #5b7fff;
}

.pt-player-input::placeholder {
  color: #6b7280;
}

.pt-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(15, 17, 21, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.pt-autocomplete-dropdown.active {
  display: block;
}

.pt-autocomplete-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-autocomplete-item:last-child {
  border-bottom: none;
}

.pt-autocomplete-item:hover,
.pt-autocomplete-item.active {
  background: rgba(91, 127, 255, 0.15);
}

.pt-autocomplete-name {
  font-weight: 500;
  color: #fff;
}

.pt-autocomplete-games {
  font-size: 0.75rem;
  color: #6b7280;
}

.pt-autocomplete-empty {
  padding: 15px;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
}

/* ==================== CONTENT LAYOUT ==================== */

.player-tracker-content {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  min-height: calc(100vh - 220px);
}

/* ==================== LEFT PANEL ==================== */

.player-tracker-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Profile Card */
.player-profile-card {
  background: rgba(15, 17, 21, 0.6);
  border-radius: 8px;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid #5b7fff;
  padding: 2px;
  background: linear-gradient(135deg, #5b7fff, #9c27b0);
  position: relative;
  flex-shrink: 0;
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1d24, #0f1115);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #5b7fff;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0f1115;
  position: absolute;
  top: 0;
  left: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0f1115;
}

.profile-info h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px 0;
}

.profile-info .profile-account {
  font-size: 0.8rem;
  color: #9ca3af;
}

.profile-accounts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.profile-account-tag {
  padding: 3px 8px;
  background: rgba(91, 127, 255, 0.1);
  border: 1px solid rgba(91, 127, 255, 0.2);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-account-tag:hover,
.profile-account-tag.active {
  background: rgba(91, 127, 255, 0.2);
  border-color: #5b7fff;
  color: #5b7fff;
}

/* Rank Display */
.profile-rank {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(15, 17, 21, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-rank-loading {
  font-size: 0.75rem;
  color: #6b7280;
}

.profile-rank-icon {
  width: 42px;
  height: 42px;
}

.profile-rank-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-rank-tier {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.profile-rank-lp {
  font-size: 0.75rem;
  color: #9ca3af;
}

.profile-rank-unranked {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Stats Grid - Flat design without boxes */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 15px;
  margin-top: 5px;
}

.profile-stat {
  text-align: center;
  padding: 8px 4px;
}

.profile-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: block;
  line-height: 1.2;
}

.profile-stat-value.positive {
  color: #4caf50;
}

.profile-stat-value.negative {
  color: #f44336;
}

.profile-stat-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 4px;
  display: block;
}

/* Champion Stats */
.player-champion-stats {
  background: rgba(15, 17, 21, 0.6);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.player-champion-stats h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Champion Stats Header with Filters */
.champion-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.champion-stats-header h3 {
  margin: 0;
  font-size: 0.9rem;
  color: #e4e6eb;
}

.champion-stats-filters {
  display: flex;
  gap: 6px;
}

.cs-filter-btn {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cs-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e4e6eb;
}

.cs-filter-btn.active {
  background: rgba(91, 127, 255, 0.2);
  border-color: #5b7fff;
  color: #5b7fff;
}

.champion-stats-table {
  width: 100%;
  border-collapse: collapse;
}

.champion-stats-table thead th {
  font-size: 0.65rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.champion-stats-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}

.champion-stats-table tbody tr:hover {
  background: rgba(91, 127, 255, 0.05);
}

.champion-stats-table td {
  padding: 10px 6px;
  font-size: 0.8rem;
  color: #e4e6eb;
}

.champion-stats-table .champ-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.champion-stats-table .champ-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.champion-stats-table .champ-name {
  font-weight: 500;
}

.champion-stats-table .wr-high {
  color: #4caf50;
  font-weight: 600;
}

.champion-stats-table .wr-mid {
  color: #ff9800;
  font-weight: 600;
}

.champion-stats-table .wr-low {
  color: #f44336;
  font-weight: 600;
}

.champion-stats-table .gd-positive,
.champion-stats-table .positive {
  color: #4caf50;
}

.champion-stats-table .gd-negative,
.champion-stats-table .negative {
  color: #f44336;
}

/* ==================== RIGHT PANEL - MATCH HISTORY ==================== */

.player-tracker-right {
  background: rgba(15, 17, 21, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.match-history-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.match-history-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-history-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.match-count {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Match History Table */
.match-history-table-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
}

.match-history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}

.match-history-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(20, 22, 28, 0.95);
}

.match-history-table thead th {
  font-size: 0.65rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.match-history-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}

.match-history-table tbody tr:nth-child(even) {
  background: rgba(20, 22, 28, 0.3);
}

.match-history-table tbody tr:hover {
  background: rgba(91, 127, 255, 0.08);
}

.match-history-table tbody tr.match-win {
  border-left: 3px solid #4caf50;
}

.match-history-table tbody tr.match-loss {
  border-left: 3px solid #f44336;
}

.match-history-table td {
  padding: 8px;
  font-size: 0.8rem;
  color: #e4e6eb;
  vertical-align: middle;
}

/* Account column */
.match-history-table .match-account {
  font-size: 0.7rem;
  color: #9ca3af;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Patch column */
.match-history-table .match-patch {
  font-size: 0.7rem;
  color: #5b7fff;
  font-weight: 500;
}

/* Date column */
.match-history-table .match-date {
  font-size: 0.7rem;
  color: #6b7280;
}

/* Duration column */
.match-history-table .match-duration {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Champion cell */
.match-history-table .match-champion {
  display: flex;
  align-items: center;
  gap: 6px;
}

.match-history-table .match-champion-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.match-history-table .match-champion-icon.win {
  border-color: #4caf50;
}

.match-history-table .match-champion-icon.loss {
  border-color: #f44336;
}

/* Keystone rune icon */
.match-history-table .match-keystone-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

/* VS opponent */
.match-history-table .match-vs {
  display: flex;
  align-items: center;
  gap: 5px;
}

.match-history-table .match-vs-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  opacity: 0.8;
}

.match-history-table .match-vs-text {
  font-size: 0.6rem;
  color: #6b7280;
}

/* Items */
.match-history-table .match-items {
  display: flex;
  gap: 2px;
  align-items: center;
}

.match-history-table .match-item-icon {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: rgba(20, 22, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.match-history-table .match-item-boots {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: rgba(20, 22, 28, 0.8);
  border: 1px solid rgba(255, 170, 0, 0.3);
}

/* KDA */
.match-history-table .match-kda {
  text-align: center;
}

.match-history-table .match-kda-numbers {
  font-weight: 600;
  font-size: 0.8rem;
}

.match-history-table .match-kda-ratio {
  font-size: 0.65rem;
  color: #6b7280;
  margin-top: 2px;
}

.match-history-table .kda-perfect {
  color: #5b7fff;
}

.match-history-table .kda-great {
  color: #4caf50;
}

.match-history-table .kda-good {
  color: #ff9800;
}

.match-history-table .kda-bad {
  color: #f44336;
}

/* P% - Kill participation */
.match-history-table .match-kp {
  font-size: 0.75rem;
  font-weight: 500;
}

/* CSPM */
.match-history-table .match-cspm {
  font-size: 0.8rem;
  font-weight: 500;
}

/* GD@15 / CSD@15 */
.match-history-table .match-gd15,
.match-history-table .match-csd15 {
  font-size: 0.75rem;
  font-weight: 600;
}

.match-history-table .match-gd15.positive,
.match-history-table .match-csd15.positive {
  color: #4caf50;
}

.match-history-table .match-gd15.negative,
.match-history-table .match-csd15.negative {
  color: #f44336;
}

.match-history-table .match-gd15.neutral,
.match-history-table .match-csd15.neutral {
  color: #6b7280;
}

/* ==================== PAGINATION ==================== */

.match-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 22, 28, 0.5);
}

.pagination-btn {
  padding: 8px 16px;
  background: rgba(91, 127, 255, 0.15);
  border: 1px solid rgba(91, 127, 255, 0.3);
  border-radius: 4px;
  color: #5b7fff;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(91, 127, 255, 0.25);
  border-color: #5b7fff;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.8rem;
  color: #9ca3af;
  font-weight: 500;
}

/* ==================== MATCH HISTORY TABS ==================== */

.match-history-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  background: rgba(15, 17, 21, 0.8);
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  overflow: hidden;
}

.match-tab {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.match-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
}

.match-tab.active {
  background: rgba(91, 127, 255, 0.15);
  color: #5b7fff;
}

.match-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #5b7fff;
}

.match-history-container[data-tab-content] {
  border-radius: 0 0 8px 8px;
}

/* ==================== PRO MATCHES SPECIFIC ==================== */

/* Team names in pro matches */
.match-history-table .match-teams {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.match-history-table .match-teams .team-name {
  font-weight: 500;
  color: #9ca3af;
}

.match-history-table .match-teams .team-name.winner {
  color: #4caf50;
  font-weight: 600;
}

.match-history-table .match-teams .match-vs-text {
  color: #6b7280;
  font-size: 0.65rem;
}

/* Tournament column */
.match-history-table .match-tournament {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Damage column */
.match-history-table .match-damage {
  color: #f59e0b;
  font-weight: 500;
}

/* Vision column */
.match-history-table .match-vision {
  color: #8b5cf6;
}

/* Pro table specific column widths */
.match-history-table.pro-table th,
.match-history-table.pro-table td {
  padding: 8px 10px;
}

.match-history-table.pro-table .match-teams {
  min-width: 140px;
}

/* ==================== LOADING & EMPTY STATES ==================== */

.pt-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #9ca3af;
}

.pt-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #5b7fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pt-loading-text {
  font-size: 0.8rem;
  color: #6b7280;
}

.pt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.pt-empty-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.3;
}

.pt-empty-text {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.pt-empty-hint {
  font-size: 0.75rem;
  color: #6b7280;
  opacity: 0.6;
}

/* ==================== SELECT PLAYER PROMPT ==================== */

.pt-select-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.pt-select-prompt-icon {
  width: 80px;
  height: 80px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.pt-select-prompt-icon::before {
  content: '?';
  font-size: 2rem;
  color: #6b7280;
}

.pt-select-prompt h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
}

.pt-select-prompt p {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
}

/* ==================== SCROLLBAR ==================== */

.player-tracker-left::-webkit-scrollbar,
.match-history-table-wrapper::-webkit-scrollbar,
.player-champion-stats::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.player-tracker-left::-webkit-scrollbar-track,
.match-history-table-wrapper::-webkit-scrollbar-track,
.player-champion-stats::-webkit-scrollbar-track {
  background: rgba(15, 17, 21, 0.8);
  border-radius: 3px;
}

.player-tracker-left::-webkit-scrollbar-thumb,
.match-history-table-wrapper::-webkit-scrollbar-thumb,
.player-champion-stats::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.player-tracker-left::-webkit-scrollbar-thumb:hover,
.match-history-table-wrapper::-webkit-scrollbar-thumb:hover,
.player-champion-stats::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1200px) {
  .player-tracker-content {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 1000px) {
  .player-tracker-content {
    grid-template-columns: 1fr;
  }

  .player-tracker-left {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .player-profile-card {
    flex: 1;
    min-width: 300px;
  }

  .player-champion-stats {
    flex: 1;
    min-width: 300px;
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .player-tracker-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .pt-filter-group select,
  .pt-filter-group input {
    min-width: 100%;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .player-tracker-left {
    flex-direction: column;
  }
}
