/* =========================================
   1. VARIABLES & RESET (NUEVA PALETA)
   ========================================= */
:root {
  --bg-dark: #000000;     /* Negro Puro */
  --bg-card: #0a0a0a;     /* Negro casi puro para tarjetas */
  
  --brand: #FF8C00;       /* NARANJA (Color Principal) */
  --brand-2: #00BFFF;     /* AZUL (Deep Sky Blue - Contraste) */
  
  --text-main: #ffffff;   /* Blanco */
  --text-muted: #b0b0b0;  /* Gris claro */
  
  --glass-border: rgba(255, 255, 255, 0.1);
  --header-h: 90px;
  
  /* Degradado Naranja a Blanco para textos */
  --orange-grad: linear-gradient(135deg, #FF8C00 0%, #FFFFFF 100%);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }

/* Utilidades */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
.site-header { position: fixed; top: 0; width: 100%; z-index: 1000; padding: 15px 0; }

.header-inner.glass-panel {
  background: rgba(0, 0, 0, 0.85); /* Negro con transparencia */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  /* Borde inferior sutil azul para identidad */
  border-bottom: 1px solid rgba(0, 191, 255, 0.3); 
  border-radius: 100px;
  padding: 10px 30px;
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1250px; margin: 0 auto;
}

/* GRUPO LOGO + SLOGAN */
.brand-group { display: flex; align-items: center; gap: 15px; }
.brand img { height: 40px; filter: drop-shadow(0 2px 10px rgba(255, 140, 0, 0.3)); }

.slogan {
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--orange-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    border-left: 2px solid var(--brand-2); /* Línea Azul */
    padding-left: 15px;
    line-height: 1.2;
}

/* MENÚ DE NAVEGACIÓN */
.main-nav ul { display: flex; gap: 25px; list-style: none; margin: 0; padding: 0; }
.nav-link { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; position: relative; text-decoration: none; transition: 0.3s; }
.nav-link:hover, .nav-link.active { color: var(--brand); /* Naranja al pasar mouse */ }

.nav-link::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 0%; height: 2px;
    background: var(--brand-2); /* Línea Azul */
    transition: 0.3s;
}
.nav-link:hover::after { width: 100%; }

/* BOTÓN CAMBIAR EVENTO */
.btn-nav {
    background: transparent;
    border: 1px solid var(--brand); /* Borde Naranja */
    color: var(--brand);
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; font-weight: 600; white-space: nowrap;
}
.btn-nav:hover {
    background: var(--brand);
    color: black; /* Texto negro sobre fondo naranja */
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.4);
}

/* RESPONSIVE HEADER */
@media (max-width: 992px) { .slogan { display: none; } }
@media (max-width: 768px) {
    .header-inner.glass-panel { padding: 10px 20px; flex-wrap: wrap; justify-content: center; gap: 15px; border-radius: 20px; }
    .brand-group { width: 100%; justify-content: center; margin-bottom: 5px; flex-direction: column; gap: 5px; }
    .slogan { display: block; font-size: 0.8rem; border: none; padding: 0; } 
    .main-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 5px; }
    .main-nav ul { justify-content: center; gap: 15px; }
    .btn-nav { order: 2; width: 100%; justify-content: center; }
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.results-hero {
    text-align: center;
    padding: 160px 20px 40px; 
    /* Fondo Negro con luz Azul sutil arriba */
    background: radial-gradient(circle at top center, rgba(0, 191, 255, 0.1) 0%, var(--bg-dark) 60%);
    position: relative; overflow: hidden;
}

.event-logo-large {
    max-width: 280px; margin: 0 auto 20px;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
    animation: floatLogo 6s ease-in-out infinite;
}

