/**
 * clasificacion-live.css
 * Estilos para el modo EN VIVO
 */

/* ============================================
   BADGE EN VIVO
   ============================================ */

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.live-badge-online {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  animation: pulse-glow 2s ease-in-out infinite;
}

.live-badge-offline {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

.live-badge-error {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  animation: shake 0.5s ease;
}

/* Punto parpadeante */
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: white;
  animation: blink 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.live-dot-offline {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #9ca3af;
}

.live-dot-error {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: white;
  animation: blink-slow 3s ease-in-out infinite;
}

/* ============================================
   ANIMACIONES
   ============================================ */

/* Parpadeo del punto */
@keyframes blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.8);
  }
}

@keyframes blink-slow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Brillo pulsante del badge */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3),
                0 0 20px rgba(239, 68, 68, 0.1);
  }
  50% {
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.5),
                0 0 30px rgba(239, 68, 68, 0.2);
  }
}

/* Sacudida para errores */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ============================================
   HIGHLIGHT DE PARTIDOS ACTUALIZADOS
   ============================================ */

.match-updated {
  animation: highlight-flash 2s ease-out;
  position: relative;
}

@keyframes highlight-flash {
  0% {
    background-color: rgba(251, 191, 36, 0);
    transform: scale(1);
  }
  10% {
    background-color: rgba(251, 191, 36, 0.3);
    transform: scale(1.02);
  }
  50% {
    background-color: rgba(251, 191, 36, 0.2);
  }
  100% {
    background-color: rgba(251, 191, 36, 0);
    transform: scale(1);
  }
}

/* Efecto de brillo cuando se actualiza */
.match-updated::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shine 1.5s ease-out;
  pointer-events: none;
}

@keyframes shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ============================================
   INDICADOR DE ÚLTIMA ACTUALIZACIÓN
   ============================================ */

#last-update {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
  padding: 4px 8px;
  background: rgba(107, 114, 128, 0.1);
  border-radius: 8px;
  transition: all 0.3s ease;
}

#last-update:hover {
  background: rgba(107, 114, 128, 0.2);
  color: #4b5563;
}

/* ============================================
   CONTROLES DESHABILITADOS (Modo Solo Lectura)
   ============================================ */

.live-badge ~ * input:disabled,
.live-badge ~ * select:disabled,
.live-badge ~ * textarea:disabled {
  background-color: #f3f4f6 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

/* Ocultar botones de edición en modo live */
body[data-live-mode="true"] .btn-guardar-cruce,
body[data-live-mode="true"] .btn-editar-cruce,
body[data-live-mode="true"] .btn-gestionar-partido {
  display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .live-badge {
    font-size: 12px;
    padding: 6px 12px;
    gap: 6px;
  }
  
  .live-dot,
  .live-dot-offline,
  .live-dot-error {
    width: 8px;
    height: 8px;
  }
  
  #last-update {
    font-size: 10px;
    padding: 3px 6px;
  }
}

/* ============================================
   LOADING / CONECTANDO
   ============================================ */

.connecting-indicator {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fbbf24;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   NOTIFICACIONES DE ACTUALIZACIÓN
   ============================================ */

.update-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  z-index: 1000;
  animation: slide-in 0.3s ease-out, fade-out 0.5s ease-in 2.5s forwards;
}

@keyframes slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
  .live-badge-offline {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  }
  
  #last-update {
    background: rgba(75, 85, 99, 0.2);
    color: #9ca3af;
  }
  
  #last-update:hover {
    background: rgba(75, 85, 99, 0.3);
    color: #d1d5db;
  }
}
