/* ============================================================================
   RESULTADOS.CSS — Modulo de Resultados TIM3
   Plataforma: test.tim3.com.mx 
   Dark Premium Sports — Gradientes neon, tipografia deportiva, animaciones.
   ============================================================================ */
/* --- GOOGLE FONTS --------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&family=Barlow:wght@400;500;600;700&display=swap');

/* --- DESIGN TOKENS -------------------------------------------------------- */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #252525;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-overlay: rgba(0, 0, 0, 0.80);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.10);
  --border-active: rgba(0, 212, 255, 0.30);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.70);
  --text-muted: rgba(255, 255, 255, 0.40);
  --text-dimmed: rgba(255, 255, 255, 0.25);

  --accent-purple: #7B2FF7;
  --accent-purple-soft: rgba(123, 47, 247, 0.15);
  --accent-purple-glow: rgba(123, 47, 247, 0.40);
  --accent-cyan: #00D4FF;
  --accent-cyan-soft: rgba(0, 212, 255, 0.15);
  --accent-pink: #FF3CAC;
  --accent-green: #00F5A0;
  --accent-gold: #FFD700;
  --accent-orange: #FF6B35;

  --gradient-hero: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  --gradient-primary: linear-gradient(135deg, #a020f0, #ff3cac, #ff6b35);
  --gradient-success: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
  /* 1er Lugar - Oro */
  --gradient-1st: linear-gradient(160deg, #f7d774 0%, #e6b800 100%);

  /* 2do Lugar - Plata */
  --gradient-2nd: linear-gradient(160deg, #e9ecef 0%, #adb5bd 100%);

  /* 3er Lugar - Bronce */
  --gradient-3rd: linear-gradient(160deg, #d4a373 0%, #9c6644 100%);

  --font-display: 'Oswald', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Barlow', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Tailwind compatibility aliases */
  --color-bg: var(--bg-primary);
  --color-surface: var(--bg-card);
  --color-border: var(--border-subtle);
  --color-primary: var(--accent-purple);
  --color-accent: var(--accent-cyan);
  --color-text: var(--text-primary);
  --color-text-muted: var(--text-muted);
}

/* --- LIGHT MODE (prefers-color-scheme + toggle manual) -------------------- */
@media (prefers-color-scheme: light) {
  html:not(.dark-mode) {
    --bg-primary: #fafafa;
    --bg-secondary: #f0f0f5;
    --bg-tertiary: #e8e8ed;
    --bg-card: rgba(0, 0, 0, 0.03);
    --bg-card-hover: rgba(0, 0, 0, 0.06);
    --bg-overlay: rgba(255, 255, 255, 0.98);

    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.12);
    --border-active: rgba(123, 47, 247, 0.4);

    --text-primary: #1a1a1a;
    --text-secondary: rgba(0, 0, 0, 0.73);
    --text-muted: rgba(0, 0, 0, 0.54);
    --text-dimmed: rgba(0, 0, 0, 0.40);

    --gradient-hero: linear-gradient(135deg, #f5f5fa, #fafafa, #f0f0f5);

    /* Colores de acento suavizados para light mode */
    --accent-green: #00a870;
    --accent-cyan: #0088bb;
    --accent-pink: #d61e7a;
    --accent-orange: #d64b20;
  }
}

html:not(.dark-mode) {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f5;
  --bg-tertiary: #e8e8ed;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --bg-overlay: rgba(255, 255, 255, 0.98);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-active: rgba(123, 47, 247, 0.4);

  --text-primary: #1a1a1a;
  --text-secondary: rgba(0, 0, 0, 0.73);
  --text-muted: rgba(0, 0, 0, 0.54);
  --text-dimmed: rgba(0, 0, 0, 0.40);

  --gradient-hero: linear-gradient(135deg, #f5f5fa, #fafafa, #f0f0f5);

  --accent-green: #00a870;
  --accent-cyan: #0088bb;
  --accent-pink: #d61e7a;
  --accent-orange: #d64b20;
}

/* --- KEYFRAMES ------------------------------------------------------------ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* --- GLOBAL WRAPPER ------------------------------------------------------- */
.resultados-module {
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

.color-green {
  color: var(--accent-green);
}

/* --- HERO ----------------------------------------------------------------- */
.resultados-hero {
  position: relative;
  background: var(--gradient-hero);
  padding: 80px 24px 80px;
  text-align: center;
  overflow: hidden;
  animation: fadeIn 0.8s ease-out;
  min-height: 480px;
  display: flex;
  align-items: center;
}

.resultados-hero--custom-banner {
  background-size: cover;
  background-position: center top;
}

.resultados-hero--custom-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.35) 0%, rgba(10, 10, 10, 0.75) 60%, var(--bg-primary) 100%);
  z-index: 0;
}

.resultados-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.resultados-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
  border: 1px solid rgba(0, 212, 255, 0.20);
  border-radius: var(--radius-full);
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.resultados-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite, fadeInUp 0.6s ease-out 0.3s both;
}

.resultados-hero__meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* --- TABS ----------------------------------------------------------------- */
.resultados-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 24px;
  max-width: 1200px;
  margin: 24px auto 0;
  justify-content: center;
}

