:root {
  --primary-blue: #0066cc;
  --dark-blue: #003d7a;
  --light-blue: #e6f2ff;
  --gray-text: #666;
  --border-color: #e0e0e0;
  --success-green: #28a745;
  --error-red: #dc3545;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* Header */
.header {
  background: #0b3680;
  color: white;
  padding: 20px 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s;
}

.logo-container:hover {
  opacity: 0.9;
}

.logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo {
  font-size: 36px;
  font-weight: 700;
}

.subtitle {
  font-size: 22px;
  opacity: 0.9;
}

/* Header minimal (bez brandingu) */
.header-minimal {
  text-align: center;
  padding: 20px 0;
}

.subtitle-minimal {
  font-size: 18px;
  color: #666;
  font-weight: 400;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
}

.back-link:hover {
  opacity: 0.7;
}

/* Event info */
.event-info {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.event-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--dark-blue);
  margin-bottom: 10px;
}

.event-meta {
  font-size: 16px;
  color: var(--gray-text);
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 8px;
}

.event-meta .meta-item {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: #666;
}

.event-meta .meta-item::before {
  content: "•";
  margin-right: 8px;
  color: #ddd;
}

.event-meta .meta-item:first-child::before {
  content: none;
}

/* Navigation tabs */
.nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.nav-tab {
  padding: 12px 24px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: all 0.3s;
}

.nav-tab:hover {
  background: #f8f9fa;
}

.nav-tab.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

/* Buttons */
.btn-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Live section */
.live-section {
  background: #f8f9fa;
  border-left: 4px solid var(--primary-blue);
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 30px;
  min-height: 100px;
}

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

.live-badge {
  background: #ff3333;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 12px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.live-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark-blue);
}

.live-race {
  font-size: 16px;
  color: var(--gray-text);
  margin-bottom: 10px;
}

.live-commentary {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 15px;
}

.live-time {
  font-size: 13px;
  color: var(--gray-text);
}

/* Commentary */
.commentary-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.commentary-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-text);
}

.commentary-empty p {
  margin-bottom: 10px;
}

.commentary-empty p:first-child {
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.commentary-text p {
  margin-bottom: 12px;
}

.commentary-part {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #f0f0f0;
}

.commentary-part:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.commentary-time {
  font-size: 13px;
  color: var(--gray-text);
  margin-bottom: 10px;
}

/* Section title */
.section-title {
  font-size: 1.8em;
  color: var(--dark-blue);
  margin-bottom: 30px;
  text-align: center;
}

/* Events grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* Event card */
.event-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border-color: var(--primary-blue);
}

.event-thumbnail {
  width: 100%;
  margin-bottom: 15px;
  border-radius: 6px;
  overflow: hidden;
}

