/* Event Header */
.event-header {
  position: relative;
  background: linear-gradient(135deg, #a2191e 0%, #8f1418 50%, #710f13 100%);
  color: white;
  padding: 2rem 0;
  overflow: hidden;
}

.event-header-bg {
  position: absolute;
  inset: 0;
  background-image: url("/placeholder.svg?height=400&width=1200");
  background-size: cover;
  background-position: center;
  opacity: 0.2;
}

.event-header-content {
  position: relative;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.event-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.event-badge.completed {
  background-color: rgba(107, 114, 128, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.event-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.event-subtitle {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  padding: 1rem;
}

.event-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-info-item i {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.event-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.stat i {
  width: 1.25rem;
  height: 1.25rem;
}

/* Search Section */
.search-section {
  padding: 1rem 0;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
}

.search-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 1280px;
  margin: 0 auto;
}

.search-group {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s;
  width: 100%;
}

.search-input:hover {
  border-color: var(--primary-color);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(162, 25, 30, 0.1);
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: 48px;
}

.search-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(162, 25, 30, 0.2);
}

.search-btn:active {
  transform: translateY(0);
}

.search-btn-text {
  display: none;
}

.filter-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select optgroup {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--primary-color);
  padding: 0.5rem 0;
}

.filter-select option {
  padding: 0.5rem 0;
  font-weight: 400;
  color: var(--text-dark);
}

.filter-select:hover {
  border-color: var(--primary-color);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(162, 25, 30, 0.1);
}

/* Results Section */
.results-section {
  padding: 2rem 0 5rem;
  background-color: var(--background-gray);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-title {
  font-size: 2rem;
  font-weight: bold;
}

.results-actions {
  display: flex;
  gap: 0.5rem;
}

.results-summary {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.summary-card h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.summary-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Results Table */
.results-table-container {
  background-color: white;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 2rem;
}

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

.results-table th,
.results-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.results-table th {
  background-color: var(--background-gray);
  font-weight: 600;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.results-table th.sortable:hover {
  background-color: #e5e7eb;
}

.results-table th.sortable i {
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  opacity: 0.5;
}

.results-table tbody tr:hover {
  background-color: var(--background-gray);
}

.results-table .position-cell {
  font-weight: bold;
  color: var(--primary-color);
}

.results-table .number-cell {
  font-family: monospace;
  font-weight: 600;
}

.results-table .time-cell {
  font-family: monospace;
  font-weight: 600;
  color: var(--text-primary);
}

.results-table .pace-cell {
  font-family: monospace;
  color: var(--text-secondary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--background-gray);
}

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

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#resultsPerPageSelect {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
}

#resultsPerPageSelect:hover {
  border-color: var(--primary-color);
}

#resultsPerPageSelect:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(110, 15, 18, 0.1);
}

/* Event Info Section */
.event-info-section {
  padding: 5rem 0;
  background-color: white;
}

.event-info-grid {
  display: grid;
  gap: 2rem;
}

.info-card {
  background-color: var(--background-gray);
  padding: 2rem;
  border-radius: 0.75rem;
}

.info-card h3 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.info-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card ul li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.info-card ul li::before {
  content: "✓";
  color: #10b981;
  font-weight: bold;
}

.records {
  display: grid;
  gap: 1rem;
}

.winners-container {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.loading-winners {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
  background-color: #f8f9fa;
  border-radius: 0.75rem;
  border: 2px dashed #e5e7eb;
}

.loading-winners p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.category-winners {
  background-color: #f8f9fa;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--primary-color);
  border-top: 4px solid var(--primary-color);
}

.category-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.winners-list {
  display: grid;
  gap: 0.75rem;
}

.winner-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.winner-position {
  font-weight: bold;
  color: var(--primary-color);
  min-width: 2rem;
}

.winner-name {
  flex: 1;
  margin-left: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.winner-time {
  font-family: monospace;
  font-weight: bold;
  color: var(--text-secondary);
}

.record-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.record-category {
  font-weight: 500;
  color: var(--text-primary);
}

.record-time {
  font-family: monospace;
  font-weight: bold;
  font-size: 1.125rem;
  color: var(--primary-color);
}

.record-holder {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Responsive Design */
@media (min-width: 640px) {
  .search-section {
    padding: 1.5rem 0;
  }

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

  .results-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .search-section {
    padding: 2rem 0;
  }

  .search-btn {
    padding: 0.75rem 1.5rem;
  }

  .search-btn-text {
    display: inline;
  }

  .event-title {
    font-size: 3rem;
  }

  .event-stats {
    gap: 3rem;
  }

  .results-table-container {
    overflow-x: auto;
  }
}

@media (min-width: 1024px) {
  .search-controls {
    gap: 1rem;
    flex-direction: column-reverse;
  }

  .filter-controls {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }

  .event-header {
    padding: 3rem 0;
  }

  .event-title {
    font-size: 3.5rem;
  }
}

/* Mobile Table Responsiveness */
@media (max-width: 767px) {
  .search-section {
    padding: 1rem 0;
  }
  
  .search-controls {
    gap: 0.75rem;
    flex-direction: column-reverse;
  }

  .search-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .search-btn {
    width: 100%;
    padding: 0.75rem;
  }

  .search-btn-text {
    display: inline;
  }

  .filter-controls {
    gap: 0.75rem;
  }

  .results-table-container {
    overflow-x: auto;
  }

  .results-table {
    min-width: 800px;
  }

  .results-table th,
  .results-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: white;
}

.breadcrumb i {
  width: 1rem;
  height: 1rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive adjustments for event subtitle */
@media (max-width: 768px) {
  .event-subtitle {
    gap: 1.5rem;
    font-size: 1rem;
  }
  
  .event-info-item {
    gap: 0.375rem;
  }
  
  .event-info-item i {
    width: 1rem;
    height: 1rem;
  }

  .pagination {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination-info {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .pagination-info > div {
    margin-left: 0 !important;
  }
  
  .winners-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .event-subtitle {
    flex-direction: column;
    gap: 1rem;
  }
}

.generate-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.775rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.generate-card-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.generate-card-btn i {
  width: 1rem;
  height: 1rem;
}