.resultados-tabs__btn {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 30px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.resultados-tabs__btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-card);
}

.resultados-tabs__btn--active {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 20px var(--color-primary);
  opacity: 0.9;
}

.resultados-tabs__btn--active:hover {
  border-color: transparent;
  background: var(--color-primary);
  opacity: 0.95;
  box-shadow: 0 6px 24px var(--color-primary);
}

/* --- FILTERS -------------------------------------------------------------- */
.resultados-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 24px;
  max-width: 1200px;
  margin: 20px auto 0;
}

.resultados-filters__search {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease;
}

.resultados-filters__search::placeholder {
  color: var(--text-dimmed);
}

.resultados-filters__search:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-soft);
}

.resultados-filters__group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.resultados-filters__btn {
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.resultados-filters__btn:hover,
.resultados-filters__btn--active {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

/* --- PODIUM --------------------------------------------------------------- */
.resultados-podium {
  position: relative;
  padding: 48px 24px 0;
  max-width: 700px;
  margin: 32px auto 0;
  text-align: center;
  background: radial-gradient(ellipse at 50% 80%, var(--accent-purple-soft) 0%, transparent 60%);
}

.resultados-podium__label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent-gold);
  margin-bottom: 32px;
  animation: fadeIn 0.6s ease-out;
}

.resultados-podium__row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
}

.resultados-podium__place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 180px;
  animation: slideUp 0.6s ease-out both;
}

.resultados-podium__place--1 {
  order: 1;
  animation-delay: 0.3s;
}

.resultados-podium__place--2 {
  order: 0;
  animation-delay: 0.1s;
}

.resultados-podium__place--3 {
  order: 2;
  animation-delay: 0.5s;
}

.resultados-podium__medal {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  animation: pulse 2s ease infinite;
}

.resultados-podium__place--1 .resultados-podium__medal {
  background: linear-gradient(135deg, #f7d774, #e6b800);
  box-shadow: 0 0 20px rgba(230, 184, 0, 0.55), 0 0 40px rgba(247, 215, 116, 0.20);
}

.resultados-podium__place--2 .resultados-podium__medal {
  background: linear-gradient(135deg, #e9ecef, #adb5bd);
  box-shadow: 0 0 18px rgba(173, 181, 189, 0.50), 0 0 35px rgba(233, 236, 239, 0.18);
}

.resultados-podium__place--3 .resultados-podium__medal {
  background: linear-gradient(135deg, #d4a373, #9c6644);
  box-shadow: 0 0 18px rgba(212, 163, 115, 0.50), 0 0 35px rgba(156, 102, 68, 0.20);
}

.resultados-podium__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1.2;
}

.resultados-podium__time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-green);
}

.resultados-podium__pedestal {
  width: 100%;
  border-radius: 12px 12px 0 0;
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
  line-height: 1;
}