.event-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.event-page-thumbnail {
  width: 100%;
  max-width: 300px;
  margin: 15px 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.event-page-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.event-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.event-date {
  background: var(--light-blue);
  color: var(--dark-blue);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 600;
}

.event-location {
  font-size: 0.85em;
  color: var(--dark-blue);
  display: flex;
  align-items: center;
  font-weight: 500;
}

.event-name {
  font-size: 1.2em;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  min-height: 50px;
}

.event-status {
  display: flex;
  align-items: center;
  font-size: 0.95em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-dot.active {
  background: #28a745;
  animation: pulse-dot 2s infinite;
}

.status-dot.today {
  background: #ffc107;
}

.status-dot.upcoming {
  background: #6c757d;
}

@keyframes pulse-dot {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Admin section */
.admin-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  margin-top: 40px;
}

.admin-btn {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.1em;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.admin-btn:hover {
  background: var(--dark-blue);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-text);
}

.empty-state h2 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

/* Footer */
.footer {
  margin-top: 60px;
  padding: 30px 20px;
  text-align: center;
  color: var(--gray-text);
  font-size: 0.9em;
}

/* Races table */
.races-table {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

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

.races-table th {
  background: #f8f9fa;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-text);
  border-bottom: 1px solid var(--border-color);
}

.races-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.races-table tr:last-child td {
  border-bottom: none;
}

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

/* Race header */
.race-header {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.race-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--dark-blue);
  margin-bottom: 10px;
}

.race-meta {
  font-size: 16px;
  color: var(--gray-text);
}

.commentary-section {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.commentary-text {
  font-size: 16px;
  line-height: 1.6;
}

.commentary-text p {
  margin-bottom: 12px;
}

.commentary-text p:last-child {
  margin-bottom: 0;
}

.results-box {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 4px;
}

.results-box h4 {
  margin-bottom: 10px;
  color: var(--dark-blue);
}

.refresh-info {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: var(--gray-text);
}

/* Form styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1em;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.form-submit {
  width: 100%;
  padding: 12px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 10px;
}

.form-submit:hover {
  background: var(--dark-blue);
}

.fetch-btn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  margin-top: 8px;
  transition: background 0.3s;
}

.fetch-btn:hover {
  background: #45a049;
}

.fetch-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.info-message {
  background: #e3f2fd;
  color: #1976d2;
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 0.9em;
}

.warning-message {
  background: #fff3e0;
  color: #f57c00;
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 0.9em;
}

.error {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.help {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 6px;
  margin-top: 20px;
  font-size: 0.9em;
  color: #666;
}

.help strong {
  color: #333;
}

.links {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.link-btn {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s;
}

.link-home {
  background: #e0e0e0;
  color: #333;
}

.link-home:hover {
  background: #d0d0d0;
}

.link-logout {
  background: #ffebee;
  color: #c62828;
}

.link-logout:hover {
  background: #ffcdd2;
}

/* Mobile */
@media (max-width: 768px) {
  .header-content {
    gap: 10px;
  }
  
  .logo-container {
    gap: 8px;
  }
  
  .logo {
    font-size: 24px;
  }
  
  .logo-image {
    height: 32px;
  }
  
  .nav-tabs {
    flex-wrap: wrap;
  }
  
  .container {
    padding: 15px;
  }
  
  .events-grid {
    grid-template-columns: 1fr;
  }
  
  .races-table {
    overflow-x: auto;
  }
  
  .races-table table {
    min-width: 600px;
  }
}

/* Result styles for heuristic formatting */
.result-spacer {
  height: 8px;
}

.result-record {
  font-size: 0.85em;
  color: #666;
  padding: 3px 0;
  line-height: 1.4;
}

.result-points-system {
  font-size: 0.9em;
  color: #555;
  padding: 5px 0;
  font-weight: 600;
  margin-bottom: 5px;
}

.result-header {
  font-size: 0.9em;
  color: #333;
  padding: 8px 0;
  font-weight: 600;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 8px;
}

.result-competition {
  margin: 20px 0 10px;
}

.result-competition h3 {
  font-size: 1.1em;
  color: #1e5bb8;
  font-weight: 600;
  margin: 0;
  padding: 8px 0;
  border-bottom: 2px solid #1e5bb8;
}

.result-date {
  font-size: 0.85em;
  color: #888;
  padding: 2px 0;
}

.result-text,
.result-text-long {
  font-size: 0.9em;
  color: #555;
  padding: 2px 0;
  line-height: 1.5;
}

.result-text-long {
  font-size: 0.85em;
  word-break: break-word;
}

.result-note {
  font-size: 0.85em;
  color: #666;
  padding: 2px 0 2px 10px;
  font-style: italic;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 40px 0;
  padding: 20px;
}

.pagination-btn {
  background: var(--primary-blue);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

.pagination-btn:hover {
  background: var(--dark-blue);
  transform: translateY(-1px);
}

.pagination-info {
  color: var(--gray-text);
  font-size: 14px;
}

@media (max-width: 768px) {
  .pagination {
    flex-direction: column;
    gap: 10px;
  }
  
  .pagination-btn {
    width: 100%;
    text-align: center;
  }
}

/* Event details page */
.event-info-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 15px;
  font-size: 0.95em;
}

.info-compact-item {
  display: flex;
  align-items: center;
  color: var(--gray-text);
  font-size: 0.95em;
}

.info-compact-item svg {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .event-info-compact {
    flex-direction: column;
    gap: 10px;
  }
}

/* Data sections for medals and scores */
.data-section {
  background: white;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-section-title {
  font-size: 1.4em;
  color: var(--dark-blue);
  margin-bottom: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.data-content {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 20px;
  overflow-x: auto;
}

.pdf-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85em;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  color: #333;
}

@media (max-width: 768px) {
  .data-section {
    padding: 15px;
  }
  
  .data-content {
    padding: 15px;
  }
  
  .pdf-text {
    font-size: 0.75em;
  }
  
  .result-main {
    grid-template-columns: 30px 1fr;
    gap: 8px;
  }
  
  .result-position {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  
  .result-name {
    grid-column: 2;
    grid-row: 1;
  }
  
  .result-year,
  .result-club {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }
  
  .result-time {
    grid-column: 1 / 3;
    grid-row: 3;
    text-align: center;
    font-size: 1.3em;
    padding-top: 10px;
  }
  
  .result-points {
    grid-column: 1 / 3;
    grid-row: 4;
    text-align: center;
  }
  
  .result-splits {
    display: block !important;
  }
}

/* Result formatting */
.pdf-text-small {
  white-space: pre-wrap;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.8em;
  line-height: 1.4;
  background-color: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  max-width: 100%;
}

.result-category {
  margin: 30px 0 15px 0;
  padding: 12px 15px;
  background: linear-gradient(135deg, #0b3680 0%, #1e5bb8 100%);
  border-radius: 8px;
  color: white;
}

.result-category h4 {
  margin: 0;
  margin-left: 10px;
  font-size: 1.1em;
  font-weight: 600;
}

.result-entry {
  margin: 15px 0;
  padding: 15px;
  background: white;
  /* border-radius: 8px; */
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border-left: 1px solid #0b3680;
  transition: all 0.2s;
}

.result-entry:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transform: translateX(2px);
}

.result-entry.disqualified {
  opacity: 0.7;
  border-left-color: #dc3545;
}

.result-entry.disqualified .result-position {
  color: #dc3545;
  font-weight: 700;
}

.result-main {
  display: grid;
  grid-template-columns: 40px 1fr 50px auto 100px 60px;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  /* border-bottom: 1px solid #e0e0e0; */
  margin-bottom: 10px;
}

.result-position {
  font-weight: 700;
  font-size: 1.2em;
  color: #0b3680;
  text-align: center;
}

.result-name {
  font-weight: 600;
  font-size: 1em;
  color: #333;
}

.result-year {
  font-size: 0.9em;
  color: #666;
  text-align: center;
}

.result-club {
  font-size: 0.9em;
  color: #666;
}

.result-time {
  font-weight: 700;
  font-size: 1.1em;
  color: #0b3680;
  text-align: right;
  font-family: 'Monaco', 'Courier New', monospace;
}

.result-points {
  font-weight: 600;
  font-size: 0.95em;
  color: #28a745;
  text-align: right;
}

.result-splits {
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.85em;
  display: none;
}

.result-entry:hover .result-splits {
  display: block;
}

.split-line {
  font-family: 'Monaco', 'Courier New', monospace;
  color: #555;
  line-height: 1.8;
  padding: 2px 0;
}

.result-note {
  font-style: italic;
  color: #666;
  font-size: 0.9em;
  padding: 5px 0;
  border-top: 1px dashed #ddd;
  margin-top: 5px;
}

/* Medal table styles */
.medal-table-container {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.medal-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.85em;
}

.medal-table thead {
  background: white;
  color: #1e5bb8;
  border-bottom: 2px solid #e0e0e0;
}

.medal-table thead tr:first-child th {
  padding: 10px 6px;
  font-weight: 600;
  font-size: 0.9em;
  border-bottom: 1px solid #e0e0e0;
}

.medal-table thead tr.medal-header th {
  padding: 8px 6px;
  font-size: 1.1em;
  border-bottom: 1px solid #e0e0e0;
}

.medal-table th {
  text-align: center;
}

.medal-table th.club-col {
  text-align: left;
  min-width: 180px;
}

.medal-table .gender-header {
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.medal-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s ease;
}

.medal-table tbody tr:hover {
  background-color: #fafafa;
}

.medal-table tbody tr.top-three {
  background: #fffef8;
}

.medal-table tbody tr.top-three:hover {
  background: #fffbf0;
}

.medal-table td {
  padding: 10px 6px;
  text-align: center;
  vertical-align: middle;
  font-size: 0.95em;
}

.medal-table .pos-col {
  font-weight: 700;
  font-size: 1em;
  color: #1e5bb8;
  width: 45px;
}

.medal-table .club-col {
  text-align: left;
  padding-left: 12px;
}

.medal-table .club-name {
  font-weight: 600;
  font-size: 0.95em;
  color: #2c3e50;
  margin-bottom: 2px;
}

.medal-table .club-code {
  font-size: 0.8em;
  color: #7f8c8d;
  font-family: 'Monaco', 'Courier New', monospace;
}

.medal-table .gold-col {
  background-color: #fffef8;
  font-weight: 600;
  color: #c9a236;
}

.medal-table .silver-col {
  background-color: #fafafa;
  font-weight: 600;
  color: #95a5a6;
}

.medal-table .bronze-col {
  background-color: #fffef8;
  font-weight: 600;
  color: #b87333;
}

.medal-table .total-col {
  background-color: #f8f9fa;
  font-weight: 700;
  font-size: 1.05em;
  color: #2c3e50;
  width: 60px;
  border-left: 2px solid #dee2e6;
}

.medal-table .total-medal {
  font-weight: 700;
  font-size: 1em;
  border-left: 1px solid #e8e8e8;
}

.medal-table .total-sum {
  font-size: 1.1em;
  border-left: 2px solid #dee2e6;
}

/* Responsive dla tabeli medalowej */
@media (max-width: 1024px) {
  .medal-table {
    font-size: 0.75em;
  }
  
  .medal-table th,
  .medal-table td {
    padding: 8px 4px;
  }
  
  .medal-table .club-col {
    min-width: 140px;
  }
  
  .medal-table .club-name {
    font-size: 0.9em;
  }
  
  .medal-table .club-code {
    font-size: 0.75em;
  }
}

@media (max-width: 768px) {
  .medal-table-container {
    margin: 10px -20px;
    border-radius: 0;
  }
  
  .medal-table {
    font-size: 0.65em;
  }
  
  .medal-table th,
  .medal-table td {
    padding: 6px 3px;
  }
  
  .medal-table thead tr:first-child th {
    padding: 8px 4px;
    font-size: 0.85em;
  }
  
  .medal-table thead tr.medal-header th {
    padding: 6px 3px;
    font-size: 1em;
  }
  
  .medal-table .pos-col {
    width: 30px;
    font-size: 0.95em;
  }
  
  .medal-table .club-col {
    min-width: 110px;
    padding-left: 6px;
  }
  
  .medal-table .total-col {
    width: 40px;
  }
}

/* Event details page (old styles - keep for compatibility) */
.event-details {
  padding: 20px 0;
}

.detail-section {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.detail-title {
  font-size: 1.3em;
  color: var(--dark-blue);
  margin-bottom: 20px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.detail-item {
  background: white;
  padding: 15px;
  border-radius: 6px;
  border-left: 3px solid var(--primary-blue);
}

.detail-label {
  font-size: 0.85em;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}

.detail-value {
  font-size: 1.1em;
  color: #333;
  font-weight: 500;
}

.live-results-btn {
  display: inline-flex;
  align-items: center;
  background: var(--primary-blue);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  font-size: 1em;
}

.live-results-btn:hover {
  background: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.status-info {
  background: white;
  padding: 15px;
  border-radius: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9em;
}

.status-badge.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-badge.pending {
  background: #fff3e0;
  color: #f57c00;
}

.status-badge.completed {
  background: #e3f2fd;
  color: #1976d2;
}

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  /* Zero padding for data content on mobile */
  .commentary-content,
  .data-content {
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    background-color: white;
  }
  
  /* Mobile styles for results */
  .result-category {
    margin: 10px 0 5px;
    padding: 5px 0;
  }
  
  .result-category h4 {
    font-size: 0.95em;
    padding: 4px 0;
  }
  
  .result-entry {
    margin: 8px 0;
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border-left-width: 2px;
  }
  
  .result-entry:hover {
    transform: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  }
  
  .result-main {
    grid-template-columns: 35px 1fr 40px;
    gap: 6px;
    padding-bottom: 6px;
    margin-bottom: 6px;
  }
  
  .result-position {
    font-size: 1em;
    grid-column: 1;
    grid-row: 1;
  }
  
  .result-name {
    font-size: 0.9em;
    grid-column: 2;
    grid-row: 1;
  }
  
  .result-year {
    font-size: 0.8em;
    grid-column: 3;
    grid-row: 1;
  }
  
  .result-club {
    font-size: 0.8em;
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
    padding-top: 5px;
    color: #888;
  }
  
  .result-time {
    font-size: 0.95em;
    grid-column: 1 / 3;
    grid-row: 3;
    text-align: left;
    padding-top: 5px;
  }
  
  .result-points {
    font-size: 0.85em;
    grid-column: 3;
    grid-row: 3;
    text-align: right;
    padding-top: 5px;
  }
  
  .result-splits {
    display: block;
    margin-top: 8px;
    padding: 8px;
    font-size: 0.75em;
  }
  
  .split-line {
    line-height: 1.6;
    padding: 1px 0;
  }
  
  .result-competition h3 {
    font-size: 0.95em;
    padding: 6px 0;
  }
  
  .result-record,
  .result-points-system,
  .result-header {
    font-size: 0.75em;
    padding: 2px 0;
  }
  
  .result-text,
  .result-text-long {
    font-size: 0.8em;
    padding: 1px 0;
  }
  
  .result-note {
    font-size: 0.75em;
    padding: 3px 0 3px 8px;
  }
  
  .result-date {
    font-size: 0.75em;
  }
}

/* Filters Container */
.filters-container {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.filter-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
}

.filter-checkbox:hover {
  background: #e9ecef;
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,102,204,0.1);
}

.filter-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-custom {
  width: 24px;
  height: 24px;
  border: 2px solid #ccc;
  border-radius: 6px;
  background: white;
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s ease;
  margin-top: 2px;
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: bold;
}

.checkbox-label {
  display: block;
  font-weight: 600;
  color: var(--dark-blue);
  font-size: 16px;
  margin-bottom: 2px;
}

.checkbox-desc {
  display: block;
  font-size: 13px;
  color: var(--gray-text);
  line-height: 1.4;
}

.filter-checkbox:hover .checkbox-custom {
  border-color: var(--primary-blue);
}

@media (max-width: 768px) {
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .filters-container {
    padding: 20px;
  }
  
  .filter-checkbox {
    padding: 12px;
  }
}

