/* ==========================================================================
   Base & Resets
   ========================================================================== */
body {
  margin: 0;
  padding: 24px 16px;
  background-color: #f8fafc;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

div, span, p { margin: 0; padding: 0; }
img { border: none; margin: 0; padding: 0; }

a, a:visited, a:active {
  color: #0f172a;
  text-decoration: none;
}
a:hover {
  color: #0284c7;
}

/* Typography */
h1 { font-size: 24px; line-height: 30px; font-weight: 700; margin: 0 0 12px 0; color: #0f172a; }
h2 { font-size: 20px; line-height: 26px; font-weight: 700; margin: 0 0 16px 0; color: #0f172a; letter-spacing: -0.01em; }
h3 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0; }
h4 { font-size: 14px; line-height: 20px; font-weight: 600; margin: 0; }
h5 { font-size: 12px; line-height: 16px; font-weight: 600; margin: 0; }

/* ==========================================================================
   Table Container & Base Structure
   ========================================================================== */
table.vypis_skladeb,
table.vypis_soutezicich {
  width: auto;
  max-width: 98%;
  margin: 0 auto 30px auto;
  background-color: #ffffff;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

/* Cell Defaults */
table.vypis_skladeb td {
  padding: 8px 10px;
  font-size: 12.5px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  color: #334155;
  transition: background-color 0.15s ease;
}

table.vypis_soutezicich td {
  padding: 6px 8px;
  font-size: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
}

/* Clear outer right border from last column */
table.vypis_skladeb tr td:last-child,
table.vypis_soutezicich tr td:last-child {
  border-right: none;
}

/* Alignments */
table.table_top td { vertical-align: top; }
table.table_left td, td.table_left { text-align: left; }
table.table_center td, td.table_center { text-align: center; }

/* Text emphasis in table */
table.vypis_skladeb td b {
  color: #0f172a;
  font-weight: 700;
}

/* ==========================================================================
   Category Header Rows (.fisaf_color)
   ========================================================================== */
.fisaf_color,
tr.d.fisaf_color {
  background: linear-gradient(90deg, #187a9e 0%, #209ccf 100%) !important;
}

tr.fisaf_color td {
  color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  padding: 10px 14px !important;
  text-align: left !important;
  text-transform: uppercase;
  border-bottom: 2px solid #0e5b77 !important;
  border-right: none !important;
}

/* ==========================================================================
   Subheader Column Rows (pořadí, body, klub, ČB, OST...)
   ========================================================================== */
tr.d:not(.p):not(.fisaf_color) {
  background-color: #f8fafc;
}

tr.d:not(.p):not(.fisaf_color) td {
  font-size: 11px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b !important;
  padding: 7px 8px !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

tr.d:not(.p):not(.fisaf_color) td i {
  font-style: normal;
}

/* ==========================================================================
   Competitor Data Rows (.p.d)
   ========================================================================== */
/* Alternating zebra striping */
tr.p.d:nth-child(even) {
  background-color: #fcfdfe;
}

tr.p.d:nth-child(odd) {
  background-color: #ffffff;
}

/* Interactive row hover */
tr.p.d:hover td {
  background-color: #f1f5f9 !important;
}

/* Participant ranking column */
tr.p.d td.l {
  font-weight: 700;
  color: #475569;
  border-left: none; /* remove legacy black borders */
}

/* ==========================================================================
   Score Columns & Competition Cities (ČB, OST, ...)
   ========================================================================== */
/* Columns with arithmetic (18+10) styled compactly */
tr.p.d td:nth-child(n+6) {
  font-variant-numeric: tabular-nums;
  color: #64748b;
  font-size: 11.5px;
  white-space: nowrap;
}

/* Total Points column emphasis */
tr.p.d td:nth-child(2) b {
  font-size: 13px;
  color: #0284c7;
}

/* ==========================================================================
   Top 3 Podiums Accent (Optional subtle visual hierarchy)
   ========================================================================== */
/* 1st Place */
tr.p.d:has(td.l:is(:empty, [style*="center"])) td.l:is(:contains("1.")) {
  color: #b45309;
}

/* ==========================================================================
   Legacy Class Normalization & Overrides
   ========================================================================== */
/* Soften the old heavy black cell borders into the new color scheme */
table td.l, table tr.l td { border-left: 1px solid #e2e8f0; }
table td.p, table tr.p td { border-right: 1px solid #e2e8f0; }
table td.h, table tr.h td { border-top: 1px solid #e2e8f0; }
table td.d, table tr.d td { border-bottom: 1px solid #e2e8f0; }
table td.a, table tr.a td { border: 1px solid #e2e8f0; }

table.osobniinfo td {
  font-size: 13px;
  padding: 6px 10px;
}

tr.tr_vk_startovka { background-color: #dcfce7; color: #166534; }
.stcolor1 { background-color: #86efac; }
.stcolor2 { background-color: #7dd3fc; }
.stcolor3 { background-color: #fca5a5; }

.skl_check_content {
  color: #ef4444;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
}

/* ==========================================================================
   Print Optimization
   ========================================================================== */
@media print {
  body {
    background-color: #ffffff;
    padding: 0;
  }
  .netisk {
    display: none;
  }
  table.vypis_skladeb,
  table.vypis_soutezicich {
    box-shadow: none;
    border: 1px solid #94a3b8;
    page-break-inside: auto;
  }
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  tr.fisaf_color {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}