.resultados-podium__place--1 .resultados-podium__pedestal {
  height: 200px;
  background: var(--gradient-1st);
  border-radius: 12px 12px 0 0;
  box-shadow: inset 0 2px 6px rgba(255, 235, 100, 0.30), 0 -4px 25px rgba(230, 184, 0, 0.30), 0 0 50px rgba(245, 225, 9, 0.15);
}

.resultados-podium__place--2 .resultados-podium__pedestal {
  height: 160px;
  background: var(--gradient-2nd);
  border-radius: 12px 12px 0 0;
  box-shadow: inset 0 2px 6px rgba(200, 200, 200, 0.25), 0 -4px 25px rgba(185, 185, 185, 0.25), 0 0 50px rgba(189, 189, 189, 0.12);
}

.resultados-podium__place--3 .resultados-podium__pedestal {
  height: 140px;
  background: var(--gradient-3rd);
  border-radius: 12px 12px 0 0;
  box-shadow: inset 0 2px 6px rgba(205, 127, 50, 0.35), 0 -4px 25px rgba(205, 127, 50, 0.25), 0 0 50px rgba(205, 127, 50, 0.12);
}

/* --- TOP 10 --------------------------------------------------------------- */
.resultados-top10__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-primary);
  padding: 0 24px;
  max-width: 1200px;
  margin: 40px auto 16px;
}

.resultados-top10__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.resultados-top10__card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
  animation: fadeInRight 0.4s ease-out both;
}

