/* ==========================================================================
   EUREKA 2026 - LEADERBOARD, PODIO 3D Y MODO PROYECCIÓN
   Licenciatura en Ciencias Matemáticas • UNAMIS Santa Rosa
   ========================================================================== */

/* ==========================================================================
   PODIO 3D DE CAMPEONES (SOPORTA MEDALLAS COMPARTIDAS)
   ========================================================================== */
.podium-container-wrap {
  margin-bottom: 32px;
  background: radial-gradient(ellipse at bottom, rgba(30, 58, 138, 0.25) 0%, rgba(14, 23, 38, 0.8) 70%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 32px 20px 24px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.podium-container-wrap::before {
  content: 'EUREKA 2026';
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.02);
  letter-spacing: 8px;
  pointer-events: none;
}

.podium-structure {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 380px;
}

.podium-pedestal-column {
  flex: 1;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.podium-pedestal-column:hover {
  transform: translateY(-8px);
}

/* Tarjeta flotante del estudiante sobre el pedestal */
.podium-avatar-card {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 12px;
  position: relative;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.podium-avatar-card.gold-glow {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.35);
  animation: floatGold 4s ease-in-out infinite;
}

.podium-avatar-card.silver-glow {
  border-color: rgba(203, 213, 225, 0.5);
  box-shadow: 0 0 25px rgba(203, 213, 225, 0.2);
}

.podium-avatar-card.bronze-glow {
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 0 25px rgba(217, 119, 6, 0.2);
}

@keyframes floatGold {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.animated-crown {
  position: absolute;
  top: -26px;
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.8));
  animation: crownBob 2s ease-in-out infinite;
}

@keyframes crownBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

/* Soporte para múltiples alumnos compartiendo la misma medalla */
.podium-multi-avatars-wrap {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.podium-shared-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.podium-photo-frame {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.podium-photo-frame.small-multi {
  width: 68px;
  height: 68px;
}

.podium-photo-frame.gold {
  box-shadow: 0 0 0 4px #f59e0b, 0 0 20px rgba(245, 158, 11, 0.6);
}
.podium-photo-frame.silver {
  box-shadow: 0 0 0 3px #cbd5e1, 0 0 15px rgba(203, 213, 225, 0.4);
}
.podium-photo-frame.bronze {
  box-shadow: 0 0 0 3px #d97706, 0 0 15px rgba(217, 119, 6, 0.4);
}

.podium-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
}

.medal-tag-corner {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6));
}