.event-meta { display: flex; justify-content: center; gap: 15px; margin-top: 15px; flex-wrap: wrap; }
.meta-badge { 
    background: rgba(255,255,255,0.05); padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; 
    border: 1px solid var(--brand-2); /* Borde Azul */
    color: white; display: flex; align-items: center; gap: 8px; 
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #ccc; box-shadow: 0 0 5px currentColor; }
.status-finished { background: var(--brand); color: var(--brand); box-shadow: 0 0 8px var(--brand); }

/* =========================================
   4. PODIO (COLORES ACTUALIZADOS)
   ========================================= */
.podium-section { margin-bottom: 50px; perspective: 1000px; }
.podium-title { text-align: center; font-size: 1.5rem; margin: 40px 0 20px; color: var(--brand); text-transform: uppercase; letter-spacing: 2px; font-weight: bold; border-bottom: 1px solid #333; display:inline-block; padding-bottom:5px;}

.dual-podium-wrapper { display: flex; justify-content: center; gap: 40px; width: 100%; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; }
.podium-column { flex: 1; min-width: 300px; display: flex; flex-direction: column; align-items: center; }
.podium-container { display: flex; justify-content: center; align-items: flex-end; gap: 10px; height: 350px; width: 100%; padding-bottom: 20px; }

.podium-place { width: 30%; min-width: 90px; display: flex; flex-direction: column; align-items: center; position: relative; transition: transform 0.3s; }
.place-1 { z-index: 10; } 
.place-2, .place-3 { z-index: 5; }
.podium-place:hover { transform: translateY(-5px); }

/* AVATAR */
.podium-avatar {
    width: 60px; height: 60px;
    background: #111; /* Negro */
    border: 2px solid var(--brand-2); /* Borde Azul */
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    margin-bottom: -20px; 
    font-weight: bold; font-size: 1.4rem; color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
    position: relative; z-index: 2; 
}

/* BARRAS */
.podium-bar {
    width: 100%; border-radius: 12px 12px 0 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1); border-bottom: none;
    display: flex; justify-content: center; align-items: flex-end;
    position: relative; z-index: 1; 
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.medal-img {
    position: absolute; top: -50px; left: 50%; transform: translateX(-50%); width: 70px;
    filter: drop-shadow(0 0 15px rgba(255, 140, 0, 0.6)); /* Sombra Naranja */
    z-index: 20; animation: floatMedal 3s ease-in-out infinite; pointer-events: none;
}
@keyframes floatMedal { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }

.winner-info { text-align: center; margin-bottom: 15px; z-index: 3; }
.winner-name { font-weight: 800; color: white; font-size: 0.9rem; display: block; }
.winner-time { font-family: 'Courier New', monospace; color: var(--brand-2); font-size: 0.85rem; background: rgba(0,0,0,0.8); padding: 2px 6px; border-radius: 4px; border: 1px solid #333; }

/* COLORES PODIO */
.place-1 .podium-bar { height: 200px; border-top: 4px solid var(--brand); background: linear-gradient(to bottom, rgba(255, 140, 0, 0.2), rgba(0,0,0,0.8)); }
.place-1 .podium-avatar { border-color: var(--brand); background: #221100; color: var(--brand); }

.place-2 .podium-bar { height: 140px; border-top: 4px solid #fff; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(0,0,0,0.8)); }
.place-2 .podium-avatar { border-color: #fff; color: #fff; }

.place-3 .podium-bar { height: 100px; border-top: 4px solid var(--brand-2); background: linear-gradient(to bottom, rgba(0, 191, 255, 0.15), rgba(0,0,0,0.8)); }
.place-3 .podium-avatar { border-color: var(--brand-2); color: var(--brand-2); }

/* =========================================
   5. CONTROLES Y TABLAS
   ========================================= */
.controls-bar { display: flex; justify-content: center; margin-bottom: 30px; }
.search-box { position: relative; width: 100%; max-width: 400px; }
.search-box input {
    width: 100%; padding: 12px 20px 12px 50px;
    background: #111; border: 1px solid #333;
    border-radius: 50px; color: white; outline: none; transition: 0.3s;
}
.search-box input:focus { border-color: var(--brand); background: #1a1a1a; box-shadow: 0 0 10px rgba(255, 140, 0, 0.2); }
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.tabs-container { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.tab-btn {
    background: transparent; border: 1px solid #333;
    color: #888; padding: 10px 20px; border-radius: 30px; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; gap: 8px;
}
.tab-btn:hover { border-color: var(--brand); color: white; }
.tab-btn.active { background: var(--brand); color: black; border-color: var(--brand); font-weight: bold; box-shadow: 0 0 15px rgba(255, 140, 0, 0.4); }

.tab-content { display: none; width: 100%; animation: fadeIn 0.5s; }
.tab-content.active { display: block; }

.table-container {
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-radius: 16px; background: #0f0f0f;
    border: 1px solid #222; margin-top: 20px;
}
.results-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.results-table th { background: #1a1a1a; padding: 15px; text-align: left; color: var(--brand-2); font-size: 0.85rem; text-transform: uppercase; border-bottom: 2px solid #333; }
.results-table td { padding: 15px; border-bottom: 1px solid #222; color: white; font-size: 0.9rem; }
.rank-badge { display: inline-block; width: 28px; height: 28px; line-height: 28px; text-align: center; background: #333; border-radius: 50%; font-size: 0.8rem; font-weight: bold; color: var(--brand); }

.btn-cert {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent; color: var(--brand-2);
    padding: 5px 10px; border-radius: 6px; border: 1px solid var(--brand-2);
    font-size: 0.75rem; text-decoration: none; text-transform: uppercase; font-weight: bold;
}
.btn-cert:hover { background: var(--brand-2); color: black; }

.cat-header { width: 100%; text-align: center; margin: 60px 0 30px; border-bottom: 2px solid var(--brand); line-height: 0.1em; }
.cat-header span { background: var(--bg-dark); padding: 0 20px; color: var(--brand); font-size: 1.5rem; font-weight: bold; text-transform: uppercase; }

/* =========================================
   6. OTROS
   ========================================= */
#preloader { position: fixed; inset: 0; background-color: var(--bg-dark); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.6s; }
.loader-spinner { width: 40px; height: 40px; border: 4px solid #333; border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#eventModal { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.5s; }
.event-card { background: #111; border: 1px solid var(--brand); padding: 30px; border-radius: 15px; cursor: pointer; text-align: center; width: 250px; transition: 0.3s; color: white; margin: 10px; }
.event-card:hover { transform: translateY(-10px); background: #1a1a1a; box-shadow: 0 0 20px rgba(255, 140, 0, 0.2); }
.event-card i { font-size: 3rem; margin-bottom: 15px; color: var(--brand); }
.event-card h3 { color: white; }

.site-footer { border-top: 1px solid #222; background: #000; padding: 50px 0 20px; margin-top: 80px; text-align: center; }
.whatsapp-btn { display: inline-flex; align-items: center; gap: 10px; background-color: #25D366; color: white; padding: 12px 25px; border-radius: 50px; font-weight: bold; text-decoration: none; margin-top: 15px; border: 2px solid transparent; }
.whatsapp-btn:hover { background-color: black; border-color: #25D366; color: #25D366; }

@media (max-width: 768px) {
    .dual-podium-wrapper { flex-direction: column; }
    .podium-column { width: 100%; }
}
@keyframes floatLogo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpFade { to { opacity: 1; transform: translateY(0); } }