.resultados-top10__card:hover {
  transform: translateX(8px);
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

.resultados-top10__pos {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.resultados-top10__info {
  flex: 1;
  min-width: 0;
}

.resultados-top10__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resultados-top10__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.resultados-top10__times {
  text-align: right;
  flex-shrink: 0;
}

.resultados-top10__chip {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-green);
}

.resultados-top10__gun {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- BUTTON FULL WIDTH ---------------------------------------------------- */
.resultados-btn-full {
  display: block;
  width: 100%;
  max-width: 1200px;
  margin: 24px auto;
  padding: 16px 24px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  background: var(--gradient-primary);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.resultados-btn-full:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* --- TABLE ---------------------------------------------------------------- */
.resultados-table-wrapper {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
  overflow-x: auto;
  position: relative;
}

/* Indicador visual de scroll horizontal (sombra interna derecha) */
.resultados-table-wrapper {
  box-shadow: inset -48px 0 24px -24px rgba(10, 10, 10, 0.9);
  transition: box-shadow 0.3s ease;
}

html:not(.dark-mode) .resultados-table-wrapper {
  box-shadow: inset -48px 0 24px -24px rgba(0, 0, 0, 0.08);
}

.resultados-table-wrapper.scroll-end {
  box-shadow: none;
}

.resultados-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 14px;
}

.resultados-table th {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 8px;
  text-align: left;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-medium);
  white-space: nowrap;
}

.resultados-table th:first-child {
  padding-left: 16px;
}

.resultados-table th:last-child {
  padding-right: 16px;
}

.resultados-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.resultados-table td:first-child {
  padding-left: 16px;
}

.resultados-table td:last-child {
  padding-right: 16px;
}

.resultados-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* --- MODAL ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.modal-dialog.active {
  animation: modalIn 0.3s ease-out;
}

/* Evitar transiciones cuando display cambia */
.modal-overlay {
  transition: none;
}

.modal-overlay[style*="display: none"] {
  transition: none;
}

/* --- CUSTOM SCROLLBAR ----------------------------------------------------- */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

/* --- RESPONSIVE ----------------------------------------------------------- */
@media (max-width: 768px) {
  .resultados-hero {
    padding: 40px 16px 24px;
  }

  .resultados-hero__title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
  }

  .resultados-tabs {
    padding: 0 16px;
  }

  .resultados-filters {
    padding: 0 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .resultados-filters__search {
    flex: 1;
    width: 100%;
  }

  .resultados-filters__group {
    width: 100%;
  }

  .resultados-table-wrapper {
    padding: 0 16px;
  }

  .resultados-table {
    font-size: 12px;
  }

  .resultados-table th,
  .resultados-table td {
    padding: 8px 6px;
  }

  .resultados-table th:first-child,
  .resultados-table td:first-child {
    padding-left: 8px;
  }

  .resultados-table th:last-child,
  .resultados-table td:last-child {
    padding-right: 8px;
  }

  .resultados-podium__row {
    gap: 8px;
  }

  .resultados-podium__name {
    font-size: 12px;
  }

  .resultados-podium__time {
    font-size: 12px;
  }

  .resultados-podium__place--1 .resultados-podium__pedestal {
    height: 140px;
  }

  .resultados-podium__place--2 .resultados-podium__pedestal {
    height: 110px;
  }

  .resultados-podium__place--3 .resultados-podium__pedestal {
    height: 90px;
  }

  .resultados-podium__medal {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .resultados-podium__medal {
    width: 80px;
    height: 80px;
    font-size: 32px;
  }

  .resultados-top10__list {
    padding: 0 16px;
  }

  .resultados-top10__name {
    font-size: 13px;
  }

  .resultados-top10__meta {
    font-size: 10px;
  }

  .resultados-filters__search {
    font-size: 13px;
    padding: 8px 12px;
  }

  .resultados-filters__btn {
    font-size: 11px;
    padding: 6px 12px;
  }

  .resultados-top10__name {
    font-size: 13px;
  }

  .resultados-top10__chip {
    font-size: 13px;
  }
}

/* --- LIGHT MODE: Textos y colores inline --------------------------------- */
html:not(.dark-mode) .text-white {
  color: #000000 !important;
}

html:not(.dark-mode) .text-white\/90 {
  color: rgba(0, 0, 0, 0.9) !important;
}

html:not(.dark-mode) .text-white\/80 {
  color: rgba(0, 0, 0, 0.8) !important;
}

html:not(.dark-mode) .text-white\/70 {
  color: rgba(0, 0, 0, 0.7) !important;
}

html:not(.dark-mode) .text-white\/60 {
  color: rgba(0, 0, 0, 0.6) !important;
}

html:not(.dark-mode) .text-white\/50 {
  color: rgba(0, 0, 0, 0.5) !important;
}

html:not(.dark-mode) .text-white\/40 {
  color: rgba(0, 0, 0, 0.4) !important;
}

html:not(.dark-mode) .text-white\/25 {
  color: rgba(0, 0, 0, 0.25) !important;
}

html:not(.dark-mode) span[style*="color: #fff"],
html:not(.dark-mode) span[style*="color:#fff"],
html:not(.dark-mode) span[style*="color: #ffffff"],
html:not(.dark-mode) span[style*="color:#ffffff"],
html:not(.dark-mode) td[style*="color: #fff"],
html:not(.dark-mode) td[style*="color:#fff"],
html:not(.dark-mode) td[style*="color: #ffffff"],
html:not(.dark-mode) td[style*="color:#ffffff"] {
  color: #000000 !important;
}

html:not(.dark-mode) span[style*="color: #6c6c8a"],
html:not(.dark-mode) span[style*="color:#6c6c8a"],
html:not(.dark-mode) td[style*="color: #6c6c8a"],
html:not(.dark-mode) td[style*="color:#6c6c8a"],
html:not(.dark-mode) span[style*="color: #a1a1aa"],
html:not(.dark-mode) span[style*="color:#a1a1aa"],
html:not(.dark-mode) td[style*="color: #a1a1aa"],
html:not(.dark-mode) td[style*="color:#a1a1aa"],
html:not(.dark-mode) span[style*="color: #c4c4d4"],
html:not(.dark-mode) span[style*="color:#c4c4d4"] {
  color: rgba(0, 0, 0, 0.6) !important;
}

html:not(.dark-mode) span[style*="color: #00f5a0"],
html:not(.dark-mode) span[style*="color:#00f5a0"] {
  color: #00a870 !important;
}

html:not(.dark-mode) span[style*="color: #ff3cac"],
html:not(.dark-mode) span[style*="color:#ff3cac"],
html:not(.dark-mode) td[style*="color: #ff3cac"],
html:not(.dark-mode) td[style*="color:#ff3cac"] {
  color: #d61e7a !important;
}

html:not(.dark-mode) span[style*="color: #ff6b35"],
html:not(.dark-mode) span[style*="color:#ff6b35"] {
  color: #d64b20 !important;
}

html:not(.dark-mode) span[style*="color: #00d4ff"],
html:not(.dark-mode) span[style*="color:#00d4ff"],
html:not(.dark-mode) td[style*="color: #00d4ff"],
html:not(.dark-mode) td[style*="color:#00d4ff"] {
  color: #0088bb !important;
}

html:not(.dark-mode) span[style*="background: #2a2a2a"],
html:not(.dark-mode) button[style*="background: #2a2a2a"],
html:not(.dark-mode) div[style*="background: #2a2a2a"] {
  background-color: #e8e8f0 !important;
}

html:not(.dark-mode) button[style*="background-color: #000000"],
html:not(.dark-mode) input[style*="background-color: #000000"] {
  background-color: #f5f5f5 !important;
  color: #000000 !important;
}

html:not(.dark-mode) *[style*="color: #fff"],
html:not(.dark-mode) *[style*="color:#fff"],
html:not(.dark-mode) *[style*="color: #ffffff"],
html:not(.dark-mode) *[style*="color:#ffffff"],
html:not(.dark-mode) *[style*="color: white"],
html:not(.dark-mode) *[style*="color:white"] {
  color: #000000 !important;
}

html:not(.dark-mode) *[style*="color: #c4c4d4"],
html:not(.dark-mode) *[style*="color:#c4c4d4"],
html:not(.dark-mode) *[style*="color: #a1a1aa"],
html:not(.dark-mode) *[style*="color:#a1a1aa"],
html:not(.dark-mode) *[style*="color: #6c6c8a"],
html:not(.dark-mode) *[style*="color:#6c6c8a"] {
  color: rgba(0, 0, 0, 0.6) !important;
}

/* Light mode: mejora de apariencia */
html:not(.dark-mode) .resultados-table-wrapper {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset -48px 0 24px -24px rgba(0, 0, 0, 0.03) !important;
}

html:not(.dark-mode) .resultados-top10__card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

html:not(.dark-mode) .resultados-top10__card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-cyan);
}

