/* =========================================================
   Rediseño moderno para listado de clasificaciones deportivas
   Compatible con el HTML ASP.NET actual.
   Sustituye tecninorte.css por este archivo o cárgalo después.
   ========================================================= */

:root {
  --tn-bg: #f4f7fb;
  --tn-surface: #ffffff;
  --tn-surface-soft: #f8fafc;
  --tn-text: #101828;
  --tn-muted: #667085;
  --tn-line: #e5e7eb;
  --tn-primary: #e53935;
  --tn-primary-dark: #b42318;
  --tn-primary-soft: #fff1f0;
  --tn-accent: #0f766e;
  --tn-dark: #111827;
  --tn-shadow: 0 18px 45px rgba(16, 24, 40, 0.10);
  --tn-radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--tn-bg);
}

body {
  margin: 0 !important;
  min-height: 100%;
  color: var(--tn-text);
  background:
    radial-gradient(circle at 12% 8%, rgba(229, 57, 53, 0.13), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(15, 118, 110, 0.10), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, var(--tn-bg) 34%, #eef3f8 100%);
  font-family: 'Quicksand', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 15px;
  line-height: 1.45;
}

form#formGENERAL {
  width: min(1500px, calc(100% - 32px));
  margin: 34px auto 56px;
}

.aspNetHidden {
  display: none;
}

.clasificacion.pageContent,
.clasificacion.tituloProducto {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 38px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: var(--tn-radius);
  box-shadow: var(--tn-shadow);
  backdrop-filter: blur(12px);
}

.clasificacion.pageContent::before {
  content: "Clasificación";
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 12px;
  color: var(--tn-primary-dark);
  background: var(--tn-primary-soft);
  border: 1px solid rgba(229, 57, 53, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clasificacion h2 {
  max-width: 980px;
  margin: 0 0 8px;
  color: var(--tn-dark);
  font-size: clamp(22px, 3.2vw, 36px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.clasificacion h2 span {
  display: block;
}

.clasificacion h3 {
  margin: 8px 0 20px;
  color: var(--tn-muted);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 600;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin: 26px 0 28px;
  padding: 18px;
  background: var(--tn-surface-soft);
  border: 1px solid var(--tn-line);
  border-radius: 18px;
}

fieldset br {
  display: none;
}

#rbl_condicionesBusqueda,
#rbl_condicionesBusqueda tbody,
#rbl_condicionesBusqueda tr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: auto !important;
  border: 0 !important;
  background: transparent !important;
}

#rbl_condicionesBusqueda td,
.Estilo1 td {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#rbl_condicionesBusqueda input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#rbl_condicionesBusqueda label {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 15px;
  color: #344054;
  background: #ffffff;
  border: 1px solid var(--tn-line);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#rbl_condicionesBusqueda input[type="radio"]:checked + label {
  color: #ffffff;
  background: var(--tn-dark);
  border-color: var(--tn-dark);
}

#rbl_condicionesBusqueda label:hover {
  transform: translateY(-1px);
  border-color: rgba(229, 57, 53, 0.35);
}

input[type="submit"],
.button,
.btn,
.btn-primary,
#Btn_Buscar {
  width: auto !important;
  min-width: 170px;
  min-height: 44px;
  padding: 12px 22px !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--tn-primary), var(--tn-primary-dark)) !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: 0 12px 24px rgba(229, 57, 53, 0.25);
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

input[type="submit"]:hover,
#Btn_Buscar:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(229, 57, 53, 0.32);
  filter: saturate(1.05);
}

.clasificacion > div:has(table.tablatiempos) {
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid var(--tn-line);
  border-radius: 20px;
  background: var(--tn-surface);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.07);
}

/* Fallback para navegadores sin :has */
.clasificacion > div {
  overflow-x: auto;
}

table.tablatiempos,
#GRD_ListaParticipantes {
  width: 100% !important;
  min-width: 1180px;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: var(--tn-surface) !important;
  border: 0 !important;
  color: var(--tn-text);
  font-size: 13px !important;
}

