/* Modern CSS Reset and Variables */
:root {
  --primary-color: #00d4ff;
  --secondary-color: #1a1a2e;
  --accent-color: #16213e;
  --background-dark: #0f0f23;
  --background-card: #16213e;
  --text-color: #ffffff;
  --text-secondary: #b0b3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --hover-color: rgba(0, 212, 255, 0.1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #00d4ff 0%, #5b86e5 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  background: var(--background-dark);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animated Particles Background */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
  opacity: 0.6;
}

.particle:nth-child(1) {
  left: 20%;
  animation-delay: 0s;
  animation-duration: 8s;
}
.particle:nth-child(2) {
  left: 40%;
  animation-delay: 2s;
  animation-duration: 10s;
}
.particle:nth-child(3) {
  left: 60%;
  animation-delay: 4s;
  animation-duration: 12s;
}
.particle:nth-child(4) {
  left: 80%;
  animation-delay: 1s;
  animation-duration: 9s;
}
.particle:nth-child(5) {
  left: 10%;
  animation-delay: 3s;
  animation-duration: 11s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(100vh) scale(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    transform: translateY(-10vh) scale(1) rotate(180deg);
    opacity: 0.8;
  }
  90% {
    opacity: 0.6;
  }
}

/* Container Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Header Styles */
.main-header {
  text-align: center;
  padding: 60px 0 40px;
  background: var(--gradient-primary);
  margin-bottom: 40px;
  border-radius: 0 0 30px 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.main-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
}

.logo-section i.pulse {
  font-size: 3.5em;
  color: var(--primary-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.main-header h1 {
  font-size: 4em;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(45deg, #ffffff, var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.subtitle {
  font-size: 1.3em;
  opacity: 0.9;
  margin-bottom: 30px;
  color: var(--text-secondary);
}

.stats-overview {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 15px 25px;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-item i {
  font-size: 1.8em;
  color: var(--primary-color);
}

.stat-item span {
  font-weight: 600;
  font-size: 1.1em;
}

/* Navigation Tabs */
.tab-navigation {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
}

.tab-btn {
  background: var(--background-card);
  border: 2px solid var(--border-color);
  color: var(--text-color);
  padding: 18px 35px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.tab-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-secondary);
  transition: var(--transition);
  z-index: -1;
}

.tab-btn:hover::before,
.tab-btn.active::before {
  left: 0;
}

.tab-btn:hover,
.tab-btn.active {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  color: #ffffff;
}

.tab-btn i {
  font-size: 1.3em;
}

/* Content Sections */
.content-section {
  display: none;
  animation: fadeIn 0.5s ease-in;
}

.content-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.section-header h2 {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0;
}

.view-toggle {
  display: flex;
  gap: 8px;
  background: var(--background-card);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1em;
}

.toggle-btn:hover,
.toggle-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  transform: scale(1.05);
}

/* Filters */
.filters-container {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 30px;
  flex-wrap: wrap;
  background: var(--background-card);
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}

.filter-group label {
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 20px;
  margin-bottom: 4px;
}

.filter-group select {
  background: var(--accent-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  height: 48px;
  min-width: 140px;
}

.filter-group select:hover,
.filter-group select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.search-container {
  flex: 1;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-container label {
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 20px;
  margin-bottom: 4px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper i {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  font-size: 1.1em;
  z-index: 1;
}

.search-input-wrapper input {
  background: var(--accent-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 12px 16px 12px 45px;
  border-radius: var(--border-radius);
  font-size: 1em;
  width: 100%;
  height: 48px;
  transition: var(--transition);
  box-sizing: border-box;
}

.search-input-wrapper input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.search-input-wrapper input::placeholder {
  color: var(--text-secondary);
}

/* Table Styles */
.table-container {
  background: var(--background-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.modern-table thead {
  background: var(--accent-color);
}

.modern-table th {
  padding: 20px 16px;
  font-weight: 700;
  color: var(--primary-color);
  text-align: left;
  font-size: 1em;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 团队表格样式 */
#team-table {
  display: table !important;
  table-layout: fixed !important;
  width: 100% !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#team-table thead {
  display: table-header-group !important;
  background: var(--accent-color);
}

#team-table tbody {
  display: table-row-group !important;
}

#team-table tr {
  display: table-row;
}

#team-table tr[style*="display: none"] {
  display: none !important;
}

#team-table th,
#team-table td {
  display: table-cell !important;
  vertical-align: middle !important;
  padding: 12px 16px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border-bottom: 1px solid var(--border-color);
}

#team-table th {
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9em;
}

#team-table col {
  display: table-column !important;
}

#team-table th:nth-child(1),
#team-table td:nth-child(1) {
  width: 100px !important;
  text-align: center !important;
} /* Rank */
#team-table th:nth-child(2),
#team-table td:nth-child(2) {
  width: 25% !important;
} /* Team */
#team-table th:nth-child(3),
#team-table td:nth-child(3) {
  width: 80px !important;
  text-align: center !important;
} /* Logo */
#team-table th:nth-child(4),
#team-table td:nth-child(4) {
  width: 15% !important;
} /* Region */
#team-table th:nth-child(5),
#team-table td:nth-child(5) {
  width: 20% !important;
} /* Rating */
#team-table th:nth-child(6),
#team-table td:nth-child(6) {
  width: 80px !important;
  text-align: center !important;
} /* Charts */