html:not(.dark-mode) .resultados-tabs__btn {
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.73);
  background: rgba(0, 0, 0, 0.02);
}

html:not(.dark-mode) .resultados-tabs__btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.9);
}

html:not(.dark-mode) .resultados-tabs__btn--active {
  box-shadow: 0 2px 12px var(--color-primary);
}

html:not(.dark-mode) .resultados-filters__search {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

html:not(.dark-mode) .resultados-filters__search::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

html:not(.dark-mode) .resultados-filters__search:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 136, 187, 0.1);
}

html:not(.dark-mode) table {
  border-color: rgba(0, 0, 0, 0.1);
}

html:not(.dark-mode) th {
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

html:not(.dark-mode) tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

html:not(.dark-mode) tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* Light mode: Modal */
html:not(.dark-mode) #runnerModal .modal-dialog {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html:not(.dark-mode) #runnerModal h2,
html:not(.dark-mode) #runnerModal .text-white,
html:not(.dark-mode) #runnerModal span.text-white\/90 {
  color: #000000 !important;
}

html:not(.dark-mode) #runnerModal .text-white\/70 {
  color: rgba(0, 0, 0, 0.7) !important;
}

html:not(.dark-mode) #runnerModal .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html:not(.dark-mode) #runnerModal .bg-black\/20 {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark-mode) #runnerModal .modal-header-bg {
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.1)), var(--fondo-modal, linear-gradient(135deg, var(--color-primary), var(--color-accent))) !important;
  background-size: cover !important;
  background-position: center !important;
}

html:not(.dark-mode) #runnerModal .custom-scrollbar {
  background-color: #ffffff !important;
}

/* Light mode: fondo general del módulo y body */
html:not(.dark-mode) body,
html:not(.dark-mode) .resultados-module {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

html:not(.dark-mode) .modal-dialog,
html:not(.dark-mode) #runnerModal {
  color: var(--text-primary) !important;
}

/* Light mode: tabla — texto de celdas visible */
html:not(.dark-mode) .resultados-table td {
  color: var(--text-secondary) !important;
}

