/* Red Badge Icons for Playlist Ranks */

.source-icon-container {
  position: relative;
  display: inline-block;
}

.rank-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  background-color: #dc3545;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  padding: 0 2px;
}

.rank-badge.single-digit {
  width: 16px;
}

.rank-badge.double-digit {
  width: 20px;
  border-radius: 10px;
}

/* Make badges larger on desktop */
@media screen and (min-width: 769px) {
  .rank-badge {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    top: -7px;
    right: -7px;
  }

  .rank-badge.single-digit {
    width: 18px;
  }

  .rank-badge.double-digit {
    width: 22px;
    border-radius: 11px;
  }
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
  .rank-badge {
    top: -4px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    font-size: 9px;
  }

  .rank-badge.single-digit {
    width: 14px;
  }

  .rank-badge.double-digit {
    width: 18px;
    border-radius: 9px;
  }
}

/* Ensure badges work well with existing source icons */
.track-sources .source-icon-container {
  margin-right: 8px;
}

.track-sources .source-icon-container:last-child {
  margin-right: 0;
}

/* Make service icons larger on desktop */
@media screen and (min-width: 769px) {
  .track-sources .source-icon {
    width: var(--size-soundcloud-md);
    height: var(--size-soundcloud-md);
  }
}

/* Keep default size on mobile */
@media screen and (max-width: 768px) {
  .track-sources .source-icon {
    width: var(--size-icon-sm);
    height: var(--size-icon-sm);
  }
}

/* Make external link icons larger on desktop */
@media screen and (min-width: 769px) {
  .external .source-icon {
    width: var(--size-soundcloud-md);
    height: var(--size-soundcloud-md);
  }
}

/* Keep external link icons default size on mobile */
@media screen and (max-width: 768px) {
  .external .source-icon {
    width: var(--size-icon-sm);
    height: var(--size-icon-sm);
  }
}