.podium-student-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.podium-student-inst {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.podium-grade-pill {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: #93c5fd;
  margin-bottom: 8px;
}

.podium-score-badge {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.podium-score-badge.gold {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #000;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.podium-score-badge.silver {
  background: linear-gradient(135deg, #e2e8f0 0%, #64748b 100%);
  color: #000;
}

.podium-score-badge.bronze {
  background: linear-gradient(135deg, #d97706 0%, #78350f 100%);
  color: #fff;
}

/* Pilares / Pedestales 3D */
.podium-pillar {
  width: 100%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.2), 0 8px 24px rgba(0,0,0,0.5);
}

.podium-1 .podium-pillar {
  height: 150px;
  background: linear-gradient(180deg, #d97706 0%, #78350f 100%);
  border-top: 3px solid #fde68a;
}

.podium-2 .podium-pillar {
  height: 110px;
  background: linear-gradient(180deg, #64748b 0%, #334155 100%);
  border-top: 3px solid #f1f5f9;
}

.podium-3 .podium-pillar {
  height: 85px;
  background: linear-gradient(180deg, #92400e 0%, #451a03 100%);
  border-top: 3px solid #fde68a;
}

.pillar-rank {
  font-size: 2.4rem;
  font-family: var(--font-mono);
  color: #ffffff;
  line-height: 1;
}

.pillar-label {
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   TABLA DE LEADERBOARD (RANKING DINÁMICO)
   ========================================================================== */
.leaderboard-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 80px 52px 1fr 180px 100px 48px;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.leaderboard-row:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

/* Resaltado de Medallas en Ranking */
.leaderboard-row.medal-row-gold {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(14, 23, 38, 0.95) 100%);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.leaderboard-row.medal-row-silver {
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.12) 0%, rgba(14, 23, 38, 0.95) 100%);
  border-color: rgba(203, 213, 225, 0.4);
}

.leaderboard-row.medal-row-bronze {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.12) 0%, rgba(14, 23, 38, 0.95) 100%);
  border-color: rgba(217, 119, 6, 0.4);
}

/* Efecto de fila recién actualizada */
.leaderboard-row.just-updated {
  animation: rowGlowPulse 2.5s ease-out;
}

@keyframes rowGlowPulse {
  0% { transform: scale(1.02); box-shadow: 0 0 25px #38bdf8; border-color: #38bdf8; }
  50% { transform: scale(1.01); box-shadow: 0 0 15px #38bdf8; }
  100% { transform: scale(1); }
}

.col-rank {
  display: flex;
  align-items: center;
}

.rank-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
}

.rank-badge.gold {
  color: #000;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.rank-badge.silver {
  color: #000;
  background: #e2e8f0;
}

.rank-badge.bronze {
  color: #fff;
  background: #d97706;
}

.col-avatar {
  width: 46px;
  height: 46px;
}

.row-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
  background: #1e293b;
}

.row-avatar.gold { border-color: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.row-avatar.silver { border-color: #cbd5e1; }
.row-avatar.bronze { border-color: #d97706; }

.row-student-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-note-pill {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.row-student-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.grade-tag {
  color: #38bdf8;
  font-weight: 600;
}

.dot-separator {
  color: var(--text-dim);
}

.score-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-bar-fill.standard { background: #38bdf8; }
.score-bar-fill.gold { background: linear-gradient(90deg, #f59e0b 0%, #fde68a 100%); }
.score-bar-fill.silver { background: linear-gradient(90deg, #94a3b8 0%, #f1f5f9 100%); }
.score-bar-fill.bronze { background: linear-gradient(90deg, #d97706 0%, #fed7aa 100%); }

.score-display-box {
  text-align: right;
  font-family: var(--font-mono);
}

.score-num {
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
}

.score-max {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.score-display-box.gold .score-num { color: #fbbf24; text-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
.score-display-box.silver .score-num { color: #e2e8f0; }
.score-display-box.bronze .score-num { color: #f59e0b; }

.btn-table-edit {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-table-edit:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ==========================================================================
   BANNER DE CONGRATULACIÓN HERMOSO Y FESTIVO (CELEBRATION POPUP)
   ========================================================================== */
.celebration-toast-overlay {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration-toast-overlay.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.celebration-card {
  background: rgba(11, 20, 36, 0.96);
  backdrop-filter: blur(16px);
  border: 2px solid #fbbf24;
  border-radius: var(--radius-lg);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.4), 0 0 20px rgba(0,0,0,0.8);
  min-width: 480px;
  max-width: 700px;
  position: relative;
  overflow: hidden;
}

.celebration-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shineToast 2s infinite;
}

@keyframes shineToast {
  0% { left: -100%; }
  100% { left: 200%; }
}

.toast-avatar-frame {
  position: relative;
  width: 72px;
  height: 72px;
}

.toast-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fbbf24;
}

.toast-crown {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.8));
}

.toast-content {
  flex: 1;
}

.toast-header-tag {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fbbf24;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toast-student-name {
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  margin: 2px 0;
}

.toast-student-sub {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.toast-score-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 900;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
  white-space: nowrap;
}

/* ==========================================================================
   MODO PROYECCIÓN EN PANTALLA GIGANTE (PROJECTION MODE)
   ========================================================================== */
body.projection-mode {
  background: #020617;
}

body.projection-mode .main-nav-bar,
body.projection-mode .view-toolbar,
body.projection-mode .col-actions,
body.projection-mode .header-quick-actions {
  display: none !important;
}

body.projection-mode .app-header {
  padding: 16px 36px;
  background: rgba(2, 6, 23, 0.95);
}

body.projection-mode .brand-logo-img {
  height: 68px;
  width: 68px;
}

body.projection-mode .brand-main-title {
  font-size: 1.8rem;
}

body.projection-mode .brand-institution {
  font-size: 1.1rem;
}

body.projection-mode .podium-structure {
  min-height: 480px;
  gap: 32px;
}

body.projection-mode .podium-pedestal-column {
  max-width: 340px;
}

body.projection-mode .podium-photo-frame {
  width: 120px;
  height: 120px;
}

body.projection-mode .podium-photo-frame.small-multi {
  width: 80px;
  height: 80px;
}

body.projection-mode .podium-student-name {
  font-size: 1.25rem;
}

body.projection-mode .podium-student-inst {
  font-size: 0.95rem;
}

body.projection-mode .podium-score-badge {
  font-size: 1.5rem;
  padding: 6px 20px;
}

body.projection-mode .leaderboard-row {
  padding: 18px 28px;
  font-size: 1.15rem;
}

body.projection-mode .row-student-name {
  font-size: 1.3rem;
}

body.projection-mode .row-student-sub {
  font-size: 1rem;
}

body.projection-mode .score-num {
  font-size: 1.8rem;
}

.floating-projection-exit-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(239, 68, 68, 0.85);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 800;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  display: none;
}

body.projection-mode .floating-projection-exit-btn {
  display: block;
}