html:not(.dark-mode) .resultados-table th {
  color: var(--text-primary) !important;
}

/* Light mode: modal "todos los resultados" */
html:not(.dark-mode) #allResultsModal .modal-dialog {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html:not(.dark-mode) #allResultsModal .bg-\[\#1a1a1a\] {
  background-color: #ffffff !important;
}

html:not(.dark-mode) #allResultsModal {
  color: var(--text-primary) !important;
}

/* Light mode: texto en top 10 y tabla generado por JS con color hardcodeado */
html:not(.dark-mode) .resultados-table td[style*="color:#fff"],
html:not(.dark-mode) .resultados-table td[style*="color: #fff"],
html:not(.dark-mode) .resultados-table td[style*="color:#ffffff"],
html:not(.dark-mode) .resultados-table td[style*="color: #ffffff"] {
  color: var(--text-primary) !important;
}

/* Optimización: evitar transiciones en elementos con display y visibility changes */
.modal-overlay,
.modal-dialog,
[style*="display"],
[style*="visibility"] {
  transition: none !important;
}

/* Permitir transiciones solo en propiedades seguras */
.resultados-card,
.resultados-top10__card,
.resultados-tabs__btn,
.resultados-filters__btn {
  will-change: auto;
}

/* Deshabilitar transiciones al alternar tema */
html.dark-mode,
html:not(.dark-mode) {
  transition: none !important;
}

/* ===== LIGHT MODE: Modal detalle participante ===== */
html:not(.dark-mode) #runnerModal .bg-\[\#1a1a1a\],
html:not(.dark-mode) #runnerModal .custom-scrollbar {
  background-color: #ffffff !important;
}

html:not(.dark-mode) #runnerModal .bg-\[\#2a2a2a\] {
  background-color: #f0f0f5 !important;
}

html:not(.dark-mode) #runnerModal .bg-\[\#0c0c16\] {
  background-color: #eeeef5 !important;
}

html:not(.dark-mode) #runnerModal .border-white\/5 {
  border-color: rgba(0, 0, 0, 0.07) !important;
}

html:not(.dark-mode) #runnerModal .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.10) !important;
}

html:not(.dark-mode) #runnerModal .divide-white\/5>* {
  border-color: rgba(0, 0, 0, 0.07) !important;
}

html:not(.dark-mode) #runnerModal .text-\[\#6c6c8a\] {
  color: rgba(0, 0, 0, 0.50) !important;
}

html:not(.dark-mode) #runnerModal .text-\[\#f0f0f5\] {
  color: #1a1a1a !important;
}

html:not(.dark-mode) #runnerModal #btn-certificado {
  background-color: #f0f0f5 !important;
  color: #1a1a1a !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
}

/* ===== LIGHT MODE: Modal Foto de Finisher ===== */
html:not(.dark-mode) #finisherModal .bg-\[\#1a1a1a\] {
  background-color: #ffffff !important;
}

html:not(.dark-mode) #finisherModal .bg-\[\#07071a\] {
  background-color: #f0f0f8 !important;
}

html:not(.dark-mode) #finisherModal .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.10) !important;
}

html:not(.dark-mode) #finisherModal h2.text-white,
html:not(.dark-mode) #finisherModal p.text-white\/50,
html:not(.dark-mode) #finisherModal p.text-white\/25 {
  color: rgba(0, 0, 0, 0.6) !important;
}

html:not(.dark-mode) #finisherModal .text-white\/40 {
  color: rgba(0, 0, 0, 0.40) !important;
}

html:not(.dark-mode) #finisherModal .text-white\/70 {
  color: rgba(0, 0, 0, 0.70) !important;
}

html:not(.dark-mode) #finisherModal .bg-white\/5 {
  background-color: rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark-mode) #finisherModal .finisher-data-input {
  background-color: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #1a1a1a !important;
}

html:not(.dark-mode) #finisherModal .text-white\/80 {
  color: #1a1a1a !important;
}

html:not(.dark-mode) #finisherModal label.flex.items-center span {
  color: rgba(0, 0, 0, 0.70) !important;
}