table.tablatiempos th,
#GRD_ListaParticipantes th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 15px 12px !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #202938, #111827) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

table.tablatiempos th:first-child,
#GRD_ListaParticipantes th:first-child {
  border-top-left-radius: 18px;
}

table.tablatiempos th:last-child,
#GRD_ListaParticipantes th:last-child {
  border-top-right-radius: 18px;
}

table.tablatiempos td,
#GRD_ListaParticipantes td,
table td {
  padding: 13px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--tn-line) !important;
  color: #344054;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

table.tablatiempos tr:nth-child(even) td {
  background: #fbfdff;
}

table.tablatiempos tr:hover td {
  color: var(--tn-text) !important;
  background: #fff7f6 !important;
}

/* Puesto */
table.tablatiempos tr:not(:first-child) td:first-child {
  color: var(--tn-primary-dark);
  font-size: 15px;
  font-weight: 900;
}

/* Dorsal */
table.tablatiempos tr:not(:first-child) td:nth-child(4) {
  color: #475467;
  font-weight: 800;
}

/* Tiempo principal */
table.tablatiempos tr:not(:first-child) td:nth-child(5),
table.tablatiempos tr:not(:first-child) td:last-child {
  color: var(--tn-accent);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

/* Participante */
table.tablatiempos tr:not(:first-child) td:nth-child(7) {
  min-width: 245px;
  color: var(--tn-text);
  font-weight: 800;
  text-align: left !important;
  white-space: normal;
}

/* Categoría */
table.tablatiempos tr:not(:first-child) td:nth-child(3) {
  font-weight: 900;
}

table.tablatiempos tr:last-child td {
  background: #ffffff !important;
  border-bottom: 0 !important;
}

/* Paginación generada dentro de la tabla */
table.tablatiempos tr:last-child table {
  width: auto !important;
  min-width: 0;
  margin: 8px auto;
  border-collapse: separate !important;
  border-spacing: 8px 0 !important;
}

table.tablatiempos tr:last-child table td {
  padding: 0 !important;
  border: 0 !important;
}

table.tablatiempos tr:last-child span,
table.tablatiempos tr:last-child a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

table.tablatiempos tr:last-child span {
  color: #ffffff;
  background: var(--tn-primary);
}

table.tablatiempos tr:last-child a {
  color: #344054;
  background: #f2f4f7;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

table.tablatiempos tr:last-child a:hover {
  color: #ffffff;
  background: var(--tn-dark);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  form#formGENERAL {
    width: calc(100% - 20px);
    margin: 16px auto 32px;
  }

  .clasificacion.pageContent,
  .clasificacion.tituloProducto {
    padding: 20px 14px;
    border-radius: 18px;
  }

  fieldset {
    display: block;
    padding: 14px;
  }

  #rbl_condicionesBusqueda,
  #rbl_condicionesBusqueda tbody,
  #rbl_condicionesBusqueda tr {
    display: grid;
    grid-template-columns: 1fr;
    width: 100% !important;
  }

  #rbl_condicionesBusqueda td,
  #rbl_condicionesBusqueda label,
  #Btn_Buscar {
    width: 100% !important;
  }

  #Btn_Buscar {
    margin-top: 14px;
  }

  table.tablatiempos,
  #GRD_ListaParticipantes {
    min-width: 1050px;
    font-size: 12px !important;
  }

  table.tablatiempos th,
  table.tablatiempos td {
    padding: 11px 9px !important;
  }
}

@media print {
  body {
    background: #ffffff !important;
  }

  form#formGENERAL {
    width: 100%;
    margin: 0;
  }

  .clasificacion.pageContent,
  .clasificacion.tituloProducto {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  fieldset,
  #Btn_Buscar {
    display: none !important;
  }

  table.tablatiempos,
  #GRD_ListaParticipantes {
    min-width: 0;
    font-size: 8px !important;
  }
}
