* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* Header */
header {
  background-color: #0066cc;
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
  height: 40px;
}

.logo>img {
  height: 100%;
}

/* Header Back Button */
.header-back-button {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  color: #0066cc;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-back-button:hover {
  background-color: #f0f7ff;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-back-button.hidden {
  display: none;
}

nav {
  display: flex;
  gap: 30px;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.3s;
}

nav a.active {
  border-bottom: 3px solid white;
  padding-top: 5px;
  padding-bottom: 5px;
}

nav a:hover {
  opacity: 0.8;
}

/* Search Box in Navigation */
.event-search {
  position: relative;
}

/* Navigation spinner (small overlay shown during navigation) */
.nav-spinner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  z-index: 2000;
}

.nav-spinner-inner {
  background: white;
  padding: 18px 26px;
  border-radius: 8px;
  font-weight: 600;
  color: #333;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.hidden { display: none; }

.event-search input {
  padding: 8px 35px 8px 12px;
  border: none;
  border-radius: 4px;
  width: 250px;
  font-size: 14px;
}

.event-search::after {
  content: "🔍";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 100px auto 30px;
  padding: 0 20px;
}

/* Page Title */
.page-title {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  padding: 40px 50px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 8px 24px #0066cc40;
  position: relative;
  overflow: hidden;
}

.page-title h1 {
  color: white;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.5px;
}

.page-title p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

/* Filter Section */
.filter-section {
  background: white;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-section h2 {
  color: #0066cc;
  font-size: 20px;
  margin-bottom: 20px;
}

.filter-container {
  display: flex;
  justify-content: stretch;
  gap: 20px;
}

.filter-item:first-of-type,
.filter-item:nth-of-type(2),
.filter-item:nth-of-type(3) {
  flex: 1;
}


.filter-item label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}



.filter-item select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
}

.filter-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.clear-filters-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.clear-filters-btn:hover {
  background-color: #5a6268;
}

/* Statistics Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #0066cc;
}

.stat-card h3 {
  color: #666;
  font-size: 14px;
  font-weight: normal;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: bold;
  color: #0066cc;
  margin-bottom: 5px;
}

.stat-card .stat-detail {
  font-size: 13px;
  color: #999;
}

/* Event Section */
.event-section {
  display: none;
}

/* Event Header Card */
.event-header-card {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 25px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.event-header-items {
  flex: 1;
}

.event-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 12px;
  color: white;
}

.event-meta {
  display: flex;
  gap: 30px;
  align-items: center;
  font-size: 15px;
}

.event-dates {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.95;
}

.event-tier-badge .tier-badge {
  font-size: 13px;
  padding: 6px 12px;
}

.event-header-right {
  display: flex;
  align-items: center;
}

.event-website-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  color: #0066cc;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.event-website-btn:hover {
  background: #f0f7ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Event Details */
