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

body {
  font-family: "Microsoft JhengHei", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
}

.header p {
  opacity: 0.9;
  font-size: 1.1rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.controls {
  background: white;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.search-box:focus {
  outline: none;
  border-color: #667eea;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin: 1rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 5px;
  flex: 1;
  min-width: 150px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #667eea;
}

.table-container {
  background: white;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  position: relative;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.table-container:active {
  cursor: grabbing;
}

/* Custom scrollbar for desktop */
.table-container::-webkit-scrollbar {
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #5a6fd8;
}

.table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.table th,
.table td {
  padding: 1rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  white-space: nowrap;
}

.table th {
  background-color: #667eea;
  color: white;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.table td {
  line-height: 1.4;
}

.table th:hover {
  background-color: #5a6fd8;
}

.table tr:hover {
  background-color: #f8f9fa;
}

.team-number {
  font-weight: bold;
  color: #667eea;
}

.inactive {
  opacity: 0.6;
  background-color: #fff3cd;
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

.status-active {
  background-color: #28a745;
}

.status-inactive {
  background-color: #dc3545;
}

.status-unknown {
  background-color: #ffc107;
}

.footer {
  text-align: center;
  padding: 2rem 0;
  color: #666;
  border-top: 1px solid #eee;
  background: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 0.6rem 0.4rem;
  }

  .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .stat-item {
    min-width: auto;
    padding: 0.8rem;
  }

  .stat-number {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5rem;
  }

  .table {
    font-size: 0.75rem;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.3rem;
  }

  .container {
    padding: 0 0.5rem;
  }

  .controls {
    padding: 1rem;
    margin: 1rem 0;
  }

  .search-box {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 0.8rem 0;
  }

  .stat-item {
    padding: 0.6rem;
  }

  .stat-number {
    font-size: 1.1rem;
  }
}

/* Unified column width settings */
.table th:nth-child(1),
.table td:nth-child(1) {
  width: 100px;
  min-width: 100px;
}

.table th:nth-child(2),
.table td:nth-child(2) {
  width: 80px;
  min-width: 80px;
  text-align: center;
}

.table th:nth-child(3),
.table td:nth-child(3) {
  width: 180px;
  min-width: 180px;
}

.table th:nth-child(4),
.table td:nth-child(4) {
  width: 200px;
  min-width: 200px;
}

.table th:nth-child(5),
.table td:nth-child(5) {
  width: 120px;
  min-width: 120px;
}

.table th:nth-child(6),
.table td:nth-child(6) {
  width: 150px;
  min-width: 150px;
}

.table th:nth-child(7),
.table td:nth-child(7) {
  width: 80px;
  min-width: 80px;
  text-align: center;
}

.table th:nth-child(8),
.table td:nth-child(8) {
  width: 150px;
  min-width: 150px;
}

.sort-indicator {
  margin-left: 5px;
  opacity: 0.6;
}

.hidden {
  display: none;
}