/* Column widths for player table */
#player-table th:nth-child(1),
#player-table td:nth-child(1) {
  width: 60px;
} /* Rank */
#player-table th:nth-child(2),
#player-table td:nth-child(2) {
  width: 18%;
} /* Player */
#player-table th:nth-child(3),
#player-table td:nth-child(3) {
  width: 60px;
} /* Avatar */
#player-table th:nth-child(4),
#player-table td:nth-child(4) {
  width: 18%;
} /* Team */
#player-table th:nth-child(5),
#player-table td:nth-child(5) {
  width: 12%;
} /* Role */
#player-table th:nth-child(6),
#player-table td:nth-child(6) {
  width: 12%;
} /* Region */
#player-table th:nth-child(7),
#player-table td:nth-child(7) {
  width: 15%;
} /* Rating */
#player-table th:nth-child(8),
#player-table td:nth-child(8) {
  width: 60px;
} /* Charts */

.modern-table th i {
  margin-right: 8px;
  opacity: 0.8;
}

.table-row {
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

/* 临时禁用表格行的伪元素 */
.table-row::before {
  display: none !important;
}

/* 简化的表格行hover效果 */
.table-row:hover {
  background-color: var(--hover-color) !important;
}

.table-row:last-child {
  border-bottom: none;
}

.modern-table td {
  padding: 18px 16px;
  color: var(--text-color);
  font-size: 0.95em;
  position: relative;
  z-index: 1;
  vertical-align: middle;
  word-wrap: break-word;
}

/* Specific Cell Styles */
.rank-cell {
  text-align: center;
  vertical-align: middle;
  padding: 12px 8px;
}

.rank-badge {
  background: var(--gradient-secondary);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9em;
  display: inline-block;
  min-width: 40px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.rank-badge.top-rank {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  animation: glow 2s infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  }
  to {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  }
}

.team-name,
.player-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-cell,
.avatar-cell {
  text-align: center;
  vertical-align: middle;
}

.team-logo,
.player-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.table-row:hover .team-logo,
.table-row:hover .player-avatar {
  transform: scale(1.1);
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.region-badge {
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.region-badge.region-lck {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
}

.region-badge.region-lpl {
  background: linear-gradient(135deg, #4834d4, #686de0);
  color: white;
}

.role-badge {
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge.role-top {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}
.role-badge.role-jungle {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}
.role-badge.role-mid {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
}
.role-badge.role-bottom {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}
.role-badge.role-support {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
}

.rating-cell {
  font-weight: 700;
  font-size: 1.2em;
  text-align: center;
  vertical-align: middle;
}

.rating-value {
  color: var(--primary-color);
  font-weight: 800;
}

.chart-btn {
  background: var(--gradient-secondary);
  border: none;
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1em;
  display: block;
  margin: 0 auto;
}

.chart-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

/* Charts column styling */
#team-table td:nth-child(6),
#player-table td:nth-child(8) {
  text-align: center;
  vertical-align: middle;
}

/* Cards View */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.team-card,
.player-card {
  background: var(--background-card);
  border-radius: var(--border-radius);
  padding: 25px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.team-card::before,
.player-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: var(--transition);
}

.team-card:hover::before,
.player-card:hover::before {
  left: 100%;
}

.team-card:hover,
.player-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.card-rank {
  position: absolute;
  top: 15px;
  right: 15px;
}

.card-logo img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.card-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.card-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 15px;
  border: 4px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
  object-fit: cover;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.card-info h3 {
  font-size: 1.4em;
  margin-bottom: 10px;
  color: var(--text-color);
}

.badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.rating {
  margin-top: 15px;
}

.rating .rating-value {
  font-size: 2em;
  font-weight: 800;
  color: var(--primary-color);
}

.rating small {
  color: var(--text-secondary);
  font-size: 0.8em;
  margin-left: 5px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: var(--background-card);
  margin: 5% auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5em;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--hover-color);
  color: var(--text-color);
  transform: scale(1.1);
}

.modal-body {
  padding: 30px;
}

.chart-container {
  height: 400px;
  position: relative;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.loading-spinner {
  text-align: center;
  color: var(--primary-color);
}

.loading-spinner i {
  font-size: 3em;
  margin-bottom: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-spinner p {
  font-size: 1.2em;
  color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
  }
  .main-header h1 {
    font-size: 3em;
  }
  .section-header h2 {
    font-size: 2em;
  }
}

@media (max-width: 768px) {
  .main-header {
    padding: 40px 0 30px;
  }
  .main-header h1 {
    font-size: 2.5em;
  }
  .subtitle {
    font-size: 1.1em;
  }

  .stats-overview {
    gap: 20px;
  }
  .stat-item {
    padding: 12px 20px;
  }

  .tab-navigation {
    flex-direction: column;
    align-items: center;
  }
  .tab-btn {
    width: 200px;
    justify-content: center;
  }

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

  .filters-container {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .search-container {
    max-width: none;
  }

  .modern-table {
    font-size: 0.85em;
  }
  .modern-table th,
  .modern-table td {
    padding: 12px 8px;
  }

  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
  }
  .modal-header {
    padding: 20px;
  }
  .modal-body {
    padding: 20px;
  }
  .chart-container {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .main-header h1 {
    font-size: 2em;
  }
  .section-header h2 {
    font-size: 1.6em;
  }

  .modern-table th,
  .modern-table td {
    padding: 10px 6px;
    font-size: 0.8em;
  }

  .team-logo,
  .player-avatar {
    width: 35px;
    height: 35px;
  }

  .cards-container {
    grid-template-columns: 1fr;
  }
}
