/* Sorteo Aleatorio - Estilos personalizados */

/* Animación del sorteo */
.sorteo-animation {
  position: relative;
  padding: 3rem 1rem;
}

.sorteo-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
  border: 4px solid rgba(79, 172, 254, 0.2);
  border-top-color: #4facfe;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.sorteo-current-name {
  font-size: 2rem;
  font-weight: bold;
  color: #0891b2;
  text-align: center;
  min-height: 3rem;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0.7;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Resultados */
.result-display {
  position: relative;
  overflow: hidden;
}

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.winner-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.winner-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.winner-item:first-child {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.winner-item:nth-child(2) {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
}

.winner-item:nth-child(3) {
  background: linear-gradient(135deg, #cd7f32, #e39d5c);
}

.winner-medal {
  font-size: 2rem;
  flex-shrink: 0;
}

.winner-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
}

/* Eliminados */
.eliminated-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.eliminated-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-radius: 0.75rem;
  border-left: 4px solid #ef4444;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.eliminated-item:hover {
  transform: translateX(4px);
  opacity: 1;
}

.eliminated-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.eliminated-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: #991b1b;
  text-decoration: line-through;
  text-decoration-color: #ef4444;
}

/* Animación de aparición */
.animate-pop {
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
  }

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

/* Equipos */
.teams-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.team-item {
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 1rem;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.team-item:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.team-item:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.team-item:nth-child(4) {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.team-item:nth-child(5) {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.team-item:nth-child(6) {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.team-item:nth-child(7) {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.team-item:nth-child(8) {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.team-item:nth-child(9) {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.team-item:nth-child(10) {
  background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%);
}

.team-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 0.5rem;
}

.team-members {
  list-style: none;
  padding: 0;
  margin: 0;
}

.team-members li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.team-members li:last-child {
  border-bottom: none;
}

/* Equipos con líderes */
.team-with-leader {
  background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%) !important;
  border: 3px solid #fbbf24;
  position: relative;
  overflow: hidden;
}

.team-with-leader::before {
  content: '👑';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 5rem;
  opacity: 0.1;
  transform: rotate(-15deg);
}

.team-leader {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #fbbf24;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 6px rgba(251, 191, 36, 0.3);
}

.leader-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.leader-name {
  color: #92400e;
  font-size: 1.125rem;
  font-weight: bold;
  flex: 1;
}

.team-members-section {
  margin-top: 1rem;
}

.members-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-with-leader .team-members {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.team-with-leader .team-members li {
  border-bottom-color: rgba(255, 255, 255, 0.25);
  padding: 0.4rem 0.5rem;
}

/* Confeti animado */
.confetti-emoji {
  position: absolute;
  font-size: 2rem;
  animation: fall 3s ease-out forwards;
  pointer-events: none;
}

@keyframes fall {
  0% {
    top: -10%;
    opacity: 1;
    transform: rotate(0deg);
  }

  100% {
    top: 100%;
    opacity: 0;
    transform: rotate(360deg);
  }
}

/* Historial */
#historyList .list-group-item {
  transition: background-color 0.2s ease;
}

#historyList .list-group-item:hover {
  background-color: #f8f9fa;
}

/* Modal de favoritos */
#favoritesListModal .list-group-item {
  transition: background-color 0.2s ease;
}

#favoritesListModal .list-group-item:hover {
  background-color: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
  .sorteo-current-name {
    font-size: 1.5rem;
  }

  .winner-name {
    font-size: 1rem;
  }

  .winner-medal {
    font-size: 1.5rem;
  }

  .teams-list {
    grid-template-columns: 1fr;
  }
}

/* Transiciones suaves */
.card {
  transition: all 0.3s ease;
}

.btn {
  transition: all 0.2s ease;
}

/* Badge de contador mejorado */
#participantCount {
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
}

/* Placeholder del textarea más opaco y distinguible */
#participantsInput::placeholder {
  color: #8e949b;
  opacity: 0.5;
  font-style: italic;
  font-size: 0.95rem;
}

#participantsInput:focus::placeholder {
  opacity: 0.3;
}

/* Mejorar contraste cuando está vacío */
#participantsInput:empty {
  background-color: #fafafa;
}

#participantsInput:focus {
  background-color: #ffffff;
  border-color: #4facfe;
  box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
}