.event-details {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.event-detail-card {
  flex: 1;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #0066cc;
}

.event-detail-card:hover {
  border-color: #0066cc;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
  transform: translateY(-2px);
}

.detail-content {
  display: flex;
}

.detail-label {
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.detail-value {
  flex: 1;
  justify-self: center;
  font-size: 22px;
  color: #333;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 18px;
  margin-top: 5px;
}

.status-completed {
  background: #28a745;
  color: white;
}

.status-upcoming {
  background: #ffc107;
  color: #333;
}

.status-ongoing {
  background: #17a2b8;
  color: white;
}

/* Chart Section */
.chart-section {
  background: #fafafa;
  padding: 25px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  margin-bottom: 30px;
}

.chart-section h2 {
  color: #0066cc;
  font-size: 20px;
  margin-bottom: 20px;
}

.viz-options {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.viz-button {
  padding: 10px 20px;
  background-color: #f0f0f0;
  border: 2px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.viz-button.active {
  background-color: #0066cc;
  color: white;
  border-color: #0066cc;
}

.viz-button:hover {
  border-color: #0066cc;
}

/* Chart Placeholder */
.chart-container {
  background: #f9f9f9;
  border: 2px dashed #ddd;
  border-radius: 8px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 18px;
}

.divisons-section-title {
  text-align: center;
  color: #0066cc;
  background-color: white;
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #0066cc;
}

.division-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.division-card {
  flex: 1;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.division-card h2 {
  color: #0066cc;
  font-size: 20px;
  margin-bottom: 10px;
  text-align: center;
}

.division-card h4 {
  color: #0066cc;
  margin-bottom: 10px;
  text-align: center;
}

.division-section th,
.division-section td {
  padding: 8px;
}

.divisions-table-wrapper {
  max-height: 30vh;
  overflow-x: hidden;
  overflow-y: auto;
  margin-bottom: 20px;
}

.divisions-table-wrapper::-webkit-scrollbar {
  width: 12px;
}

.divisions-table-wrapper::-webkit-scrollbar-button {
  display: none;
  /* removes the up/down arrows */
}

.divisions-table-wrapper::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.divisions-table-wrapper thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.division-btn-container {
  display: flex;
  justify-content: center;
}

.division-section button {
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  color: #0066cc;
  border: 0;
  background-color: transparent;
  border-radius: 4px;
}

.division-section button:hover {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

/* Events Table */
.table-title {
  background-color: #0066cc;
}

.table-title h4 {
  padding: 10px;
  text-align: center;
  background-color: #ffd700;
  color: #333;
}

.table-title:nth-of-type(2) h4 {
  background-color: #0891b2;
  color: white;
}

.table-title:nth-of-type(3) h4 {
  background-color: #28a745;
  color: white;
}

.events-table {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.events-table h2 {
  color: #0066cc;
  font-size: 20px;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead {
  background-color: #0066cc;
  color: white;
}

th {
  padding: 12px;
  text-align: left;
  font-weight: bold;
  font-size: 14px;
}

td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

td:hover {
  overflow: visible;
  white-space: normal;
}

.events-table th:first-child,
.events-table td:first-child {
  width: 400px;
  /* Set your desired width */
}

tbody tr {
  height: 47px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

tbody tr:hover {
  background-color: #f0f7ff;
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

tr.empty-row:hover {
  background-color: transparent;
}

tr.empty-row td {
  border-bottom: 1px solid #eee;
}

tbody tr.empty-row {
  cursor: default;
}

tbody tr.empty-row:hover {
  background-color: transparent;
  transform: none;
  box-shadow: none;
  border-left-color: transparent;
}

tbody tr.empty-row:hover td {
  padding: 12px;
  font-size: 14px;
  border-color: #eee;
}

tbody tr.empty-row:hover::before {
  display: none;
}

.tier-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}

.tier-m {
  background-color: #ffd700;
  color: #333;
}

/* Elite Series - Blue */
.tier-es {
  background-color: #0891b2;
  color: white;
}

/* A-Tier - Green */
.tier-a {
  background-color: #28a745;
  color: white;
}

/* B-Tier - Silver/Gray */
.tier-b {
  background-color: #6c757d;
  color: white;
}

/* C-Tier - Bronze */
.tier-c {
  background-color: #cd7f32;
  color: white;
}

/* XA-Tier - Light Green */
.tier-xa {
  background-color: #5cb85c;
  color: white;
}

/* XB-Tier - Light Gray */
.tier-xb {
  background-color: #95a5a6;
  color: white;
}

/* XC-Tier - Light Brown */
.tier-xc {
  background-color: #c67f50;
  color: white;
}

/* XM-Tier - Light Gold */
.tier-xm {
  background-color: #f0c419;
  color: #333;
}

/* Past Events Table */
.past-events-table {
  display: none;
}

.past-events-table th,
.past-events-table td {
  text-align: center;
}

.past-events-table th:first-child,
.past-events-table td:first-child {
  width: 80px;
  text-align: left;
}

.past-events-table th:nth-child(2),
.past-events-table td:nth-child(2) {
  width: 500px;
  text-align: left;
}

.past-events-table th:nth-child(3),
.past-events-table td:nth-child(3) {
  width: 120px;
}

.past-events-table th:last-child,
.past-events-table td:last-child {
  width: 180px;
}

.btn-container {
  display: none;
  justify-content: center;
  margin-top: 20px;
}

.btn-container button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.btn-container button:hover {
  border: 1px solid #ddd;
  background: white;
  color: black;
}

/* Pagination Styles */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 8px;
}

.pagination-info {
  font-size: 14px;
  color: #666;
}

.pagination-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pagination-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.page-size-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-size-selector select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.hidden {
  display: none;
}

.division-card tr {
  height: 33px;
}

.division-card table:nth-of-type(2) {
  margin-bottom: 10px;
}

.division-card {
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.division-card .filter-item {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  justify-content: center;
}

.division-card .filter-item label {
  margin-bottom: 0px;
  align-self: center;
  font-size: 16px;
}

.division-card .filter-item select {
  width: 200px;
}

.division-card th:last-of-type,
.division-card td:last-of-type {
  text-align: center;
}

.division-section th:first-of-type,
.division-section td:first-of-type {
  width: 50px;
}

.division-section th:nth-of-type(2),
.division-section td:nth-of-type(2) {
  text-align: center;
  width: 250px;
}

.division-section th:nth-of-type(3),
.division-section td:nth-of-type(3) {
  text-align: center;
}


.divisions-table-wrapper table {
  margin-bottom: 0;
}

.divisions-table-wrapper tbody tr:hover {
  background-color: white;
  transform: scale(1.00);
  cursor: initial;
}

/* Sortable Table Headers */
thead th[data-sort] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 25px;
}

thead th[data-sort]:hover {
  background-color: #0052a3;
}

.sort-indicator {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.5;
}

.sort-indicator::before {
  content: "▼▲";
  letter-spacing: -2px;
}

th[data-sort].sort-asc .sort-indicator::before {
  content: "▲";
  opacity: 1;
  font-size: 12px;
}

th[data-sort].sort-desc .sort-indicator::before {
  content: "▼";
  opacity: 1;
  font-size: 12px;
}

.search-results-header {
  margin-top: 50px;
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-suggestions.active {
  display: block;
}

.suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
  background-color: #f0f7ff;
}

.suggestion-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 3px;
}

.suggestion-meta {
  font-size: 12px;
  color: #666;
}

.suggestion-match {
  background-color: #fff3cd;
  font-weight: 600;
}

.no-suggestions {
  padding: 10px 12px;
  color: #999;
  font-style: italic;
}

/* Make sure search container is positioned relatively */
.event-search {
  position: relative;
}